refactor: migrate exec bridge to anyio and harden cancellation (#6)
This commit is contained in:
+3
-3
@@ -44,8 +44,8 @@ The orchestrator module containing:
|
||||
|
||||
**Key patterns:**
|
||||
- Per-session locks prevent concurrent resumes to the same `session_id`
|
||||
- Worker pool with `asyncio.Queue` limits concurrency (default: 16 workers)
|
||||
- `asyncio.TaskGroup` manages worker tasks
|
||||
- Worker pool with an AnyIO memory stream limits concurrency (default: 16 workers)
|
||||
- AnyIO task groups manage worker tasks
|
||||
- Progress edits are throttled to ~2s intervals
|
||||
- Subprocess stderr is drained to a bounded deque for error reporting
|
||||
- `poll_updates()` uses Telegram `getUpdates` long-polling with a single server-side updates
|
||||
@@ -154,5 +154,5 @@ Same as above, but:
|
||||
|----------|----------|
|
||||
| `codex exec` fails (rc≠0) | Shows stderr tail in error message |
|
||||
| Telegram API error | Logged, edit skipped (progress continues) |
|
||||
| Cancellation | Subprocess terminated, CancelledError re-raised |
|
||||
| Cancellation | Cancel scope triggers terminate; cancellation is detected via `cancelled_caught` |
|
||||
| No agent_message | Final shows "error" status |
|
||||
|
||||
Reference in New Issue
Block a user