Repository navigation
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 maintainer review before merge. What this changesThis PR binds the Codex mirror write assertion to the resolved transcript target before acquiring its writer. Example: Persist assistant text "settled" for session-1 using session key agent:main:session-1 without an explicit agentId.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Regression provenanceRegression provenance — suspected predecessor, not a causality claim: source commit Possible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readiness✅ Ready for maintainer review Keep this PR open: it repairs a current-main transcript persistence regression, preserves the earlier deadlock fix, and introduces no actionable defect found in this review. Priority: P1 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherCodex mirroring passes messages and live authority into the Plugin SDK transcript adapter, which resolves storage ownership and delegates guarded persistence to the existing transcript writer. flowchart TD
A[Codex transcript mirror] --> B[SDK mirror adapter]
B --> C[Resolve transcript target]
C --> D[Bind live write assertion]
D --> E[Existing transcript writer]
E --> F[Guarded SQLite commit]
Technical reviewBest possible solution: Land the resolved-target binding repair while retaining pre-reservation preparation and final-commit authority checks. Do we have a high-confidence way to reproduce the issue? Source establishes the mismatch: the caller omits agentId, resolution supplies main, and the existing ownership check compares those fields exactly; the maintainer also reports failing base and passing patched persistence cases. Is this the best way to solve the issue? The repair belongs at the existing target-resolution owner, removes the earlier wrapper, and preserves source preparation before writer reservation without changing storage formats or adding configuration. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 943da4fc9366. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +1, Tests +88. Total +89 across 3 files. Added test files: 1. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
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 (5 earlier review cycles)
Reviewed October 12, 2026, 1:11 AM ET / 05:11 UTC (Revision 6). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
…ranscript target unresolved transcript target, so the locked write compared it against the resolved owner scope and refused the settled-turn summary mirror with SessionTranscriptWriterClaimReboundError (settled-turn-finalizer.native, 4 cases). Move the assertion into withProjectedSessionTranscriptWriteLock, which installs it on the same resolved scope it locks, still before the writer is reserved.
…ked and foreign owners
65e1341 to
d1b45f2
Compare
Repair sweep — 2026-11-25
Rebased the repair onto main
ba6d94ec17712. The mirror assertion is installed after agent inference, before reserving a transcript writer. The original admitted locator and callback are captured synchronously, and the existing transcript owner verifies the resolved target against the original session key, ID, store and storage environment; inferring an omitted agent must not authorize another transcript.Current proof:
(multiple)selectors.d1b45f26bf84ehas no findings.092d3acd6bec3e3a14bdc7e7a2810ab628ab759d, includingcodex-rs/app-server-protocol/src/protocol/v2/thread.rs:530-610; no Codex dependency or protocol change.The SDK negative owner cases and native finalizer success cases are distinct proof; this does not claim a current live-provider/channel run. CI on the pushed head remains the broad gate.
Original proposal and historical evidence
What Problem This Solves
#169343 (43584d9) introduced a regression:
extensions/codex/src/app-server/settled-turn-finalizer.native.test.tsfails 4/9 onmain("persists a host-authorized summary with the actual native selection …"). The settled-turn summary mirror is refused withSessionTranscriptWriterClaimReboundError, so stock Codex settled-turn summaries are not persisted.Why This Change Was Made
#169343 moved the codex mirror's composed write assertion from per-append preparation to a write-level owner assertion, which fixed the Linux steering-settlement deadlock. However, it installed that assertion through
withSessionTranscriptWriteAssertionon the caller's unresolved transcript target. The locked write then compares the installed context against the resolved owner scope (storageTargetfromresolveSessionTranscriptRuntimeTarget). When the two differ,assertTranscriptWriteContextrefuses the commit as a rebound writer claim; here the fields that can differ areagentId,sessionIdand the store binding.Fix: install the assertion inside
withProjectedSessionTranscriptWriteLock, after it resolves the storage target, on exactly theboundScopeit locks. The ordering property from #169343 is preserved: the assertion is still prepared before the writer is reserved.withCodexSessionTranscriptMirrorWritegoes back to a plain pass-through, andassertCurrentis now an optional field ofInternalSessionTranscriptWriteLockParams.Production LOC: +20/-19.
User Impact
Stock Codex settled-turn summaries persist again on current
main. The Linux steering deadlock fix from #169343 remains in place.Evidence
settled-turn-finalizer.native.test.ts:main;pnpm teston this branch passes forsettled-turn-finalizer.native,run-attempt.steering-settlement,transcript-mirror,transcript-mirror.user-idempotency,transcript-mirror.visibilityandrun-attempt.steering.pnpm tsgo:coreis clean.checks-node-changed-extensions-bundle-2, Ubuntu runner, real SQLiteextension-database-workersproject):settled-turn-finalizer.native.test.ts9/9 andrun-attempt.steering-settlement.test.tspass, so the fix(codex): prepare mirror write authority before reserving the transcript writer #169343 deadlock fix still holds on Linux. A Blacksmith Testbox rerun (tbx_01m4ptfke8wabpy1sd4a7c66c6) never got capacity and timed out after 15m inqueued, so CI is the Linux proof.src/plugin-sdk/codex-session-transcript-runtime.write-assertion.test.tsruns against a real SQLite session store. It uses a locator withoutagentId, which is the finalizer shape.assertCurrentstarts throwing after an awaitedreadMessageFacts. The append rejects with the revocation error and no row persists.SessionTranscriptWriterClaimReboundErrorand no row persists.SessionTranscriptWriterClaimReboundError(the regression) and the foreign-owner case still passes. Binding to the resolved target therefore keeps the foreign-owner refusal and the commit-time revocation check.checks-node-changedfailure (test/embedded-transcript-cursor.e2e.test.ts› "resumes a public raw cursor across /new and the next Gateway turn",generation_mismatch) is inherited. It fails the same way locally on the untouched merge basef92690e1without this change. This PR does not touch cursor or/newcode.Current State (2026-10-12)
65e1341735a. ClawSweeper: gold shrimp, no findings, nothing under "Before merge".checks-node-changedselectstest/embedded-transcript-cursor.e2e.test.ts, which fails on current main, and CI fail-fast then cancels the rest of the run.56d559212a0). Its per-turncaptureModelPromptProjectionrewrite rotates the transcript generation, so raw-delta cursors reset (generation_mismatch).scripts/pr. feat(agents): compact ChatGPT sign-in sessions server-side (remote compaction V2) #168401 depends on this landing first.Latest CI repair
CI follow-up: corrected the mutable assertion fixture’s inferred
neverreturn to its intendedvoidcontract. All 9 mirror assertion cases, the exact Plugin SDK test type graph, formatting, and type-aware lint pass. New-head CI pending.