Skip to content

Adopt refuses an idle-looking session whose registry status is "shell" #609

Open

Description

@barelyworkingcode

Problem

A user clicks Adopt on an outside Claude session that the sidebar lists as Idle. Relay answers "Can't adopt: the session is not idle (registry_busy)". The session has no turn running. It has a background shell running. Interrupt and Adopt works.

Root cause

Claude's session registry reports status: "shell" while a background command runs between turns. Check in internal/sessions/adopt/adopt_claude.go accepts only idle (case reg.Status != "idle" gives VetoRegistryBusy). The sidebar row derives "Idle" from a different reading, so the row and the check disagree.

Evidence: a 2s log of the registry entry showed busy (turn), then shell for about 43s with no turn running, then busy. An Adopt click during the shell stretch failed with registry_busy.

Fix

  • Treat shell like idle in the registry test. Adoption stops the process and its shells anyway. The other vetoes (stale status, open tool call, working child) stay.
  • Or hide Adopt for a shell session. The row and the check must read one status.
  • Name the veto in the toast: "a background command is running", not "not idle".

Acceptance criteria

  • Adopt succeeds on a session whose registry status is shell and has no open turn.
  • The sidebar row and the adopt check give the same verdict for every registry status.
  • The toast names the actual veto.

What I'd notice

Adopt works on a session that is only waiting on background commands.

Activity

  1. barelyworkingcode commented on Nov 7, 2026

    @barelyworkingcode
    OwnerAuthor

    Parked: fix is in PR #618 (shell counts as idle; refusal names the veto; two e2e tests red on main, green on the branch; reviewer found no blocking issues). Not merged: no clean full e2e run on this Mac (load flakes; baseline TestAdoptReasonsOnRows and TestAdoptNoProjectPiCodexKeepReason red on main), and the owner barred host test runs after the 08:03 session loss. Needs a container run for the Verified line, plus a contract section on this issue.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions