Skip to content
Source
Sign inSign up
pingdotgg/t3code

bug(opencode): Supervised, Auto-accept edits, and Auto modes collapse into blanket 'ask' for all permissions #5164

ClosedJandev9(GitHub profile, opens in a new tab) opened this issue 0 comments

Summary

When using an OpenCode session in T3 Code, selecting Supervised, Auto-accept edits, or Auto mode results in identical behavior: every routine terminal command (e.g. date -Iseconds, ls) and file edit requires manual user permission.

Root Cause

In apps/server/dist/bin.mjs, buildOpenCodePermissionRules(runtimeMode) performs a binary check for "full-access". If runtimeMode !== "full-access", it returns a blanket ask ruleset for all permissions:

function buildOpenCodePermissionRules(runtimeMode) {
	if (runtimeMode === "full-access") return [{ permission: "*", pattern: "*", action: "allow" }];
	return [
		{ permission: "*", pattern: "*", action: "ask" },
		{ permission: "bash", pattern: "*", action: "ask" },
		{ permission: "edit", pattern: "*", action: "ask" },
		{ permission: "webfetch", pattern: "*", action: "ask" },
		{ permission: "websearch", pattern: "*", action: "ask" },
		{ permission: "codesearch", pattern: "*", action: "ask" }
	];
}

Unlike the Codex/Claude provider paths (which map auto-accept-edits to auto-approving edits and auto to the auto_review guardian subagent), OpenCode's non-full-access modes collapse into ask for both bash and edit.

Suggested Fix

  1. Map auto-accept-edits for OpenCode to set action: "allow" for edit permissions.
  2. Wire the auto_review guardian subagent into the OpenCode provider path for auto mode.

Sign in to join this conversation.