Skip to content

Claude task occasionally loses its agent and falls back to a plain shell #63

Description

@MasonRhodesDev

Intermittent: a task that was running Claude Code (or another agent) drops back to a plain shell. Not sure yet whether it's Claude-specific.

Tab-title hint from the screenshot: the active tab shows the worktree path (~/.a/w/a/fresh-slammer-echoes-wt) rather than "Claude Code" or "Terminal". That's consistent with the running program being a plain shell whose PROMPT_COMMAND emits \e]0;<cwd>\a (OSC 0/2), which flows into apply_terminal_title_update on the tab (desktop/src/app.rs:~372-376). TerminalLaunchConfig::default_title (core/src/agents.rs:199) would return "Claude Code" for a provider-backed tab or "Terminal" for a plain one — neither of those is what's rendered, so the OSC-title path is what's setting it, and the underlying process is a shell.

Which means tab.launch_config.provider ended up None for a tab that started as a provider tab. Places worth auditing that mutate tab.launch_config:

  • desktop/src/app.rs:4204 / :4210 / :4347 — Launched replies (main + warm).
  • desktop/src/app.rs:3923 — maybe_retry_claude_restore clears only session, should not strip provider, but worth confirming nothing downstream does.
  • desktop/src/app.rs:4504 / :4572 — warm-terminal attach / session discovery paths.
  • desktop/src/app.rs:8716 — with_session backfill.
  • The prewarmed-terminal attach_prewarmed_launch_to_tab path: if a provider=None prewarm is attached to a slot intended for an agent tab, the provider flips off.

Repro TBD — appears to be rare. Adding instrumentation (log a warning any time a tab's provider transitions from Some → None) would help catch the regression point.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions