Repository navigation
fix(state): join retained creators during agent preparation - #201272
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. What this changesThis PR acquires writer admission before borrowing a retained creation witness for standalone agent database preparation. Example: Agent main is prepared while another caller retains its original missing-database witness.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this focused, maintainer-authored repair open: current main retains the failing capture order, and source review found no actionable patch defect. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherGateway startup and session-store preparation call the standalone helper, which acquires database writer admission and asks the existing execution owner to initialize the native store. flowchart TD
A[Gateway or session preparation] --> B[Database writer admission]
B --> C[Existing execution owner]
C --> D[Retained creation witness]
C --> E[Native database worker]
E --> F[Initialized agent database]
Technical reviewBest possible solution: Keep the existing creation guard and reuse inherited creation identity only within the standalone helper's admitted writer turn. Do we have a high-confidence way to reproduce the issue? The retained-creator input reaches the existing guard deterministically in source, and the PR supplies a red regression revision; no target code was executed during this read-only review. Is this the best way to solve the issue? The patch is the smallest complete repair using existing owners: capture with inherited creation identity after writer admission, preserve authority checks, and release after settlement. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 0aafe6691b81. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +6, Tests +93. Total +99 across 2 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes: No label 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 (1 earlier review cycle)
Reviewed November 18, 2026, 10:47 AM ET / 15:47 UTC (Revision 2). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via squash auto-merge.
|
…#201272) * test(state): reproduce preparation with a retained creation witness * test(state): bound creation witness regression to native read * fix(state): join retained creators during agent preparation * test(state): observe native preparation admission * test(state): pass cancellation test context with for * chore: keep preparation release notes in PR body
Retire completed absent native reads without dropping retained logical borrowers or pending-opener protection. Companion audit: #201272 is selected next; no other later same-path or PR-reference fix exists in the pinned scan. Existing callers and fixture contracts remain unchanged. Release adaptation: none in the reviewed patch. Parent regression reproduces the retained-reader failure; the complete two-fix cohort passes 69 tests across creation and writer admission. Broader release qualification remains pending. (cherry picked from commit e25ad96) Co-authored-by: VACInc <[email protected]> Co-authored-by: RomneyDa <[email protected]>
Capture the inherited creation witness inside the admitted writer turn, check caller authority before and after capture, and release only the captured reference. Preserve queued cancellation and next-creator behavior. Companion audit: follows #201103; no later same-path or PR-reference fix exists in the pinned scan. Existing startup and session-writer callers retain their current interfaces. Release adaptation: none in the reviewed patch. Parent regression reproduces the retained-witness failure; both fixes pass 69 tests across creation and writer admission, with touched production and test type-aware lint and formatting green. Broader release qualification remains pending. (cherry picked from commit 24c2e74) Co-authored-by: RomneyDa <[email protected]>
…#201272) * test(state): reproduce preparation with a retained creation witness * test(state): bound creation witness regression to native read * fix(state): join retained creators during agent preparation * test(state): observe native preparation admission * test(state): pass cancellation test context with for * chore: keep preparation release notes in PR body (cherry picked from commit 24c2e74) Release adaptation: Use stable boolean creation inheritance through async capture inside admitted writer; preserve default capture constraints and caller cancellation/revocation checks. Native proof blocked by existing shared setup. Co-authored-by: RomneyDa <[email protected]>
Baseline adaptation: Borrow the retained creator only inside the shipped writer-admission turn, using its synchronous execution capture and existing native admission guard. (cherry picked from commit 24c2e74) Co-authored-by: RomneyDa <[email protected]>
What this fixes
Standalone agent database preparation could fail with
Originally observed agent target requires its captured creating referencewhen another first-open caller retained the creation witness. The helper captured an ordinary borrower before acquiring writer admission.Preparation now follows the existing worker-store owner: acquire writer admission, capture the inherited creation identity inside that admitted operation, recheck caller authority, initialize the store, and release the captured execution after settlement. Ordinary-borrower and physical-identity guards remain intact.
Validation
2f0ac519ecfe89d507b34ae7633f2f5d9624e369: CI passed, with all 70 jobs successful or intentionally skipped. A single failed-jobs retry cleared seven Git package mirror HTTP 503 setup failures; passed jobs were retained.Scope and compatibility
Production: +11/-5 lines. Tests: +94/-1 lines. Only the preparation owner and its regression suite change; capture moves into the canonical writer flow without another abstraction or fallback.
No SQLite schema/version, DDL, migration, persisted-format, retention, durability, config, or public API changes. Release-note context stays here because changelog entries are release-owned.
The native-owner regression establishes the retained-creator failure and subsequent successful read. The CLI/Gateway tests qualify the production entry points, but the exact competing creator in the earlier onboarding incident remains unestablished; this is not a traced end-to-end reproduction of that race.