{"version":"2.1.299","anchor":"remote-resume-can-recover-cut-off-foreground-agents","canonical_anchor":"remote-resume-can-recover-cut-off-foreground-agents","heading":"Remote sessions recover interrupted turns more reliably","tier":"notice","area":"Subagents","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.299\/e\/remote-resume-can-recover-cut-off-foreground-agents","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.299","markdown":"### Remote sessions recover interrupted turns more reliably\n\nResumed remote sessions recover cut-off foreground agents, a Stop on a waiting permission is confirmed stored before the turn ends, and cancellations are complete\n\n**Unclear.** It is not known whether `CLAUDE_CODE_RESUME_INTERRUPTED_TURN` is set by default in remote sessions.\n\n**What**\n\nA turn is one round of Claude working on your request. These changes cover what happens when a turn is interrupted, mostly in remote sessions that are picked up again by another worker.\n\n- When a remote session resumes and the turn was interrupted at a prompt with no pending action, the worker reads `running_foreground_agents` from the saved state. Foreground agents are helper agents (subagents) Claude was waiting on. The worker works out which of those calls were cut off, adds a note about them to the conversation, and then clears the list. Notices about orphaned background tasks now list these agents too. Before, only `running_background_tasks` and orphaned and finished background tasks were restored.\n\n- When you stop a turn that is waiting on a permission prompt, the client is not told the turn is over until the records of the Stop are confirmed stored. If they are not, a warning is logged and the next worker may run the turn again. Before, the turn ended for the client whenever the lane had `parkedStopRetires`. Permission answers left without a turn can now carry a note.\n\n- The `cancelled` list in an interrupt result now also includes messages whose re-sent copies were set aside for a re-run of the interrupted turn. Each one is marked cancelled. Before, it listed only queued main-thread commands.\n\n**Why**\n\nRemote sessions that restart in the middle of a turn are less likely to lose track of subagents or of a Stop. Programs built on the SDK get the full list of what an interrupt cancelled.\n\n- Area: Subagents\n- Tier: You'll notice\n- Useful: 2\/5\n- Signal: 2\/5\n- Scope: individual\n- Heads-up: no"}