Skip to content

OpenCode Reference

t3code is a desktop application that provides a unified web interface for multiple AI coding agents, including OpenCode. When OpenCode runs through t3code, some maestria agent-level controls behave differently.

t3code runs an OpenCode server and talks to it through the @opencode-ai/sdk/v2 client. Unless its environment already sets one, it passes OPENCODE_CONFIG_CONTENT="{}" to that server (source: OpenCodeRuntime.ts).

In OpenCode V2, an agent’s ordered permissions rules and a session’s optional permissions ruleset are merged, agent rules first, and the last matching rule decides (source: permission.ts, session create protocol). maestria sets only agent-level rules, so a session ruleset can override them.

t3code expresses each of its runtime modes as session rules (source: v2 adapter):

t3code mode Session rules Effect on maestria agents
Full access Allow every action Overrides agent-level deny rules, so the reviewer can edit and run shell commands despite its read-only rules
Approval required Ask for shell, edit, and external-directory actions The main loop’s permitted edits and shell commands need manual approval, and the reviewer’s edit denials become approval prompts
Auto-accept edits Allow edit; ask for shell and external-directory actions The reviewer can edit
Plan interaction mode Adds an edit deny Edits are denied except where the agent’s own path rules allow them

maestria has not run these modes end to end under t3code; the table follows the cited source. When read-only enforcement matters, use OpenCode directly.

.maestria/workflow.md then .maestria/rules.md load from the project directory OpenCode reports for the plugin, or from the session directory when there is no project. They are read fresh for every agent-loop and compaction request, so edits need no restart. Missing or empty files are skipped; a present-but-unusable file throws while OpenCode assembles the request context, so the request fails instead of running without it. See Workflow Patterns for order, precedence, and carry-over.