Conversation
A thread can finish its turn while subagents or background shells are still running. Restart continuation only resumed sessions that were still running with an active turn, so those threads stayed ready and the work disappeared. Startup now treats unterminated task rows like an interrupted turn. When continue-after-restart is on, the continuation prompt names the stopped tasks and stays within the provider send limit. Otherwise those tasks are settled once as stopped and the thread gets the existing restart notice. A retry after those tasks were already settled restores the recorded names from the continuation marker, and an empty open-task list clears any stale marker. Malformed activity payloads are skipped, and plan or dream tasks stay excluded when a later status row omits taskType. Fixes pingdotgg#13400 Co-authored-by: maco <macodev00@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Changed
Restart continuation treats open background tasks the same as an interrupted turn.
markRunningProviderSessionsForContinuationandreconcileProviderSessionsnotice unterminatedtask.*rows (the persisted form of ClaudeliveTaskIds). When "Continue threads after restarts" is on, the thread is continued with a prompt that names the stopped tasks. That prompt, including the fixed text and every label, stays withinPROVIDER_SEND_TURN_MAX_INPUT_CHARS. When continuation is off, or it fails, only the still-open tasks are settled once as stopped and the thread gets the existing restart notice.An empty open-task list writes
continueAfterServerUpdateTasks: null, so a stale recorded list is not reused.A retry from a persisted
startingsession still restores recorded task names whenever the continuation marker is present, including after settlement already wrotetask.completedrows. Promptless providers receive those names instead of{ continuation: true }.listUnterminatedTasksskips activity rows whose payload is not valid JSON, and plan or dream tasks stay excluded when any decisive row has thattaskType.Why
A Claude thread whose turn has already finished can still be running subagents or background shells. The session is
readywith no active turn, so a restart neither continued it nor told the user the work was lost.This redo also closes the review findings from pingdotgg#13621: an oversized task label could make
sendTurnreject the continuation, a stale task marker could settle the same tasks again, and settlement could dispatch a second completion for tasks that were already recorded.Fixes pingdotgg#13400
UI Changes
None.
Checklist