Repository navigation
fix: Open Claude on an ended session resumes it instead of attaching to it - #879
Merged
Merged
Conversation
added 2 commits
December 1, 2026 13:13
Claude Code goes on listing a background session whose process has ended, with no pid. Deskbar's resume roads only asked whether a session was listed, so such a row counted as running. Comments and wakes for it were refused as "running or being resumed already" and parked in an inbox nobody read (eight hours on 2026-12-01). Open Claude attached a window straight to the row, and `claude attach` then woke the session by itself while Deskbar was taking a comment to it and compacting it first. The window printed "Couldn't wake ... this session is running in another terminal". Running now means listed with a process (ClaudeAgents.Runs). A click on such a row resumes it through ClaudeSessions.ResumeNow, and the window opens on the running session that comes back. A click during another wake, compaction included, waits for that wake instead of giving up after ten seconds. *opus5.5*
…no process Review of the first commit found more places that took "listed" for "running": the manager's Next and Gone, the start and resume search (Found), CompactSession, the reopen after a stop, and CanOpen. Each now asks for a row with a process. The keeper's queue keeps counting any listed session on purpose, so it does not wake every task session that ended this way; the comment says so. *opus5.5*
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.
Deskbar task 7e59e27c
Clicking the Terminal button on a task whose Claude session had ended opened a window that printed "Couldn't wake 06834d9d, Can't open, this session is running in another terminal" and exited.
Why
Claude Code goes on listing an ended background session in
claude agents --json, with nopid. Deskbar's resume code only asked whether the session was listed, so that row counted as running:claude attachthen woke the session itself while Deskbar's own wake was compacting it, and the two collided.There was a second cause too. A message wake of a big cold session compacts first, which takes about 35 seconds, but the click's search for the session gave up after about 10.
What changed
ClaudeAgents.Runs(listed, id)asks whether the session is listed with a process. The resume, wake, compact, open and reopen roads inClaudeSessions,ClaudeTaskActionsandManagerActions, andManagerSession.Next, use it orHasProcessin place of "is it listed?".Tests: Release
-warnaserrorbuild is clean.Deskbar.Core.Testspasses 6051/6051, and the touched Windows test classes pass 231/231 on a hidden desktop. The full hidden-desktop run stopped with an out-of-memory crash in the test host after 2133 passes and no failures, so CI has the full suite.Release notes
opus5.5