feat(agents): add opencode CLI agent plugin#62
Conversation
|
Validated: |
|
@copilot resolve the merge conflicts in this pull request |
`plugins/agents/opencode` → `agentix.agents.opencode`, a sandbox-side wrapper around the opencode terminal coding agent (mirrors `agentix.agents.claude_code`): - `run(instruction, *, workdir, timeout, model, extra_args, env) -> Result` invokes `opencode run` non-interactively and returns exit_code/stdout/stderr. Provider-agnostic — the caller wires the LLM endpoint via `env`/`extra_args`. - `default.nix` ships the `opencode` binary on `/nix/runtime/bin`. The derivation is lifted from numtide/llm-agents.nix (packages/opencode, v1.15.12) and adapted to plain nixpkgs (wrapBuddy -> autoPatchelfHook; libstdc++ on LD_LIBRARY_PATH for the dlopen'd @parcel/watcher addon). - deps = `agentixx` only (binary via Nix), so the workspace lock gains one additive entry and no version changes. Verified: ruff, pyright (0 errors), `uv lock` additive-only. NOT verified locally: the `default.nix` build (no nix in my env) and the unit test (the `agentix.agents.*` namespace only imports from a real bundle, not the editable workspace) — hence draft; please validate the build in your nix environment. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Select x86_64-linux / aarch64-linux from a platformMap (both hashes from upstream llm-agents.nix). Validated end-to-end: `agentix build plugins/agents/opencode --platform linux/arm64` builds the bundle (nix builds the derivation, fetches + autoPatchelf's the binary) — so the nix caveat in the previous commit is resolved. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
7321c28 to
bf4d61c
Compare
|
Rebased onto master (9181aa7). Conflicts were confined to the root pyproject.toml pyright Verified locally on the rebased branch: One pre-existing gap intentionally not folded into the rebase: like qwen-code, |
What
plugins/agents/opencode→agentix.agents.opencode, a sandbox-side wrapper around the opencode terminal coding agent, following theclaude-codeplugin shape.run(instruction, *, workdir, timeout, model, extra_args, env) -> Resultinvokesopencode runnon-interactively and returnsexit_code/stdout/stderr. Provider-agnostic — the caller wires the LLM endpoint viaenv/extra_args(e.g. an OpenAI-compatible base URL from the in-sandbox bridge), per the integrate-an-agent guide.default.nixships theopencodebinary on/nix/runtime/bin. The derivation is lifted fromnumtide/llm-agents.nix(packages/opencode, v1.15.12) and adapted to plain nixpkgs:wrapBuddy→ stockautoPatchelfHook, andlibstdc++placed onLD_LIBRARY_PATHfor opencode's dlopen'd@parcel/watchernative addon. Multi-platform (x86_64 + aarch64), both hashes from upstream.dependencies = ["agentixx"]only — the binary comes via Nix, so the workspace lock gains one additive entry with zero version changes (no pollution).Verification
ruff checkpyright(0 errors, full include set; opencode wired into[tool.pyright])uv lock— additive only (Added agentix-agent-opencode, no downgrades)default.nixbuild validated end-to-end:agentix build plugins/agents/opencode --platform linux/arm64builds the bundle (nix builds the derivation, fetches +autoPatchelfs the binary).tests/test_opencode.py: argv/env/timeout) but not run in CI: theagentix.agents.*namespace only imports from a built bundle, not the editable venv (same as the existing agent plugins).Wired into
[tool.uv.workspace](via theplugins/agents/*glob) and[tool.pyright].