# Configuration reference

Use Hybrid Workflow settings inside OpenCode for routine setup. These details are for advanced configuration and migration.

For terminal commands below, use `npx --package @rockysoft/opencode-hybrid-workflow@latest opencode-hybrid` in place of `opencode-hybrid` unless you installed the standalone CLI globally.

## Configuration

Both CLI and OpenCode-provider reviewers can inspect a captured frontend through
**Hybrid Workflow settings > Reviewer browser**. The installer provides pinned
Playwright and Firefox without replacing an existing implementation MCP entry.

See [repeatable browser checks](./browser-evidence.md) for the project contract,
static-build/fixture scope, baseline screenshots, and migration from live URLs.
Reviewers can select a scenario, navigate its captured paths, inspect accessibility
snapshots, click/fill/resize, and capture pixels. They cannot access live servers,
upload files, execute arbitrary page code or send project text in web searches.
Public documentation is available through `hybrid_public_document` IDs.

Advanced `reviewBrowser` settings in `hybrid/config.json` are `command` (the local
Playwright MCP installation), `browser` (chrome/msedge/firefox), and `headless`.
Arbitrary MCP browser transports and WebKit are unsupported by this adapter.
Reviewer output is isolated under each review's `browser-artifacts`; action names
are recorded in `actions.jsonl`. Sessions are not shared between reviewers or
inherited from the implementation agent. Vision-capable models receive pixels;
text-only models cannot claim visual inspection. Ordinary implementation browser
tools remain available for unsupported live-server scenarios.

`opencode-hybrid config` prints the configuration location, normally
`~/.config/opencode/hybrid/config.json`. `OPENCODE_CONFIG_DIR`,
`OPENCODE_HYBRID_CONFIG` can choose another user-owned location from your launcher.
Plugin `options.configFile` must match that trusted location; a project cannot
redirect reviewer executable settings to its own file. The installer supports
`--config-dir PATH` for a separate profile.
Do not put credentials in this file; OpenCode or the selected official CLI owns authentication.

CLI reviewers use the account already signed in through that CLI, including
Claude Console/API billing or a subscription. The plugin does not switch accounts,
copy keys or inherit API-key environment overrides. Billing follows the CLI login
you selected. For environment-key or cloud-provider setups, connect the provider
through OpenCode and select that provider/model in Hybrid Workflow settings.

`opencode-hybrid configure` opens an interactive selector: choose one or two
reviewers, OpenCode provider or external CLI for each, model, supported variant/CLI effort, and the
planning/design lead. Either slot can use any supported adapter, including two
OpenCode models, two CLI models, or one of each. `opencode-hybrid models` lists the
enabled tool-capable models from your OpenCode provider catalog. Any enabled
provider is eligible; Copilot is an ordinary catalog provider, not a special adapter. No local model
server, GPU setup, Strata launcher or model download is managed by this package.

Noninteractive examples (use actual IDs returned by `models`):

```sh
opencode-hybrid configure --reviewer1 codex-cli:gpt-6-astra --reviewer2 claude-cli:opus --variant1 high --variant2 high
opencode-hybrid configure --reviewer1 opencode:PROVIDER/MODEL --reviewer2 none
opencode-hybrid configure --reviewer1 opencode:PROVIDER/MODEL --reviewer2 claude-cli:opus --variant1 SUPPORTED_VARIANT
```

```json
{
  "version": 1,
  "reviewers": {
    "astra": { "adapter": "codex-cli", "model": "gpt-6-astra", "effort": "high", "executable": "codex" },
    "opus": { "adapter": "claude-cli", "model": "opus", "effort": "high", "executable": "claude" }
  },
  "verification": { "executable": "pnpm", "timeoutMs": 0 },
  "reviewTimeoutMs": 0
}
```

`astra` and `opus` are stable storage-slot IDs, not provider restrictions. Set the
second slot to `null` for one reviewer. An OpenCode slot has
`{"adapter":"opencode","providerID":"...","model":"...","variant":"..."}`;
omit `variant` for the provider default. There is no invented universal effort
mapping. `designAuthor` selects `astra` or `opus`; default is the last enabled slot.
Legacy defaults remain Codex/Astra and Claude/Opus, both high effort; first-run
setup asks for explicit choices and initially highlights OpenCode providers.

Native reviewers run in read-only OpenCode child sessions with only frozen
evidence, public-documentation tools and the optional isolated browser. They cannot edit source, delegate or
recursively start checkpoints. Image reviews require an image-capable model.
Unknown/disabled models, unsupported variants and invalid reports fail explicitly;
there is no provider fallback. Provider context limits still apply.

Reviewer assignments are pinned for an active task; changing defaults affects
the next task without restarting OpenCode. Existing findings are retained. One
reviewer must pass with no medium-or-higher findings; it does not claim independent
cross-model agreement. With two, both reports must complete and neither may have
an unresolved medium-or-higher finding. Low/info suggestions do not block a pass.

Installation merges plugin entries into `opencode.json` and `cli.json`, installs
nine specialist definitions and the three design skills, and adds a managed rules
file. Existing custom agent/skill files are preserved and reported. Other settings,
permissions and implementation-model choices are retained. JSONC is accepted;
comments are removed from the rewritten file, with an exact original backup.
Updates replace only unchanged package-managed instruction files. It does not
import personal project memories or modify Claude/Codex global rules.

## Storage and existing sessions

New state lives outside both the package and project: Windows uses
`%LOCALAPPDATA%/opencode-hybrid/runtime`, other platforms use
`$XDG_DATA_HOME/opencode-hybrid/runtime` or `~/.local/share/opencode-hybrid/runtime`.
Projects are isolated by canonical path. Checkpoints are project-scoped; concurrent
conversations editing the same project must coordinate against the same gate.
Opening a subfolder of a Git repository asks you to open its root.

To retain a trial project's exact existing history without copying/resetting it:

```sh
opencode-hybrid init --legacy-config /path/to/old/config.json --project /path/to/project
```

Only that project receives a runtime override; new projects use portable storage.
OpenCode conversation history is separate. Sessions created under an isolated
`XDG_DATA_HOME` remain in that profile; installation does not move them. Existing
trial profiles stay usable. Restart OpenCode to load changed modules; installation
does not interrupt running sessions or restart model servers.

## Troubleshooting

Use **Hybrid Workflow settings > Run diagnostics** to check prerequisites,
reviewer connections, design skills and browser access. Sign in to each provider
on the machine where you use OpenCode. Reopen OpenCode after a plugin update.

## License

The original plugin code is MIT-licensed; bundled skills retain their own
licenses as listed in `THIRD_PARTY_NOTICES.md`. Authenticate providers on each
machine rather than copying account credentials.

## Frozen source lookup

Reviewers automatically receive `hybrid_evidence_query` (under `review_evidence` for CLI connections). It supports inventory, literal case-sensitive search and batch line reads within the captured source snapshot. Results include hashes, snapshot identity, UTF-16 offsets and continuation fields. Missing, withheld or changed captures are explicitly unavailable. Existing file/image readers remain available. No symbol analysis, regex execution or live-project reads are added. Query contents never enter usage logs; CLI query measurements contain only operation names, sizes, duration and status.

## Project context and resume

New tasks keep stable contracts ahead of changing review details. Full skills, plans and frozen source remain accessible through the existing evidence transport. Cache behavior is managed by your provider, so stable prompts do not guarantee cache hits or lower charges.

After an accepted code review, structured engineering handoffs can supply project-specific ownership hints. Any captured source/configuration change makes these hints stale; conflicting plan/design owners are omitted. Hints cannot approve work or replace verification. The checkpoint status includes current contracts, pending findings, verification freshness and the next permitted step for resuming work. Existing tasks retain their earlier transport; no conversation is reset.
