| 1 | # wait.py DOX |
| 2 | |
| 3 | ## Purpose |
| 4 | |
| 5 | - Own the `wait.py` helper module. |
| 6 | - This module formats and runs managed waits with progress updates. |
| 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 | - Top-level functions: |
| 14 | - `format_remaining_time(total_seconds: float) -> str` |
| 15 | - `async managed_wait(agent, target_time, is_duration_wait, log, get_heading_callback)` |
| 16 | |
| 17 | ## Runtime Contracts |
| 18 | |
| 19 | - Helper modules own reusable framework APIs and must preserve public callers unless all callers, tests, and docs are updated together. |
| 20 | - Update this file whenever public functions, classes, persistence behavior, path/security assumptions, side effects, or cross-module contracts change. |
| 21 | - Imported dependency areas include: `asyncio`, `helpers.localization`, `helpers.print_style`. |
| 22 | |
| 23 | ## Key Concepts |
| 24 | |
| 25 | - Important called helpers/classes observed in the source: `divmod`, `join`, `Localization.get.now`, `total_seconds`, `agent.handle_intervention`, `asyncio.sleep`, `pause_duration.total_seconds`, `PrintStyle.info`, `get_heading_callback`, `format_remaining_time`, `Localization.get.serialize_datetime`. |
| 26 | - Keep request/response, tool, or helper semantics documented here at the same time as source changes. |
| 27 | |
| 28 | ## Work Guidance |
| 29 | |
| 30 | - Preserve public helper APIs used by core code and plugins unless every caller is updated. |
| 31 | - Keep path, auth, secret, persistence, network, and subprocess behavior explicit and bounded. |
| 32 | - Prefer adding cohesive helper functions here only when behavior is reused across modules. |
| 33 | |
| 34 | ## Verification |
| 35 | |
| 36 | - Run targeted tests for changed helper behavior; run security regressions for auth, filesystem, WebSocket, tunnel, upload, or secret-handling helpers. |
| 37 | - Related tests observed by source search: |
| 38 | - `tests/email_parser_test.py` |
| 39 | - `tests/rate_limiter_test.py` |
| 40 | - `tests/test_api_chat_lifetime.py` |
| 41 | - `tests/test_browser_agent_regressions.py` |
| 42 | - `tests/test_chat_compaction.py` |
| 43 | - `tests/test_default_prompt_budget.py` |
| 44 | - `tests/test_document_query_plugin.py` |
| 45 | - `tests/test_download_toast_regressions.py` |
| 46 | |
| 47 | ## Child DOX Index |
| 48 | |
| 49 | No child DOX files. |