t3code icon indicating copy to clipboard operation
t3code copied to clipboard

OpenCode adapter treats runtimeMode: auto as approval-required (inconsistent with Claude)

Open jeffpascoal opened this issue 1 month ago • 1 comments

Summary With a thread in Auto runtime mode, the OpenCode provider asks for approval on every bash/edit/external-directory action. The Claude provider does not ask in the same mode. The OpenCode session ruleset is built by T3 and overrides the user's global opencode.jsonc permission config, so it can't be fixed from user config.

Expected auto behaves the same across providers: no approval prompts (equivalent to Claude's bypassPermissions). Only approval-required (and auto-accept-edits for edits) should prompt.

Actual In the bundled app code, openCodePermissionRules computes:

requiresApproval = runtimeMode !== "full-access"

so auto produces session rules with ask for bash, edit and external_directory. Only full-access yields allow *.

Other providers, from the same bundle:

Provider runtimeMode: auto
Claude bypassPermissions, no approval callback installed
Antigravity only approval-required blocks (adapter not fully read, least certain)
OpenCode ask rules, approval requested

Repro

  1. Create a thread with provider OpenCode, agent build, runtime mode Auto.
  2. Add "permission": { "bash": "allow" } to the global OpenCode config.
  3. Ask the agent to run any shell command.
  4. An approval prompt appears. Running the same OpenCode setup outside T3 does not prompt.
  5. Switching the thread to Full access removes the prompts.

Suggested fix Make requiresApproval true only for approval-required (and treat auto-accept-edits as allow for edits), matching the Claude adapter. Otherwise, document that auto means "ask" for OpenCode.

Workaround Use Full access on OpenCode threads.

jeffpascoal avatar Oct 24 '26 09:10 jeffpascoal

Duplicate of #11458, which tracks OpenCode Auto mode injecting approval rules over configured permissions, prompting for routine shell/tool calls while Full access removes the prompts. Keeping the reports together there.

juliusmarminge avatar Oct 24 '26 09:10 juliusmarminge