Skip to content

fix(server): continue threads whose background tasks outlived the turn - #45

Open
macodev00 wants to merge 1 commit into
mainfrom
cursor/continue-live-background-tasks-37a8
Open

macodev00 wants to merge 1 commit into
mainfrom
cursor/continue-live-background-tasks-37a8

Conversation

@macodev00

Copy link
Copy Markdown
Owner

What Changed

Restart continuation treats open background tasks the same as an interrupted turn.

markRunningProviderSessionsForContinuation and reconcileProviderSessions now notice unterminated task.* rows (the persisted form of Claude liveTaskIds). 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.

Why

A Claude thread whose turn has already finished can still be running subagents or background shells. The session is ready with no active turn, so a restart neither continued it nor told the user the work was lost.

Fixes pingdotgg#13400

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes
Open in Web Open in Cursor 

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.

Fixes pingdotgg#13400

Grok 4.7 via Cursor cloud agent.
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L labels Sep 25, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Restart continuation skips threads whose turn ended while Claude subagents or background shells were still running

1 participant