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. Otherwise those tasks are settled 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. Malformed activity payloads are skipped, and plan or dream tasks stay excluded when a later status row omits taskType. Fixes pingdotgg#13400 Grok 4.7 via Cursor cloud agent. 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.
markRunningProviderSessionsForContinuationandreconcileProviderSessionsnow notice 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. When it is off, or continuation fails, those tasks are settled as stopped and the thread gets the existing restart notice.This also covers the three restart-recovery cases that blocked the previous attempt:
startingsession restores recorded task names whenever the continuation marker is present, including aftersettleStoppedTaskshas already writtentask.completedrows. Promptless providers still receive the named tasks instead of{ continuation: true }.listUnterminatedTasksskips activity rows whosepayload_jsonis not valid JSON, so one malformed payload cannot abort continuation for every thread.taskTypeplanordream, even if a later status update omitstaskType.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.Fixes pingdotgg#13400
UI Changes
None.
Checklist