Skip to content

OpenCode exits with code 0 on ProviderModelNotFoundError #152

@c-h-

Description

@c-h-

Bug

When OpenCode can't find the specified model (e.g., wrong model ID via Ohm), it throws ProviderModelNotFoundError but exits with code 0. This makes agentctl think the session completed successfully.

Repro

opencode run --model ohm/minimax/MiniMax-M2.5 -- 'test'
# Throws ProviderModelNotFoundError internally
echo $?  # 0

Impact

  • agentctl records the session as stopped (success) instead of failed
  • No error surfaces to the daemon or webhook pipeline
  • The error is only visible in the launch log file, not in any API output
  • In a matrix launch, one agent silently fails while the other succeeds, with no indication which

Expected

Non-zero exit code (e.g., 1) when OpenCode fails due to model resolution errors. This would let agentctl distinguish success from failure and surface the error.

Note

This may be an upstream OpenCode issue rather than agentctl, but agentctl should ideally also check for 1-second exits as suspicious regardless.

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