You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
plugins/opencode/commands/rescue.md declares allowed-tools: Bash(node:*), which permits Bash in the command's own execution context. But Claude Code does not propagate allowed-tools to subagents the command spawns, and plugin subagents cannot use permissionMode: bypassPermissions. As a result, when /opencode:rescue --background is used, the opencode:opencode-rescue subagent is spawned in background mode where permission prompts are impossible and Bash is auto-denied. The subagent returns a permission error instead of running OpenCode.
Options
A. Eliminate the subagent layer (simplest). The rescue subagent is a thin forwarder — it makes exactly one Bash call to opencode-companion.mjs task .... Inline that call directly in commands/rescue.md, which already has Bash(node:*), and delete plugins/opencode/agents/opencode-rescue.md. This also avoids the worktree hang tracked in the companion issue for openai/codex-plugin-cc#198.
B. Promote rescue agent to ~/.claude/agents/ at setup. Extend handleSetup in opencode-companion.mjs to copy agents/opencode-rescue.md into ~/.claude/agents/ with permissionMode: bypassPermissions injected. Regular user-level agents support permissionMode, so the subagent would then work in background mode. Add a hash/version check so re-running /opencode:setup refreshes the copy.
Option A is cheaper and has no "did the user run setup?" dependency.
changed the title [-]opencode:rescue subagent has no Bash permission in background mode[/-][+]Rescue forwarding contract: permissions, backgrounding, timeouts[/+]on Apr 12, 2026
Consolidating related rescue-forwarder issues here: #16 covers run_in_background/worktree cleanup, #37 covers foreground calls timing out before OpenCode finishes, and #39 covers the rescue agent model tier. A single rescue forwarding contract should settle whether the plugin keeps the subagent, inlines the companion call, how backgrounding works, and what minimal model/tier is required if an agent remains.
Activity
[-]opencode:rescue subagent has no Bash permission in background mode[/-][+]Rescue forwarding contract: permissions, backgrounding, timeouts[/+]JohnnyVicious commentedon Apr 12, 2026
Consolidating related rescue-forwarder issues here: #16 covers run_in_background/worktree cleanup, #37 covers foreground calls timing out before OpenCode finishes, and #39 covers the rescue agent model tier. A single rescue forwarding contract should settle whether the plugin keeps the subagent, inlines the companion call, how backgrounding works, and what minimal model/tier is required if an agent remains.
fix(rescue): inline forwarding into the slash command (closes #17)
fix(reaper): skip SIGTERM when tracked jobs are in-flight
fix(rescue): inline forwarding into the slash command (closes #17) (#58)