Skip to content

agent start can reject a newly created pane as busy before its shell becomes available #2773

Description

@boadij

Is this a reproducible bug?

  • I confirm this is a reproducible bug, not a feature request, idea, question, contribution proposal, or direction check.
  • I reproduced this bug on the version and environment reported below using the exact steps provided.

Current behavior

A pane returned successfully by workspace create --no-focus can be rejected by an immediate agent start:

agent_pane_busy:
agent target pane w1R:p1 is not an available shell

I reproduced this in two disposable workspaces. One used an immediate start; the other ran tab list, pane list, and pane process-info before starting. The same sequence can also succeed, so the behavior is timing-sensitive.

Expected behavior

A newly created pane returned by Herdr should be usable with agent start. agent start should wait within its supplied timeout for the pane's interactive shell to become available instead of immediately returning agent_pane_busy.

Reproduction

Run each attempt with a unique workspace label and agent name:

created="$(herdr workspace create \
  --cwd /tmp \
  --label agent-start-readiness-repro \
  --env HERDR_ENV=1 \
  --no-focus)"

workspace="$(printf '%s' "$created" | jq -r '.result.workspace.workspace_id')"
pane="$(printf '%s' "$created" | jq -r '.result.root_pane.pane_id')"
trap 'herdr workspace close "$workspace" >/dev/null' EXIT

herdr tab list --workspace "$workspace"
herdr pane list --workspace "$workspace"
herdr pane process-info --pane "$pane"

herdr agent start readinessrepro \
  --kind pi \
  --pane "$pane" \
  --timeout 30000 \
  -- \
  --no-context-files \
  --no-skills \
  --no-extensions

Observed on affected attempts:

agent_pane_busy:
agent target pane <pane-id> is not an available shell

Impact

Background automation cannot reliably compose pane creation with native agent startup. Startup becomes timing-dependent and callers must otherwise guess when the returned pane is ready.

Environment

  • Herdr version: 0.8.0 (protocol 19; client/server compatible; restart not needed)
  • Update channel (stable or preview): stable
  • Operating system: macOS 26.5 (25F71), arm64
  • Terminal: Ghostty 1.3.1
  • Shell, if relevant: zsh
  • Relevant config, if any: disposable background workspace created with --no-focus

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingmaintainer-neededrequires maintainer judgment or maintainer-only reproductionpending-release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions