t3code icon indicating copy to clipboard operation
t3code copied to clipboard

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

Open Jandev9 opened this issue 4 months ago • 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.

Jandev9 avatar Aug 01 '26 04:08 Jandev9