Repository navigation
test(gateway): isolate usage context database fixtures - #208304
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. |
|
Codex review: passed. What this changesThis PR replaces fixed usage-fixture database paths with unique temporary roots that are cleaned up after each test. Review scores
ProductKind: Test only · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR is a useful, focused fixture-isolation repair with no actionable findings; it remains a maintainer-authored draft. Reviewed head: Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherUsage tests pass synthetic session rows and physical database targets into Gateway handlers, which perform real context-history reads before returning usage results. flowchart LR
A[Usage test cases] --> B[Shared fixture]
B --> C[Owned temporary paths]
B --> D[Gateway usage handler]
C --> E[Context history reader]
D --> E
E --> F[Usage assertions]
Technical reviewBest possible solution: Retain this minimal repair using the existing temporary-directory owner and stable per-fixture paths. Do we have a high-confidence way to reproduce the issue? Source traces the fixed fixture paths into real context-history database reads; execution was intentionally excluded by the read-only review. Is this the best way to solve the issue? The patch fixes path ownership at fixture creation, preserves explicit real-database overrides, and keeps repeated cache queries on the same path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 0b7647647bcf. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceTests +9. Total +9 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 readiness starts with the lower of the proof and patch scores. It is capped at 3/6 if the fix is partial, the change offers little benefit, a product decision is still open, or the PR reverses an earlier decision without saying why. ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 29, 2026, 7:57 AM ET / 12:57 UTC. |
|
Closed as draft/NO-GO |
|
Merged via squash.
|
* commit 'c5c1dc278a6f789d739d70afe192c4d1e37058f5': fix(ci): include provider rejection text in PR tooling (#208891) feat: let plugins bring their own sidebar icon (#208885) docs: clarify node pairing and credentials on PostgreSQL gateways (#208850) fix(ui): show a confirmed subagent stop once in chat (#208533) fix(ui): keep collapsed work close to the reply in long chats (#207843) fix(update): finish failed recovery startup records (#208794) chore(ci): inventory media worker lifecycles (#208888) fix: use the same clock icon for Automations (#208539) improve(ci): reduce compiler round trips in database checks (#208878) fix(ci): preserve complete adaptive test observations (#208874) test(gateway): isolate usage context database fixtures (#208304) fix: avoid false worker cleanup failures (#208861) fix: let Git upgrade acceptance fetch its missing baseline (#208746) fix: isolate scheduled Processes reads in the Control UI config-change test (#208205) fix: make plugin hash worker tests independent of runner memory (#208860) fix(update): preserve serving state during candidate plugin maintenance (#208776) test(ui): preserve exact session keys in older chat links (#208873) docs(cli): say what bounds a yielded agent turn's subagent wait without --timeout (#208858)
* fix: restore managed worktrees from bare primary repositories Managed worktrees created from a linked checkout record its primary repository. Resolve that registration during inspection, removal, and snapshot restore while keeping new checkout creation strict. * Merge verified upstream CI repairs into managed worktree recovery * commit 'c5c1dc278a6f789d739d70afe192c4d1e37058f5': (64 commits) fix(ci): include provider rejection text in PR tooling (#208891) feat: let plugins bring their own sidebar icon (#208885) docs: clarify node pairing and credentials on PostgreSQL gateways (#208850) fix(ui): show a confirmed subagent stop once in chat (#208533) fix(ui): keep collapsed work close to the reply in long chats (#207843) fix(update): finish failed recovery startup records (#208794) chore(ci): inventory media worker lifecycles (#208888) fix: use the same clock icon for Automations (#208539) improve(ci): reduce compiler round trips in database checks (#208878) fix(ci): preserve complete adaptive test observations (#208874) test(gateway): isolate usage context database fixtures (#208304) fix: avoid false worker cleanup failures (#208861) fix: let Git upgrade acceptance fetch its missing baseline (#208746) fix: isolate scheduled Processes reads in the Control UI config-change test (#208205) fix: make plugin hash worker tests independent of runner memory (#208860) fix(update): preserve serving state during candidate plugin maintenance (#208776) test(ui): preserve exact session keys in older chat links (#208873) docs(cli): say what bounds a yielded agent turn's subagent wait without --timeout (#208858) test(ui): keep real exports in the channel settings distribution mock (#208855) test(normalization): preserve inline code in quoted previews (#208857) ... Co-authored-by: Vincent Koc <[email protected]>
What Problem This Solves
Usage fixtures supply fixed temporary database paths even though the handler performs real context-history reads. Those reads can reach unrelated local files.
User Impact
No production behavior changes. The same 36 consumer cases exercise real context reads using owned temporary paths; all capacity and usage assertions remain.
Why This Change Was Made
The shared fixture allocates a unique temporary root and registers cleanup. The cache fixture reuses one path across its query closure. Preserve explicit real-database callbacks and the large usage suite unchanged.
Evidence
9389d991.