Skip to content

docs: add docstrings to Computer and AsyncComputer abstract methods#2876

Closed
RudrenduPaul wants to merge 1 commit intoopenai:mainfrom
RudrenduPaul:docs/add-docstrings-computer-abstract-methods
Closed

docs: add docstrings to Computer and AsyncComputer abstract methods#2876
RudrenduPaul wants to merge 1 commit intoopenai:mainfrom
RudrenduPaul:docs/add-docstrings-computer-abstract-methods

Conversation

@RudrenduPaul
Copy link
Copy Markdown

Summary

The abstract methods on Computer and AsyncComputer in src/agents/computer.py had no docstrings. Both classes are part of the public API (exported from agents/__init__.py) and are intended to be subclassed by users who want to integrate custom computer-control backends with the ComputerTool.

Without docstrings, IDE tooltips and help() show nothing for these methods, making the contract unclear for implementors.

This PR adds a single-line docstring to each of the 9 abstract methods on both classes (18 methods total):

  • screenshot — describe return value (base64-encoded image data)
  • click — describe coordinate and button parameters
  • double_click — describe coordinate parameters
  • scroll — describe coordinate and scroll-unit parameters
  • type — describe what text is typed and where
  • wait — describe purpose (signal readiness for next action)
  • move — describe cursor movement
  • keypress — describe key list format (e.g. ["ctrl", "c"])
  • drag — describe waypoint path argument

Test plan

  • ruff format --check src/agents/computer.py — already formatted
  • ruff check src/agents/computer.py — no lint errors
  • Docs-only change; no runtime behaviour is altered

The abstract methods on both Computer and AsyncComputer (screenshot,
click, double_click, scroll, type, wait, move, keypress, drag) had no
docstrings, leaving implementors without inline guidance on what each
method should do. Add a one-line docstring to every abstract method so
subclass authors and IDE tooltips have a clear contract description.

Built by Rudrendu Paul, developed with Claude Code
@seratch
Copy link
Copy Markdown
Member

seratch commented Apr 15, 2026

Thank you so much for sending this. This is resolved by #2877

@seratch seratch closed this Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants