tests(agents): mock timeout compaction side effects at runtime seam#65274
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Greptile SummaryThis PR fixes a stale mock boundary in the shared overflow-compaction test harness. After Confidence Score: 5/5Safe to merge — test-only change with no runtime impact. The fix is minimal, correct, and well-scoped: both mocked module paths point to the same pre-existing mock instance, the reset function already covers mockedRunPostCompactionSideEffects, and keeping the legacy ./compact.js mock avoids breaking overflow-compaction coverage. No production code is touched. No files require special attention. Reviews (1): Last reviewed commit: "tests: mock timeout compaction side effe..." | Re-trigger Greptile |
…#65274) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…#65274) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…#65274) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…#65274) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…#65274) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…#65274) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…#65274) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Summary
checks-node-agenticsrc/agents/pi-embedded-runner/run.timeout-triggered-compaction.test.ts->fires compaction hooks during timeout recovery for ownsCompaction engines./compact.jsafterrun.tsswitched to importingrunPostCompactionSideEffectsfrom./compaction-hooks.js./compaction-hooks.jsseam in the shared harness while keeping the existing./compact.jsmock for compatibilityChange Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Root Cause (if applicable)
src/agents/pi-embedded-runner/run.tsstarted importingrunPostCompactionSideEffectsdirectly fromsrc/agents/pi-embedded-runner/compaction-hooks.tsRegression Test Plan (if applicable)
src/agents/pi-embedded-runner/run.timeout-triggered-compaction.test.tsrun.tsimportssrc/agents/pi-embedded-runner/run.overflow-compaction.test.tsexercises the same harness for overflow recoveryUser-visible / Behavior Changes
None.
Diagram (if applicable)
N/A
Security Impact (required)
Yes/No) NoYes/No) NoYes/No) NoYes/No) NoYes/No) NoYes, explain risk + mitigation:Repro + Verification
Environment
Steps
pnpm test src/agents/pi-embedded-runner/run.timeout-triggered-compaction.test.ts src/agents/pi-embedded-runner/run.overflow-compaction.test.tsExpected
runPostCompactionSideEffectsinvoked through the current runtime seam.Actual
Evidence
Attach at least one:
Human Verification (required)
./compaction-hooks.js./compact.jsmock in place so older callers remain covered by the same harnessReview Conversations
Compatibility / Migration
Yes/No) YesYes/No) NoYes/No) NoRisks and Mitigations
run.ts