Repository navigation
fix(test): compaction lifecycle tests race awaited persistence - #163883
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. Reviewed October 2, 2026, 8:12 PM ET / October 3, 2026, 00:12 UTC. ClawSweeper reviewWhat this changesThe PR lets ordinary compaction lifecycle tests use the production timeout and advances intentional deadlines only after explicit persistence checkpoints. Merge readiness✅ Ready for maintainer review This remains a useful, focused test repair: current main retains the one-second fixture deadline, and the patch preserves cancellation and persistence assertions. No actionable introduced defect was found. Priority: P2 Review scores
Verification
How this fits togetherCompaction recovery reduces an agent session’s context after overflow or timeout. These tests exercise recovery, admitted writer authority, durable transcript changes, and subsequent retry decisions. flowchart TD
A[Overflow or timeout] --> B[Compaction recovery]
B --> C[Safety deadline]
B --> D[Admitted transcript writer]
C --> E[Cancellation]
D --> F[Durable transcript]
E --> D
F --> G[Accounting and retry]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +76. Total +76 across 2 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep lifecycle assertions tied to explicit backend checkpoints while retaining the production cancellation and durable-write guards. Do we have a high-confidence way to reproduce the issue? Yes, source establishes that the current fixture races awaited persistence against a universal one-second compaction deadline; the author also reports four baseline failures. This review did not execute that reproduction. Is this the best way to solve the issue? Yes, checkpoint-controlled deadline tests isolate the intended ordering while ordinary cases retain real persistence and the production timeout window. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 5d08c652bc5a. 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
Fixes release-validation failures when real compaction persistence takes longer than the test fixture’s universal one-second deadline.
User Impact
No user-visible runtime change. Compaction lifecycle tests exercise their intended cancellation, writer-authority, accounting, and recovery stages independently of disk or worker startup speed.
Why This Change Was Made
Ordinary lifecycle proofs use the production timeout window. Intentional timeout cases freeze only timeout scheduling, wait for an explicit backend checkpoint, then advance the real safety wrapper’s clock. A pre-commit control holds a real opened writer and proves that expiration rejects its eventual append; the existing post-commit case waits for durable persistence and accounting before expiration. No retries, sleeps, production timeout changes, or weakened writer guards.
Evidence
node scripts/run-vitest.mjs src/agents/embedded-agent-runner/run.compaction-runtime.test.ts src/agents/embedded-agent-runner.compaction-safety-timeout.test.ts --maxWorkers=1(unique filesystem cache). 123.38s combined wall time; lifecycle Vitest duration 107.45s; sibling 3.05s.4be67652d1f65e1f57c02f1655a0b9f21b8314ab: CI run 37080756374 succeeded, including all core test-type lanes and lint. Hosted changed-tests job 111080754794 passed the lifecycle suite 26/26 (38.53s Vitest; 61.85s wrapper wall).