GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Subagent AI_APICallError is silently swallowed, causing session to hang · Issue #13395 · anomalyco/opencode

Subagent AI_APICallError is silently swallowed, causing session to hang #13395

New issue
Copy link
New issue
Copy link
Closed
Closed
Subagent AI_APICallError is silently swallowed, causing session to hang#13395
Copy link
Assignees
rekram1-node

Description

@unthingable
unthingable
opened on Feb 13, 2026
Issue body actions

Description

When a subagent encounters an AI_APICallError (e.g., due to an invalid model ID), the error is logged at ERROR level but never surfaced to the user or returned to the parent agent as a tool result. The subagent session silently dies, and the parent session appears stuck/loading indefinitely.

By contrast, when a primary agent hits the same error, it is surfaced clearly in the TUI:

Error: model: claude-sonnet-4-5-latest

Steps to reproduce

  1. Configure a custom model alias with an invalid model ID in opencode.jsonc:
"provider": {
  "anthropic": {
    "models": {
      "sonnet": { "id": "claude-sonnet-4-5-INVALID" }
    }
  }
}
  1. Define any subagent that uses this model (JSON or markdown):
"agent": {
  "my-agent": {
    "description": "Test agent",
    "mode": "subagent",
    "model": "anthropic/sonnet"
  }
}
  1. In a session, have the primary agent invoke the subagent via the task tool.

  2. The subagent's LLM call fails with AI_APICallError. The error appears in --print-logs output:

ERROR service=session.processor error=model: claude-sonnet-4-5-INVALID stack="AI_APICallError: model: claude-sonnet-4-5-INVALID\n    at <anonymous> (../../node_modules/.bun/@[email protected]+.../dist/index.mjs:936:18)..."
  1. But the parent session never receives the error — it just hangs waiting for the subagent.

Expected behavior

  • The error should be returned to the parent agent as a failed tool result, so it can report the issue or attempt recovery.
  • The TUI should surface the subagent error to the user (e.g., in the subagent panel or as a notification).

Actual behavior

  • The AI_APICallError is logged but swallowed.
  • The subagent session silently dies.
  • The parent session hangs indefinitely waiting for a response that will never come.
  • The user has no indication of what went wrong without checking --print-logs or log files.

Related issues

  • Tasks/Subagents with Codex / OpenAI are frequently getting stuck with no timeout/retry, which then hangs the session forever #11865 — subagents getting stuck with no timeout/retry (different provider, similar symptom)
  • TUI: Parent session appears stuck "loading" when subagent is blocked (waiting user input / hanging tool call); lack of visibility and recovery UX #10802 — parent session appears stuck when subagent is blocked (TUI visibility)

OpenCode version

1.1.53

Operating System

macOS (Darwin 24.6.0)

Activity

  1. github-actions
    assigned
    rekram1-node
    on Feb 13, 2026
  2. yinghaosang
    added a commit that references this issue on Feb 13, 2026

    fix(opencode): propagate subagent errors to parent session

    This issue will close once commit 125e0a0 is merged into the 'dev' branch.
    125e0a0
  3. github-actions commented on Apr 14, 2026

    @github-actions
    github-actionsBot
    on Apr 14, 2026 – with GitHub Actions
    Contributor
    More actions

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

  4. github-actions
    closed this as completedon Apr 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @rekram1-node
    rekram1-node

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

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.