fix(compaction): resolve retry before goal continuation return

Active-goal threshold compaction can pre-empt the normal post-turn tail
and return once it schedules a deferred handoff or auto-continue. When
that turn is the successful response from an auto-retry, returning there
skips the later retry-gate cleanup and leaves isRetrying stuck.

Resolve the completed retry gate before the compaction-continuation
return, and cover the retry-success-over-threshold path so future
changes cannot strand prompt()/waitForIdle() behind a stale retry state.

Refs #3174
This commit is contained in:
roboomp
2026-06-21 09:08:59 +00:00
parent e70c71077e
commit eef2f7b7e9
3 changed files with 102 additions and 1 deletions
@@ -2855,6 +2855,7 @@ export class AgentSession {
deferredHandoff: compactionResult.deferredHandoff,
continuationScheduled: compactionResult.continuationScheduled,
});
this.#resolveRetry();
await emitAgentEndNotification();
return;
}