Repository navigation
fix(sessions): preserve active chat input during announcements - #163655
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. |
|
Codex review: needs real behavior proof before merge. What this changesThis PR prevents announcements from adopting or exposing accepted input that another active request still owns. Example: A user submits “queued user request” before a same-session child-result announcement runs.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains Keep this PR: it addresses a concrete input-custody defect still present on current main, and the previous replay-coverage finding is fixed; no new actionable defect was found. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe pending-input owner tracks accepted request custody; embedded session preparation uses those facts to protect transcript entries and filter the messages sent to the model. flowchart LR
A[Accepted chat input] --> B[Pending input custody]
B --> C[Canonical transcript]
B --> D[Attempt preparation]
C --> D
D --> E[Announcement context]
D --> F[Original request continuation]
E --> G[Model provider]
F --> G
Technical reviewBest possible solution: Use the existing pending-input registry to preserve foreign custody through announcements, collection, and committed replay. Do we have a high-confidence way to reproduce the issue? The canonical report supplies a deterministic boundary reproduction, and current-main source still lacks foreign-custody checks; this read-only review did not execute tests or reproduce a production incident. Is this the best way to solve the issue? The patch fixes the owning invariant by connecting existing custody facts to orphan repair and provider conversion, preserves separate execution checks, and replaces committed replay’s separate lifecycle closure with the registered owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 1b7c89eea0d6. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +199, Tests +527, Docs +4. Total +730 across 18 files. Added test files: 3. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes: No label changes. Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (24 earlier review cycles; latest 8 shown)
Reviewed October 25, 2026, 1:38 AM ET / 05:38 UTC (Revision 25). |
|
Real after-fix verification on The fixture paused only inbound dispatch scheduling after the real Data compatibility: |
|
@clawsweeper re-review The PR body now includes the verified after-fix official DeepSeek Responses evidence for exact head |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
🦞👀 Re-review progress:
|
|
Hi @steipete, the conflicts are resolved and this PR remains a single commit. CI is green on head Could you please review and consider merging when you have a chance? Thanks! |
Keep foreign accepted inputs out of announcement orphan repair and model context by consulting the existing pending-input owner. Publish collect promotion at commit and retain committed replay custody without changing execution authority or persistent state. Preserve the contributor's original work while integrating current main and reducing the implementation to the custody-to-attempt boundary. Co-authored-by: Chuanlei Guo <[email protected]>
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
Closes #165500
What Problem This Solves
Fixes announcements adopting another active request's accepted input as an orphan, changing the transcript and including that input in the announcement's model context.
User Impact
Background announcements leave active user input available for its original request, including collected inputs and committed inputs resumed after a restart. The original request can continue with its input exactly once.
Why This Change Was Made
Transcript shape cannot distinguish an abandoned user turn from input that another request still owns. The attempt boundary now consults the existing input-custody owner, follows committed collect promotion, and excludes foreign live inputs from orphan repair and model context. It samples custody around transcript reload and keeps the resulting exclusions fixed for the attempt.
Committed replay now uses the existing registered-owner lifecycle while preserving its queued receipt and canonical committed message. Execution permission remains independently checked; revoking execution does not give an unrelated announcement custody of accepted input.
Thanks @chuanleiguo (Chuanlei Guo) for the original fix. The revision removes asynchronous profile-discovery machinery and reduces the patch from 1,506 to 1,038 changed lines: production +278/-79, tests and routing +602/-75, documentation +4. The remaining production growth connects existing custody, transcript promotion, replay, and attempt preparation without adding persistent state.
Evidence
96825de52d58: 3 failed / 1 passed. The failing cases expose foreign user text in announcement/provider context; the excluded-input control passes. The initial unrouted run failed before the product boundary and is recorded separately as a setup failure. Candidate run on the same pinned base: 126 tests passed across 10 files, including the three previously failing behaviors and late collect promotion.3636968cb1bbwithout changing any of the 17 candidate files. Replayed the boundary and custody suites against the integrated tree: 7 passed in 307.19 seconds. The final correction also integrates pinned mainebbe13ef1cb8, including the existing transcript-context module extraction. The final two focused tests pass on that integrated tree (151.23 seconds including worker setup and cleanup).40163419032exposed a shared TS2345 error in physical read-target preparation. The captured session key is now normalized once and supplied to the existing target owner.pnpm tsgo:core, targeted lint/format, and all five physical-target regressions pass (333.63 seconds including worker setup/cleanup).40164514624found an overly generic test message type and a stale replay-error expectation. The fixtures now usePersistedUserTurnMessageand the existing mismatch classifier. Both focused regressions and the affected test TypeScript project pass; production custody checks remain unchanged. Normal thinking/error transcript suffixes remain allowed.40165903771ataa87345ebf628a58ff1457322c3a1da4dc626b64is GREEN, with zero pending checks. Full production/test types, lint, runtime checks, and all PostgreSQL conformance shards passed. Final ClawSweeper review found no actionable code issues; it retains the historical-only Gateway proof limitation described above.