ea42165ed2
- Queue bounded ordered terminal input so acknowledgements remain responsive - Prevent stale sockets and retries from replacing healthy connections - Preserve desktop scrollback behavior and add terminal regression coverage Quality gates: frontend tests (91 passed), typecheck, lint, build, Python compilation, LSP diagnostics. Backend pytest skipped by user request.
1.6 KiB
1.6 KiB
Fix Web Terminal Resilience — Tasks
Review Workload Forecast
| Field | Value |
|---|---|
| Estimated changed lines | 180–280 |
| 400-line budget risk | Low |
| Chained PRs recommended | No |
| Suggested split | Single focused change |
| Delivery strategy | single-pr |
| Chain strategy | feature-branch-chain |
Decision needed before apply: No Chained PRs recommended: No Chain strategy: feature-branch-chain 400-line budget risk: Low
Tasks
- RED — backend input/control concurrency: characterize a PTY write that waits for readiness while an acknowledgement is received; prove the acknowledgement is handled without waiting for that write to finish.
- GREEN — ordered input writer: move PTY writes behind one cancellable ordered queue/worker while retaining the current public WebSocket message protocol and input ordering.
- TRIANGULATE — lifecycle: cover worker cancellation and queued-write failure/disconnect handling.
- RED — frontend socket ownership: characterize stale close/retry callbacks after a newer socket has become current.
- GREEN — reconnect ownership: ensure only the current socket can update state or schedule a retry; cancel retry timers during cleanup.
- REFACTOR: keep the connection lifecycle readable and avoid changing the intentional desktop scrollback configuration.
- Verify: run targeted backend and frontend tests, frontend typecheck/lint/build, backend checks practical in the isolated worktree, and inspect diagnostics. (Backend pytest is unavailable locally: no pytest/uv executable; Docker test execution was explicitly declined.)