Problem
In packages/opencode/src/core/loop.ts (lines 288-310), if a tool throws in background execution, the error is swallowed and user sees success.
Impact
Users won't know tool failed, leading to confusion and incorrect behavior.
Solution
Ensure error messages reach context as failed task notification. When background task fails:
- Store error in task result
- Inject failure notification into next loop iteration
- Make failure visible to user/agent
Files
packages/opencode/src/core/loop.ts
packages/opencode/src/core/tasks.ts
Branch
claude/simplify-agentic-loop-2jRSP