Skip to content

fix(agents): merge agent runtime changes with upstream refactor #82

Description

@Piboonsak

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

  1. Take upstream versions for all files (their changes are much larger)
  2. Re-apply our small customizations:
  3. 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
  4. Our tool-loop-detection.ts (new file) is safe — no conflict

Acceptance Criteria

  • Reasoning mode default works
  • Storm detection integration works
  • All tool-loop-detection tests pass
  • Tests pass: pnpm test

References

Metadata

Metadata

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions