Skip to content

[Critical] Fix silent tool failure in background execution #8

@randomm

Description

@randomm

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:

  1. Store error in task result
  2. Inject failure notification into next loop iteration
  3. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions