anomalyco / anomalyco/opencode
subagent: background subagents hang silently on repeated upstream 429s; no error or completion notification surfaces
Open
@nexxeln is already working on this.
Since Aug 25, 2026.
2.0
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Summary
A subagent tool call launched with background: true never reports anything when its child-session model requests start failing (repeated upstream HTTP 429 from a rate-limited provider subscription). The parent session keeps running normally, the promised automatic "finished" notification never arrives, and the TUI shows nothing wrong. The only way to discover the state is to interrupt the whole session, after which the subagent finally surfaces as cancelled. Meanwhile retries keep burning the already-exhausted quota.
Environment
- opencode version: 0.0.0-next-17403
- OS: Linux 6.18.33.2-microsoft-standard-WSL2 (Ubuntu 24.04, WSL2), x86_64
- Terminal: VS Code integrated terminal (
TERM_PROGRAM=vscode,TERM=xterm-256color,COLORTERM=truecolor) - Shell: /bin/bash
- Install/channel: next (mise-managed npm install)
- Active plugins: one project plugin path configured at reproduction time (
~/.local-external directory that had been deleted); it fails to load withCannot find module ...in the server log and is unrelated to this report. No other plugins.
Reproduction
- Use a model provider routed through a free/rate-limited subscription so parallel or sustained requests trigger upstream HTTP 429 responses.
- In a normal session, ask the primary agent to explore something read-only via the
subagenttool withbackground: true(agent typeexplore). - The child session's model calls hit repeated 429s.
- Keep working in the parent and ask it what the subagent is doing — it cannot answer; no status, error, or completion event is ever delivered to the parent or shown in the TUI.
- Press Esc / interrupt the session.
- Only now does a notice appear that the subagent ended, with state
cancelled.
Expected Behavior
- A background subagent whose upstream requests fail should surface that failure promptly: a terminal error/part result event to the parent session plus a visible indicator in the TUI.
- The automatic "you will be notified when it finishes" contract should also hold on the failure path, not only on success.
- Ideally the runner applies bounded retry/backoff for transient 429s and then reports a distinguishable terminal state (e.g.
failed: rate limited) instead of leaving the child in an indefinite in-progress limbo.
Actual Behavior
- The child session stalls indefinitely; no event, notification, or TUI change indicates a problem.
- The parent agent cannot answer questions about subagent progress ("what's the subagent doing?" got no useful answer for many minutes).
- Retries against the rate-limited provider continue silently, consuming more of the exhausted quota.
- After a manual interrupt, the subagent is reported only as
cancelled(session id prefixses_fc8036a7…in that run; parentses_fc817cb3…). Nothing in the visible UI hinted at the 429 cause; it had to be inferred from the provider dashboard.
Additional Context
- Frequency: reproduced consistently within one long session whenever the upstream subscription was rate-limited; two different routed providers exhibited the same silent-hang behavior, which is why it looks like a runner-level gap rather than a provider adapter bug.
- Workaround: avoid
background: truefor subagents while on a rate-limited plan and run exploration inline in the primary agent, or interrupt the session to reclaim control and re-dispatch. - Happy to pull the exact server-log lines (
role=server, child session run ids) from~/.local/share/opencode/log/opencode.logfor the affected timeframe if useful — say the word and I'll attach a redacted excerpt.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.