Skip to content

agentctl --spec produces silent failures across adapters (claude-code + opencode confirmed): launch exits 0 with no work done #176

Open

Description

@doink-kindo

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:

  1. Silent invalid_request failures — adapter rejects the prompt format internally; no surfaced error.
  2. 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_request and surfaces as a clean exit upstream.

Both shapes are silent at the operator boundary.

Impact

Asks

  1. Acknowledge the failure mode in the README / agentctl launch --help for --spec.
  2. Document the workaround: inline the spec content into the -p prompt 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.)
  3. Surface the silent failure as a real error: the wrapper should detect a near-zero-work exit and either retry without --spec or surface a "spec injection may be the cause" hint to the operator.
  4. 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.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions