| 1 | # wait.py DOX |
| 2 | |
| 3 | ## Purpose |
| 4 | |
| 5 | - Own the `wait.py` agent tool. |
| 6 | - This module lets the agent wait for a managed duration while respecting intervention flow. |
| 7 | - Keep this file-level DOX profile synchronized with `wait.py` because this directory is intentionally flat. |
| 8 | |
| 9 | ## Ownership |
| 10 | |
| 11 | - `wait.py` owns the runtime implementation. |
| 12 | - `wait.py.dox.md` owns durable notes about responsibilities, contracts, side effects, and verification for that implementation. |
| 13 | - Classes: |
| 14 | - `WaitTool` (`Tool`) |
| 15 | - `async execute(self, **kwargs) -> Response` |
| 16 | - `get_log_object(self)` |
| 17 | - `get_heading(self, text: str=..., done: bool=...)` |
| 18 | |
| 19 | ## Runtime Contracts |
| 20 | |
| 21 | - Tool modules must define `helpers.tool.Tool` subclasses and return `helpers.tool.Response` from `execute(...)`. |
| 22 | - Update this file whenever tool arguments, output shape, `break_loop` behavior, intervention handling, prompt instructions, or side effects change. |
| 23 | - `WaitTool` is a `Tool`. |
| 24 | - `WaitTool` defines `execute(...)`. |
| 25 | - Observed side-effect areas: settings/state persistence. |
| 26 | - Imported dependency areas include: `asyncio`, `datetime`, `helpers.localization`, `helpers.print_style`, `helpers.tool`, `helpers.wait`. |
| 27 | |
| 28 | ## Key Concepts |
| 29 | |
| 30 | - Important called helpers/classes observed in the source: `Localization.get.now`, `PrintStyle.info`, `self.agent.read_prompt`, `Response`, `self.agent.context.log.log`, `self.agent.handle_intervention`, `timedelta`, `managed_wait`, `Localization.get.localtime_str_to_utc_dt`, `wait_duration.total_seconds`, `Localization.get.serialize_datetime`, `self.get_heading`, `ValueError`. |
| 31 | - Keep request/response, tool, or helper semantics documented here at the same time as source changes. |
| 32 | |
| 33 | ## Work Guidance |
| 34 | |
| 35 | - Keep tool output concise, model-readable, and safe for history persistence. |
| 36 | - Coordinate argument or behavior changes with prompt tool instructions and skill guidance. |
| 37 | - Respect intervention flow for long-running, external, or user-visible operations. |
| 38 | |
| 39 | ## Verification |
| 40 | |
| 41 | - Run targeted tool and prompt-contract tests for changed behavior; smoke-test agent execution when no focused test exists. |
| 42 | - Related tests observed by source search: |
| 43 | - `tests/email_parser_test.py` |
| 44 | - `tests/rate_limiter_test.py` |
| 45 | - `tests/test_api_chat_lifetime.py` |
| 46 | - `tests/test_browser_agent_regressions.py` |
| 47 | - `tests/test_chat_compaction.py` |
| 48 | - `tests/test_default_prompt_budget.py` |
| 49 | - `tests/test_document_query_plugin.py` |
| 50 | - `tests/test_download_toast_regressions.py` |
| 51 | |
| 52 | ## Child DOX Index |
| 53 | |
| 54 | No child DOX files. |