feat: opencode as a tier-1 ACP runtime + BUZZ_DEFAULT_RUNTIME engine override - #6526
Open
innerline wants to merge 5 commits into
Open
feat: opencode as a tier-1 ACP runtime + BUZZ_DEFAULT_RUNTIME engine override#6526innerline wants to merge 5 commits into
innerline wants to merge 5 commits into
Conversation
Promote opencode from a PATH-probed tier-2 preset to a compiled-in KNOWN_ACP_RUNTIMES entry alongside goose/claude/codex, so it gets an auto-install button, config-file awareness, and skill discovery: - native ACP (opencode acp); installer writes ~/.opencode/bin which is now probed in common_binary_paths - skill_dir .opencode/skills joins the nest symlink fan-out - auth_probe_args and model_env_var stay None deliberately: opencode auth list exits 0 with zero credentials (no faithful probe) and opencode core reads no model env var (config-side pinning) - catalog copy, RuntimeIcon comment, and e2e fixture move opencode from the preset group to the builtin group with can_auto_install Signed-off-by: innerline <innerline@me.com>
Track A of making opencode a first-class Buzz backend engine: - buzz-acp default_agent_args: opencode defaults to 'acp' like goose, so env-launched/remote opencode harnesses never fall into the TUI - desktop default_agent_command reads BUZZ_DEFAULT_RUNTIME and resolves it through the three-tier harness lookup (builtins/presets/custom), so operators can make opencode the site default for new agents; unknown ids warn and fall back to bundled buzz-agent (stock installs unchanged) - document the tier-1 promotion and the engine override in the buzz-acp BYOH README Model pinning and MCP servers need no bridge: buzz-acp already applies them at the ACP protocol level (session/new model catalog + mcpServers), which opencode supports natively. Signed-off-by: innerline <innerline@me.com>
The differential ratchet forbids growth of discovery.rs (1438) and its tests.rs (1820) past their merge-base sizes, which the tier-1 promotion and engine-override commits exceeded. Restructure without behavior change: - OPENCODE_RUNTIME entry and the BUZZ_DEFAULT_RUNTIME resolver move to runtime_metadata.rs (well under its limit); the KNOWN_ACP_RUNTIMES array references the const - default_agent_command becomes a thin override-or-bundled wrapper - new opencode tests move to discovery/tests/opencode.rs, declared from runtime_metadata via #[path] so tests.rs stays at base size Signed-off-by: innerline <innerline@me.com>
The preset-logo coverage guard (presetLogos.test.mjs) asserts PRESET_LOGOS tracks the backend PRESET_HARNESSES ids exactly; after the tier-1 promotion opencode is no longer a preset, so its entry failed the guard and blocked the pre-push desktop-test lane. Bundled logos for builtins live in RUNTIME_LOGOS as inline assets (claude pattern) — copy opencode.svg into the onboarding assets dir and import it ?inline. Signed-off-by: innerline <innerline@me.com>
Add examples/sprig-opencode — a Dockerfile deriving FROM the published
sprig image and layering the pinned opencode musl binary (v1.18.21),
plus usage notes. This follows the remote-agent spec's rule that the
default image stays lean and alternate-harness dependencies arrive via
the image override ('buzz-sprig plus your tools'), rather than growing
Dockerfile.sprig. Reference the example from remote-agents.md and the
agent_command enumeration now lists opencode.
Signed-off-by: innerline <innerline@me.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Promotes OpenCode from a PATH-probed tier-2 preset to a compiled-in tier-1 runtime (alongside goose/claude/codex), and adds an operator-level default-engine override. Alternative to #3869 — see Positioning below.
Tier-1 promotion
opencode acpnative ACP; auto-install via the vendor's cross-platform installer (curl -fsSL https://opencode.ai/install | bash— handles Git Bash/Windows natively, no PowerShell installer exists to route through the Defender-safe two-step form)underlying_cli: Some("opencode")so the Desktop install button actually runs Phase-1 install (goose pattern)~/.opencode/binadded tocommon_binary_paths— the installer writes there and only edits shell rc files, so this is the deterministic probe locationskill_dir: .opencode/skillsjoins the nest symlink fan-out (buzz-cliskill discoverable by opencode agents)Nones, verified against opencode source:auth_probe_args(opencode auth listexits 0 even with zero credentials — no faithful exit-code probe exists) andmodel_env_var(opencode core reads no model env var; model pinning flows through ACPsession/newnatively, which buzz-acp already applies)RUNTIME_LOGOSinline map (claude pattern); the preset-logo coverage guard passesruntime_metadata.rs, tests indiscovery/tests/opencode.rsDefault-engine override (opt-in)
BUZZ_DEFAULT_RUNTIME=<runtime-id>in the Desktop process environment makes any registered harness the default for newly-created agents (three-tier lookup: builtins → presets → custom registry); unresolvable ids warn and fall back to bundled buzz-agent. Stock installs unchangeddefault_agent_args: empty args meanacpfor opencode (goose pattern) so standalone/remote launches never fall into the TUIRemote agents
examples/sprig-opencode/— derived image (FROM ghcr.io/block/buzz-sprig+ pinned musl binary) following the spec's lean-default/image-override rule; referenced from remote-agents.mdVerification
cargo fmt/clippyclean, biome clean,tsc --noEmitclean, file-size ratchet passesPositioning vs #3869
#3869 adds an account-connection/auth surface (
supports_account_connection) and provider-qualified model discovery through existing ACP paths — valuable machinery this PR does not include. This PR instead covers the operational gaps #3869 leaves: auto-install (underlying_cli+ install commands vs none), skill discovery (.opencode/skillsvsNone), deterministic PATH probing (~/.opencode/bin), the default-engine override, and the remote-agent image example. Happy to rebase whichever direction maintainers prefer — the entries are complementary more than conflicting.