Repository navigation
refactor(chat): share terminal ack normalization - #130263
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 26, 2026, 1:42 PM ET / 17:42 UTC. ClawSweeper reviewWhat this changesThe PR centralizes ACP and terminal-UI handling of terminal Merge readinessKeep this maintainer-owned refactor open. Current main still has the duplicated ACP and TUI acknowledgement predicates, while the PR replaces them with one private, behavior-preserving normalization boundary backed by existing client behavior tests and a focused helper test. Priority: P3 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherACP and the terminal UI both submit chat turns through the Gateway and interpret immediate acknowledgements before updating prompt or viewport state. The shared helper classifies only terminal flowchart LR
A[Operator prompt] --> B[ACP or terminal UI]
B --> C[Gateway chat request]
C --> D[Chat acknowledgement]
D --> E[Shared terminal-status normalization]
E --> F[Client completion or error handling]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -8, Tests +19. Total +11 across 4 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Rebase onto current main, retain the private shared helper and focused mapping test, then merge after exact-head checks complete. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR refactors an existing internal acknowledgement classification rather than reporting a user-facing defect. Is this the best way to solve the issue? Yes. A narrow private helper removes duplicated terminal-status policy while preserving the ACP and TUI callers' distinct lifecycle behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 3be7baa1a37c. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
What Problem This Solves
ACP and TUI independently normalized the same terminal
chat.sendacknowledgement statuses. Keeping those predicates duplicated makes the accepted terminal set easier to drift across two operator-facing clients.Why This Change Was Made
Move the existing
ok/timeout/errornormalization into one private shared helper and reuse it from ACP and TUI. Each caller keeps its existing success, failure, cleanup, and non-terminal behavior.User Impact
No user-visible behavior change. Terminal chat acknowledgements now have one canonical normalization path across ACP and TUI.
Evidence
run_33c91e58be63on leasecbx_ba45a4cdcebf: frozen install passed; all 260 tests passed; lease stopped.pnpm check:import-cycles: 0 runtime value cycles.check-changed: passed.