Context
Upstream heavily refactored several agent runtime files that we also modified in Sprints 3.5-3.7. Our changes are small (3-80 lines each) but upstream changes are massive (200-1200 lines each).
Conflict Files
| File |
Ours |
Upstream |
Our Feature |
src/agents/model-selection.ts |
6 lines |
598 lines |
Reasoning mode default (3-line change) |
src/agents/pi-tools.before-tool-call.ts |
2 lines |
252 lines |
Storm detection import |
src/agents/pi-tools.before-tool-call.test.ts |
80 lines |
308 (deleted) |
Storm detection tests — upstream restructured |
src/agents/tool-loop-detection.test.ts |
214 lines |
198 lines |
Both rewrote tests |
src/agents/pi-embedded-runner/compact.ts |
18 lines |
1159 lines |
Minor changes |
src/agents/pi-embedded-runner/history.ts |
63 lines |
26 lines |
Our additions larger |
src/agents/pi-embedded-helpers/errors.ts |
1 line |
1128 lines |
Trivial change |
What To Do
- Take upstream versions for all files (their changes are much larger)
- Re-apply our small customizations:
- For deleted test file (
pi-tools.before-tool-call.test.ts): check if upstream moved tests elsewhere, then re-apply our storm detection tests there
- Our
tool-loop-detection.ts (new file) is safe — no conflict
Acceptance Criteria
References
Context
Upstream heavily refactored several agent runtime files that we also modified in Sprints 3.5-3.7. Our changes are small (3-80 lines each) but upstream changes are massive (200-1200 lines each).
Conflict Files
src/agents/model-selection.tssrc/agents/pi-tools.before-tool-call.tssrc/agents/pi-tools.before-tool-call.test.tssrc/agents/tool-loop-detection.test.tssrc/agents/pi-embedded-runner/compact.tssrc/agents/pi-embedded-runner/history.tssrc/agents/pi-embedded-helpers/errors.tsWhat To Do
model-selection.ts: Set reasoning mode as default (3 lines — PR feat(agent): enable reasoning mode as default #78)pi-tools.before-tool-call.ts: Add storm detection import (2 lines — PR feat(agents): rapid-succession storm detector + callTrace to prevent nested-agent tool storms #56)tool-loop-detection.test.ts: Merge both test suiteshistory.ts: Merge our additions with upstream changespi-tools.before-tool-call.test.ts): check if upstream moved tests elsewhere, then re-apply our storm detection tests theretool-loop-detection.ts(new file) is safe — no conflictAcceptance Criteria
pnpm testReferences
9f2b254