fix(continuation): auto-continue GPT permission-seeking replies

Resume GPT sessions when the last assistant reply ends in a permission-seeking tail, while honoring stop-continuation and avoiding duplicate continuation across todo and atlas flows.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
YeonGyu-Kim
2026-03-11 21:19:29 +09:00
parent 3f364cc8df
commit a1b060841f
22 changed files with 617 additions and 4 deletions
@@ -1706,6 +1706,27 @@ describe("todo-continuation-enforcer", () => {
expect(promptCalls).toHaveLength(0)
})
test("should not inject when shouldSkipContinuation returns true", async () => {
// given - session already handled by another continuation hook
const sessionID = "main-skip-other-continuation"
setMainSession(sessionID)
const hook = createTodoContinuationEnforcer(createMockPluginInput(), {
shouldSkipContinuation: (id) => id === sessionID,
})
// when - session goes idle
await hook.handler({
event: { type: "session.idle", properties: { sessionID } },
})
await fakeTimers.advanceBy(3000)
// then - no countdown toast or continuation injection
expect(toastCalls).toHaveLength(0)
expect(promptCalls).toHaveLength(0)
})
test("should not inject when isContinuationStopped becomes true during countdown", async () => {
// given - session where continuation is not stopped at idle time but stops during countdown
const sessionID = "main-race-condition"