Skip to content

fix(smithy): clearer error from sf agent start (mirror of upstream #100) - #2

Open
komoreka wants to merge 2 commits into
masterfrom
fix/agent-start-clarity
Open

komoreka wants to merge 2 commits into
masterfrom
fix/agent-start-clarity

Conversation

@komoreka

@komoreka komoreka commented May 5, 2026

Copy link
Copy Markdown
Owner

Fork-side mirror of upstream PR stoneforge-ai#100 (closes stoneforge-ai#61).

This PR exists for self-review and live server testing; the canonical review happens on the upstream PR. Will be closed when upstream stoneforge-ai#100 merges.

Summary

sf agent start <id> for a worker defaults to headless mode, which feeds prompts via stdin. Without --prompt or --resume the spawned process has no input, exits immediately, and the user sees Failed to start agent: Session exited before init.

agentStartHandler now refuses headless invocations with no input source up front and prints the cause plus the three fixes (--prompt, --resume, --mode interactive).

Smoke test (verified on this branch live via the local sf wrapper)

  • sf agent start <worker-id> → Cannot start a headless worker without an initial prompt. exit 4
  • sf agent start <steward-id> → same, role correctly named "steward"
  • sf agent start <worker-id> --mode interactive → bypasses validation, spawn proceeds

komoreka added 2 commits May 5, 2026 13:15
Headless workers/stewards spawned without --prompt or --resume have no
input source and exit immediately, producing the cryptic 'Session
exited before init' error. Refuse the invocation with a clear message
that names the cause and lists the three fixes (--prompt, --resume,
--mode interactive).

Refs stoneforge-ai#61.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: sf agent start fails with 'Session exited before init' on expired ephemeral sessions

1 participant