Skip to content

Bug: continue_loop_on_deny does not apply to task/subtask permissions (Effect.orDie crashes instead of continuing) #31108

Closed as not planned

Description

@remorses

Description

Task/subtask permission denials crash the task instead of letting the model continue, even with experimental.continue_loop_on_deny: true.

In packages/opencode/src/session/prompt.ts line ~614-621, the task tool's permission ask is wrapped with Effect.orDie:

ask: (req: any) =>
  permission
    .ask({
      ...req,
      sessionID,
      ruleset: Permission.merge(taskAgent.permission, session.permission ?? []),
    })
    .pipe(Effect.orDie),

Effect.orDie converts any failure (including RejectedError from permission denial) into a fatal defect. This bypasses the shouldBreak/blocked logic in processor.ts that continue_loop_on_deny controls.

The continue_loop_on_deny config only affects the main processor loop (processor.ts:542):

ctx.shouldBreak = (yield* config.get()).experimental?.continue_loop_on_deny !== true

Task permissions never reach this code path because orDie turns the rejection into a crash before the processor can handle it.

When continue_loop_on_deny: true, a denied permission in a task should let the task model see the rejection as a tool error and continue (or report back to the parent), not crash the task.

Workaround: Kimaki uses a plugin that watches for permission.updated events on subagent sessions and immediately rejects them via permission.reply(), so the task fails fast and returns to the parent instead of hanging for the full permission timeout.

Related: #30726, #14297, #7730

Plugins

kimaki (custom plugins for subagent rate limiting, permission auto-reject)

OpenCode version

1.15.11

Steps to reproduce

  1. Set experimental.continue_loop_on_deny: true in opencode config
  2. Start a session that spawns a task (subagent)
  3. The task requests a permission (e.g. external_directory)
  4. Deny the permission (or let it time out)
  5. The task crashes instead of continuing

Operating System

macOS

Activity

  1. github-actions commented on Jun 6, 2026

    @github-actions
    Contributor

    This issue doesn't fully meet our contributing guidelines.

    What needs to be fixed:

    • No issue template was used. Please use one of the three required templates: Bug Report, Feature Request, or Question. For this issue, the Bug Report template is appropriate.

    Please edit this issue to address the above within 2 hours, or it will be automatically closed.


    This issue might be a duplicate of existing issues. Please check:

    If you believe this was flagged incorrectly, please let a maintainer know.

  2. added
    needs:complianceThis means the issue will auto-close after 2 hours.
    and removed
    needs:complianceThis means the issue will auto-close after 2 hours.
    on Jun 6, 2026
  3. changed the title [-]continue_loop_on_deny does not apply to task/subtask permissions[/-] [+]Bug: continue_loop_on_deny does not apply to task/subtask permissions (Effect.orDie crashes instead of continuing)[/+] on Jun 6, 2026
  4. github-actions commented on Jun 6, 2026

    @github-actions
    Contributor

    Thank you for updating the issue! It now follows the contributing guidelines and bug report template correctly. The label has been removed.

  5. github-actions commented on Aug 6, 2026

    @github-actions
    Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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