Add OpenCode Go provider support and bring repo up to ecosystem convention - #52
Draft
alpibrupa wants to merge 3 commits into
Draft
Add OpenCode Go provider support and bring repo up to ecosystem convention#52alpibrupa wants to merge 3 commits into
alpibrupa wants to merge 3 commits into
Conversation
…ntion lex-code was three weeks stale relative to the rest of the lex ecosystem and lacked native support for the OpenCode Go plan (https://opencode.ai/docs/zen) that lex-loom already uses. OpenCode Go support (native + via the LiteLLM proxy, matching lex-loom): - New `opencode_agent()` in all seven src/agents/*.lex files (build/explore/plan/refactor/review/spec_agent/test_agent), using lex-llm's existing `providers.opencode_go()` — no new package code needed there. Since the Go plan serves full-scale cloud models (DeepSeek, Qwen3, Kimi, GLM, MiniMax, MiMo), these get the same full tool budget as the other cloud providers (mistral/openai/google), not litellm/ollama's stripped-down local-model treatment. - `tools.opencode_model()` (src/tools/index.lex) reads OPENCODE_MODEL, mirroring the existing litellm_model() pattern. - Wired into src/server/session.lex's `pick_agent` and src/tui/main.lex's `select_provider_tag`/help text as a new `--opencode` flag. - litellm/config.yaml + litellm/docker-compose.yml: lex-code had no bundled proxy config at all (the README referenced a "litellm_config.yaml at project root" that didn't exist). Copied from lex-loom's own litellm/ directory — same model list including the OpenCode Go entries (DeepSeek/Qwen3/Kimi/GLM/MiniMax/MiMo) — so both repos can point at one shared proxy instance, and `--litellm` now works out of the box. - README: new "OpenCode Go plan" section, provider table row, and LiteLLM section pointing at the bundled config instead of a nonexistent file. Housekeeping (bringing this repo to the same convention as lex-agent/lex-soft/lex-loom/lex-memory): - lex.toml: bump the `lex` version pin from 0.9.7 to 0.10.9 (CI itself already installs 0.10.7; the rest of the ecosystem is on 0.10.9), add `license = "EUPL-1.2"` and a description. - LICENSE file (matches lex-lang/lex-os/lex-soft/lex-loom/lex-agent/ lex-memory's EUPL-1.2 notice-and-pointer form). - AGENTS.md + CLAUDE.md: this repo had neither, despite being the project that *builds* the coding-agent convention for everyone else. Documents the two-call-sites-per-provider pattern (agents/*.lex + session.lex's pick_agent), why there's no tests/ directory (CI gates on per-file lex check + the manifesto demos), and the local-model tool-budget curation. - README: License section, v0.6 roadmap entry. Verification: - lex pkg install: resolves cleanly (12 packages). - lex check on every tracked src/*.lex file (matches CI's own loop): all ok. - lex fmt --check src/: all 76 files formatted. - Manifesto demos (CI's actual regression gate, no tests/ dir exists): manifesto_parallel.lex passes, its negative twin is correctly rejected, manifesto_semantic_diff/run.sh validates. - Live smoke test: two lex run invocations confirm build_agent.opencode_agent() constructs and session.pick_agent(Build, "opencode") dispatches to it correctly (script not part of this diff). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BZagDSXr1qNv7dwkLrphHY
CI on the previous commit failed: "module \"src/memory\" not found in package \"lex-agent\"". src/project_memory.lex imports lex-agent/src/memory, which was deleted from lex-agent in favor of the new lex-memory package (alpibrusl/lex-memory#1, alpibrusl/lex-agent#30) — a consumer this repo's own audit at extraction time didn't know about, since lex-code wasn't yet in scope. lex-code's lex.toml pins lex-agent with a loose git ref (no branch/tag), so CI picked up the deletion the moment it landed on lex-agent's main. Fix: add lex-memory as a direct dependency and swap the import, same as the migration already done for lex-soft/lex-loom. No behavior change — project_memory.lex's own API (open/close/store_*/recall_*) is untouched; only the underlying module moved. Verification: - lex pkg install: lex-memory resolves cleanly (13 packages). - lex check on every tracked src/*.lex file: all ok. - lex fmt --check src/: all 76 files formatted. - Manifesto demos: unaffected, still pass. - Live smoke test: two lex run invocations against a real file-backed SQLite db confirm store_convention (process 1) is correctly recalled via recall_for_prompt (process 2) through the new import. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BZagDSXr1qNv7dwkLrphHY
Picks up lex-lang v0.10.10 (released today): the JIT step-counter fix closing the --max-steps bypass (#465/#710), the new [approval] effect for human-in-the-loop host boundaries (#737), and 'vcs' added to lex test's default permissive effect policy (#736), among other changes since v0.10.9/v0.10.7 (the two versions this repo had drifted across between lex.toml and CI -- lex.toml said 0.10.9, ci.yml/ publish.yml still said 0.10.7). Verification (against the real v0.10.10 release binary, not just the version string): - lex pkg install: resolves cleanly (13 packages). - lex check on every tracked src/*.lex file: all ok. - lex fmt --check src/: all 76 files formatted. - Manifesto demos (this repo's actual CI regression gate, no tests/ dir exists): manifesto_parallel.lex passes, its negative twin is still correctly rejected, manifesto_semantic_diff/run.sh validates. No behavior differences observed from the 0.10.9 baseline. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BZagDSXr1qNv7dwkLrphHY
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
lex-code was three weeks stale relative to the rest of the lex ecosystem and lacked native support for the OpenCode Go plan that
lex-loomalready uses.OpenCode Go support (native + via the LiteLLM proxy, matching lex-loom)
opencode_agent()in all sevensrc/agents/*.lexfiles (build/explore/plan/refactor/review/spec_agent/test_agent), usinglex-llm's existingproviders.opencode_go()— no new package code needed there. Since the Go plan serves full-scale cloud models (DeepSeek, Qwen3, Kimi, GLM, MiniMax, MiMo), these get the same full tool budget as the other cloud providers (mistral/openai/google), not litellm/ollama's stripped-down local-model treatment.tools.opencode_model()(src/tools/index.lex) readsOPENCODE_MODEL, mirroring the existinglitellm_model()pattern.src/server/session.lex'spick_agentandsrc/tui/main.lex'sselect_provider_tag/help text as a new--opencodeflag.litellm/config.yaml+litellm/docker-compose.yml: lex-code had no bundled proxy config at all — the README referenced alitellm_config.yamlat project root that didn't exist. Copied fromlex-loom's ownlitellm/directory — same model list including the OpenCode Go entries (DeepSeek/Qwen3/Kimi/GLM/MiniMax/MiMo) — so both repos can point at one shared proxy instance, and--litellmnow works out of the box.Housekeeping (bringing this repo to the same convention as lex-agent/lex-soft/lex-loom/lex-memory)
lex.toml: bump thelexversion pin from0.9.7to0.10.9(CI itself already installs0.10.7; the rest of the ecosystem is on0.10.9), addlicense = "EUPL-1.2"and a description.LICENSEfile (matches lex-lang/lex-os/lex-soft/lex-loom/lex-agent/lex-memory's EUPL-1.2 notice-and-pointer form).AGENTS.md+CLAUDE.md: this repo had neither, despite being the project that builds the coding-agent convention for everyone else. Documents the two-call-sites-per-provider pattern (agents/*.lex+session.lex'spick_agent), why there's notests/directory (CI gates on per-filelex check+ the manifesto demos), and the local-model tool-budget curation.lex-code is not being wired into lex-loom as a dependency (discussed separately) — loom's own agent runner already does the equivalent job, deliberately vendored rather than imported, the same isolation call loom makes for lex-soft's runtime.
Verification
Live smoke test (script not part of this diff): two
lex runinvocations confirmbuild_agent.opencode_agent()constructs andsession.pick_agent(Build, "opencode")dispatches to it correctly.Generated by Claude Code