Skip to content

Add OpenCode Go provider support and bring repo up to ecosystem convention - #52

Draft
alpibrupa wants to merge 3 commits into
mainfrom
claude/housekeeping-opencode-support
Draft

Add OpenCode Go provider support and bring repo up to ecosystem convention#52
alpibrupa wants to merge 3 commits into
mainfrom
claude/housekeeping-opencode-support

Conversation

@alpibrupa

Copy link
Copy Markdown
Contributor

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-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.

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

lex pkg install                        # resolves cleanly (12 packages)
lex check <every tracked src/*.lex>    # matches CI's own loop — all ok
lex fmt --check src/                   # all 76 files formatted
lex check examples/manifesto_parallel.lex          # passes
lex check examples/manifesto_parallel_bad.lex      # correctly rejected
bash examples/manifesto_semantic_diff/run.sh        # validates

Live smoke test (script not part of this diff): two lex run invocations confirm build_agent.opencode_agent() constructs and session.pick_agent(Build, "opencode") dispatches to it correctly.


Generated by Claude Code

claude added 3 commits August 13, 2026 20:13
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants