Repository navigation
Description
Summary
agentctl launch <adapter> --spec <path> produces silent failures across multiple adapters (claude-code and opencode confirmed). The launch reports exit code 0, no error is surfaced, no completion text is written, and no work happens — but the spec file content was never effectively consumed by the model.
The pattern manifests in two shapes:
- Silent
invalid_requestfailures — adapter rejects the prompt format internally; no surfaced error. - Short-circuit after 2-3 tool calls — model runs a couple of recon tool calls (e.g.
git rev-parse, reading the spec it was just told about, etc.) then exits cleanly without doing the work.
Both shapes have the same operator-side effect: the launch wrapper exits 0; the wrapper-script .exit file shows 0; agentctl's status shows stopped; nothing is committed.
Reproduction
Minimal repro shape:
agentctl launch claude-code --spec /path/to/spec.md -p "Implement the spec at <path>"
agentctl launch opencode --spec /path/to/spec.md -p "Implement the spec at <path>"
Reliably observed across multiple distinct workspaces and prompts. Same content inlined into the -p prompt directly (no --spec flag) often executes correctly. The difference is the --spec injection.
The wrapper script that agentctl writes can be inspected at the per-session JSON metadata directory; the --spec injection appears as a --- File: <relative-path> prefix in the prompt that's actually passed to the model. A working invocation (no --spec, content inlined) does not contain that prefix.
Hypothesis
Models likely interpret the --- File: <path> prefix as either:
- "file content is being attached, no further action expected from you" → produces an empty / minimal completion, OR
- A malformed conversation turn that the adapter rejects with an internal
invalid_requestand surfaces as a clean exit upstream.
Both shapes are silent at the operator boundary.
Impact
- Operators waste 5-15 min per failed launch before noticing nothing happened (no error to react to).
- Recurring across several workspace types — not isolated to one adapter, model, or prompt shape. The common factor is
--spec. - Compounded by
agentctl peekreturning "Session not found" for in-flight or just-completed sessions (issue agentctl peek returns 'Session not found' for sessions that status and list -a both show as running #173) — operators have to inspect raw filesystem files to confirm the no-op.
Asks
- Acknowledge the failure mode in the README /
agentctl launch --helpfor--spec. - Document the workaround: inline the spec content into the
-pprompt instead of using--spec. (For very large specs, suggest reading the file from inside the prompt: e.g.-p "Read the spec at <path> and implement it."This avoids the prefix-injection but still lets the agent see the file.) - Surface the silent failure as a real error: the wrapper should detect a near-zero-work exit and either retry without
--specor surface a "spec injection may be the cause" hint to the operator. - Long-term: change the spec-injection format to one that models reliably treat as "spec to implement" rather than "attached artifact":
- A clearer prefix like
<<<SPEC>>>/<<<END_SPEC>>>block markers, OR - Inject as a system message rather than a prepended user prompt, OR
- Re-shape the injected text to start with an imperative sentence ("Implement the following spec:") that anchors the model's intent before showing the content.
- A clearer prefix like
Severity
Medium-high. The bug is silent and recurring; failures cost operator time and trust in the tool. Workaround exists (inline the prompt), but operators learn this pattern only after hitting it — defaults should be safe.
Activity