Repository navigation
Commit b53ba50
committed
fix(session): cap auto-compaction continue at one turn (anomalyco#15533)
Port of upstream PR anomalyco#15532 adapted for the pwrcode
fork's plugin-trigger structure.
Without this, claude-via-copilot sessions enter an infinite loop:
agent ends turn (finish='stop')
-> context overflow
-> auto-compaction
-> synthetic 'Continue if you have next steps' injected
-> agent generates same summary block
-> overflow
-> repeat
The synthetic continue is now only injected when both hold:
1. The last non-summary assistant was mid-tool-use
(finish in 'tool-calls' / 'unknown' / unset).
2. We haven't already injected a synthetic continue since the user's
last real text message — caps the loop at exactly one continuation
per real user turn.
Hit reproducibly with github-copilot/claude-opus-4.7 + oh-my-opencode-slim
orchestrator, where the orchestrator's templated Goal/Done/Next-Steps
output reads as an active task to the post-compaction continue prompt.1 parent 168f2bb commit b53ba50
1 file changed
Lines changed: 35 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
506 | 506 | | |
507 | 507 | | |
508 | 508 | | |
509 | | - | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
510 | 543 | | |
511 | 544 | | |
512 | 545 | | |
| |||
557 | 590 | | |
558 | 591 | | |
559 | 592 | | |
| 593 | + | |
560 | 594 | | |
561 | 595 | | |
562 | 596 | | |
| |||
0 commit comments