Repository navigation
refactor(auto-reply): share command body resolution - #130222
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:04 PM ET / 17:04 UTC. ClawSweeper reviewWhat this changesThe PR exports the auto-reply command-body resolver and reuses it in fallback command detection, deleting the duplicate precedence logic. Merge readinessKeep this PR open. The refactor is correct: it removes a duplicated command-body precedence implementation and makes fallback detection reuse the command-turn owner; only routine exact-head CI completion remains. Priority: P3 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherAuto-reply normalizes inbound message fields into a command body, then uses it to classify command turns and select reply behavior. This change consolidates that normalization boundary for context construction and fallback detection. flowchart LR
A[Inbound message fields] --> B[Command body resolver]
B --> C[Command-turn context]
B --> D[Fallback command detection]
C --> E[Auto-reply routing]
D --> E
Before merge
Agent review detailsSecurityNone. PR surfaceSource -11. Total -11 across 2 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep command-body precedence in the command-turn context module and reuse it from every consumer. Do we have a high-confidence way to reproduce the issue? Not applicable: this is a behavior-preserving refactor, and current tests directly cover the shared precedence invariant. Is this the best way to solve the issue? Yes. The command-turn context is the existing normalization owner, so fallback detection should reuse its resolver rather than maintain a parallel copy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8ce8085e8459. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
What Problem This Solves
Command-body fallback precedence was implemented twice inside the auto-reply command-turn path. Keeping both copies aligned made future normalization changes easier to miss.
Why This Change Was Made
Exports the existing command-turn context resolver and reuses it from fallback detection. The canonical empty
commandTextprecedence and legacy field order remain unchanged.User Impact
No user-visible behavior change. This removes duplicate command normalization policy and keeps detection aligned with command-turn context construction.
Evidence
node scripts/run-vitest.mjs src/auto-reply/command-turn-context.test.ts src/auto-reply/reply/source-reply-delivery-mode.test.ts— 46 tests passed.node scripts/check-changed.mjs -- src/auto-reply/command-turn-context.ts src/auto-reply/command-turn-detection.ts— all checks passed except the initial core-test typecheck, which resolved rootpako@1because this sparse worktree lacked its UI workspace dependency link.node scripts/run-tsgo-core-test-shards.mjs— passed after linking the existing sharedui/node_modules; hosted exact-head typechecks also use the complete workspace install.run_1016adef13a8on leasecbx_d27fd6fdfe2a— fresh PR checkout, frozen install, and 46 tests passed; lease stopped after the run.AI-assisted: yes