Skip to content

Bug: claude-code launch can return non-canonical session ID and hide login failure #134

Description

@c-h-

What happened

On DGX Spark, agentctl launch claude-code returned one session ID, but agentctl list -a recorded a different ID. The returned ID could not be peeked, and the actual recorded ID only revealed the real failure (Not logged in · Please run /login).

Concrete example from 2026-03-10 on Ubuntu 24.04 ARM64:

  • Launch command returned: Launched session 1c392a09
  • agentctl list -a later showed: 6e2f81ce
  • agentctl status 1c392a09 initially showed running, then stopped
  • agentctl peek 1c392a09 -n 80 => Session not found: 1c392a09
  • agentctl peek 6e2f81ce -n 200 => Not logged in · Please run /login
  • The task produced no output file (SMOKE.md missing)

So there are two user-facing problems:

  1. launch returns a non-canonical / non-peekable session id
  2. the actual Claude login-state failure is hidden unless you discover the second id via list -a

What was expected

  • agentctl launch should return the canonical session ID that status, peek, and list -a all agree on
  • If Claude Code is not logged in, launch should fail immediately with a clear, direct error
  • Failed launches should not look like successful launches with a ghost session ID

How to reproduce

Environment:

  • Host: DGX Spark
  • OS: Ubuntu 24.04 ARM64
  • agentctl 1.7.0
  • claude 2.1.72
  • claude --print --permission-mode bypassPermissions "Reply with exactly OK" works when ANTHROPIC_API_KEY is exported from ~/.openclaw/.env
  • ~/.claude.json is absent (no interactive Claude login state)

Commands:

export FNM_PATH="$HOME/.local/share/fnm"
export PATH="$FNM_PATH:$PATH:$HOME/bin"
eval "$(fnm env)"
mkdir -p /tmp/burke-agentctl-smoke
agentctl launch claude-code --cwd /tmp/burke-agentctl-smoke -p "Create a file named SMOKE.md containing exactly: agentctl smoke ok. Then reply with a one-line summary and stop. Do not use git."
agentctl status <returned-id>
agentctl list -a
agentctl peek <returned-id> -n 80
agentctl peek <id-from-list> -n 200

Workaround

Manual workaround is:

  • run agentctl list -a
  • ignore the session ID returned by launch if it differs
  • inspect the ID from list -a
  • for this specific failure, Claude Code needs interactive /login state even though direct claude --print works with API key env

Why this matters

This makes automated smoke tests and supervisor flows flaky because launch looks successful, but the canonical handle is wrong and the real adapter failure is obscured.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    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