Repository navigation
refactor(tui): remove test-only shutdown timer hooks - #140432
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
8a73e19 to
ef78234
Compare
|
Codex review: needs maintainer review before merge. Reviewed September 6, 2026, 4:52 PM ET / 20:52 UTC. ClawSweeper reviewWhat this changesRemoves test-only timer and process-output hooks from terminal UI shutdown and updates tests to observe native timers and process spies. Merge readiness✅ Ready for maintainer review This remains useful, bounded cleanup: current main retains the test-only hooks, and the reviewed patch preserves production shutdown behavior. No actionable findings remain from this review or the supplied prior review. Priority: P3 Review scores
Verification
How this fits togetherThe terminal UI shutdown owner stops active work, releases the terminal, and bounds cleanup with an exit watchdog. Standalone CLI and setup callers use it, with setup retaining a longer temporary-Gateway cleanup deadline. flowchart TD
A[Terminal exit request] --> B[Shutdown owner]
B --> C[Stop active work and connection]
C --> D[Restore terminal]
D --> E[Finish terminal UI]
B --> F[Unreferenced exit watchdog]
E --> G[Standalone return or setup cleanup]
F --> H[Force exit at deadline]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -37, Tests -7. Total -44 across 2 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep one native shutdown timer path while preserving standalone watchdog behavior and setup's longer, cancelable cleanup budget. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR removes unused test seams rather than reporting a runtime defect; caller inspection confirms production already uses the native path. Is this the best way to solve the issue? Yes. Removing the alternate implementations and testing native timer state preserves the existing owner and avoids maintaining test-only production branches. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 800846921e1b. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
Merged via squash.
|
…ig-ref * origin/main: (31 commits) docs(web): split the Control UI page into task pages (#140437) fix: tool_search rejects calls that send both query and queries (#140310) fix(update): preserve rollback and truthful serving reports (#140419) fix: restore context when CLI recovery starts a fresh session (#140294) refactor(tests): retain transport-driven auth dismissal coverage (#140430) fix: stop unfinished subagents before resetting a conversation (#140417) fix(models): cap configured output at the final context window (#140436) refactor(mcp): reuse transport config normalization (#140439) test(gateway): preserve saved config in auth reload fixture (#140433) fix(plugins): inherit active config for embedded agent runs (#140435) refactor(tui): remove test-only shutdown timer hooks (#140432) fix(agents): preserve channel silent-reply guidance (#138345) fix(tasks): cancel resumed yielded subagent tasks (#140410) refactor(doctor): share compaction config traversal (#140330) fix(doctor): restore LINE and Mattermost account promotion (#136045) docs: remove the empty release-sections nav group (#140427) fix(tooling): omit Codex machine squash credit (#140420) chore(ui): refresh control ui locales (#140384) refactor(plugin-sdk): reuse native approval input contracts (#140415) fix: silent model WebSocket streams hang past the idle timeout (#140335) ... # Conflicts: # docs/web/control-ui.md
What Problem This Solves
TUI shutdown maintained custom timer and process-sink variants used only by its tests. That duplicated the native Node path that standalone TUI and setup actually execute.
Why This Change Was Made
Use native timers, stderr, and process exit in the shutdown owner; exercise timer state and process sinks through Vitest instead of injecting alternative implementations. Repository-wide callers use none of the removed hooks. Setup's
delayMsoverride remains, preserving its longer local cleanup budget. The TUI helpers have no declared package or plugin SDK subpath contract.History:
dc8f90197e6introduced the drained-teardown exit path;f4871eb86b4added custom/native timer branching for test typing;78796d8e230established the setup cleanup budget that this change retains. Follow-up deletion work for #135868.User Impact
No intended behavior change. Shutdown ordering, terminal restoration after transport failure, error reporting, watchdog deadlines, unref behavior, and cancellation remain unchanged. Net production −37 lines; tests −7 lines.
Evidence
node scripts/check-changed.mjs: exit 0, including typechecking, lint, guards, dead exports, and import cycles. Independent Codex review: scoped-clean through P2.src/tui/tui.test.ts:1007retains terminal cleanup after transport rejection and now verifies the native timer is removed;:1093checks the real watchdog's unreferenced state;:1102retains deadline/diagnostic/exit proof through fake timers and process spies. The embedded shutdown cancellation case at:1080remains.ef7823423d84d62bfcfa8322162ae768a4c28f49: no findings, security concerns, or rank-up changes requested. Maintainer source review agrees.