Repository navigation
feat: sync upstream opencode v2.0.28 and add the Smart Router - #4
Merged
Merged
Conversation
Brings devpass-code from opencode v1.18.10 to v2.0.28 (5,108 upstream commits): the new packages/cli + packages/tui architecture, session tabs, the mini interface, the Effect plugin system, and the bundled app server. Fork behavior ported to the v2 layout: - branding: devpass-code binary, npm/brew/AUR/Docker names, config in ~/.config/devpass-code, devpass-code.json and .devpass-code/ (opencode files still read), DevPass Code in prompts, TUI, CLI, and OAuth pages - catalog: built from LLM Gateway /v1/models with models.dev metadata merged in; bundled snapshot regenerated from the gateway - providers: only LLM Gateway and LLM Gateway DevPass are registered, with browser login (loopback key handoff) and paste-a-key - llmgateway theme stays the default; DevPass wordmark kept - release pipeline: packages/cli builds devpass-code-* platform packages, archives for GitHub releases, npm/Homebrew/AUR/Docker publish, and the updater checks npm and the theopenco tap - upstream-only @OpenCode packages, desktop, and winget publishing skipped Smart Router: - new llmgateway/smart-router model routes each user turn to a fast, balanced, or frontier model chosen by an LLM Gateway decision model - the decision model is the model variant: gpt-6-luna-decisions, microsoft-decision-1, or jev-1.13.0 (default), listed from the gateway - one verdict per turn keeps tool steps on one model and prompt cache; titles and compaction use the fast tier - /smart-router command and a decision-model picker in the TUI; Smart Router is the default model until one is chosen - DEVPASS_SMART_ROUTER_MODELS and DEVPASS_SMART_ROUTER_DECISION_MODEL Upstream base for the next sync: v2.0.28.
- replace upstream Blacksmith runner labels with ubuntu-24.04, ubuntu-24.04-arm, and windows-2025; theopenco has no Blacksmith runners, so jobs queued forever
GitHub ubuntu-24.04/windows-2025 images do not ship rg, unlike the previous Blacksmith images. Core's Ripgrep service falls back to downloading a release archive, which the test HttpClient guard rejects, failing every Ripgrep and search-tool test.
DevPass Code only registers the LLM Gateway provider plugins, so the integration catalog never exposes openai/chatgpt-browser and these tests time out waiting for it. Remove them and their now-unused helpers.
…de rebrand packages/core/script/test.ts set OPENCODE_CONFIG_DIR to .config/opencode while Global.Path.config is now .config/devpass-code, failing preload.test.ts under the real test command. packages/cli/script/service-smoke.ts still looked for dist/cli-<os>-<arch>/bin/opencode and the state/opencode registration directory, but build.ts emits dist/devpass-code-<os>-<arch>/bin/devpass-code and the service registers under state/devpass-code.
The rebrand renamed the shiki theme identifier passed to Pierre and the Markdown worker to "DevPass Code", but packages/ui registers the theme as "OpenCode" (marked-theme.tsx, marked-theme-register.tsx). Shiki threw "No valid theme loader registered for 'DevPass Code'", so every diff, code block and Mermaid render failed in the app e2e and session-ui component suites.
…ners packages/core/test/npm.test.ts: the two Git-install test groups ran under Bun's default 5s timeout; on GitHub-hosted windows-2025 runners git ls-remote/clone over file:// took longer and were SIGTERMed (unit (windows) job 116053034578). Give them the same 30s budget the neighbouring Git tests already use. packages/cli/test/standalone.test.ts: cleanup rm raced the just-killed standalone server releasing its handles (EBUSY in the same job). Retry like service-smoke.ts.
- run Windows unit and e2e suites on main pushes and manual runs, non-blocking - trigger on main instead of upstream's dev branch - cap Playwright at 2 workers on the 4-vCPU hosted runners
This was referenced Oct 15, 2026
smakosh
added a commit
to theopenco/llmgateway
that referenced
this pull request
Oct 15, 2026
## What A blog post announcing DevPass Code 2.0: [`apps/ui/src/content/blog/2026-10-15-devpass-code-smart-router.md`](https://github.com/theopenco/llmgateway/blob/docs/devpass-code-smart-router-blog/apps/ui/src/content/blog/2026-10-15-devpass-code-smart-router.md), published at `/blog/devpass-code-smart-router`. - **Smart Router**: before each message, a decision model on `/v1/decisions` picks fast (`claude-haiku-5-5`), balanced (`claude-sonnet-5-5`) or frontier (`claude-opus-5-5`). - **Decision models**: users pick `jev-1.13.0` (the default), `microsoft-decision-1` or `gpt-6-luna-decisions` with `/smart-router` or `ctrl+t`. - **Session tabs** from opencode v2, the tier override env vars, and install/upgrade steps. - The demo video is embedded from YouTube ([youtu.be/dYRPOwLP8V4](https://youtu.be/dYRPOwLP8V4)). It uses the same `youtube-nocookie` iframe the guides use. - The cover is a gpt-image-2 render with the official logo added by `composite-logo.sh`, then reduced to a 256-color PNG (3.0 MB to 784 KB). ## Fact sources - Behavior and defaults come from `packages/core/src/plugin/provider/llmgateway.ts` and `packages/tui/src/config/keybind.ts` in theopenco/devpass-code#4. - Prices and context sizes come from `packages/models`. - The demo numbers (8.9 s, 35.9 s, 12 tests, 4 clarifying questions) come from the router logs of the recorded session. ## DevPass Code release The install commands in the post need DevPass Code 2.x. theopenco/devpass-code#5 fixed the release pipeline and v2.0.29 is out: `npm view devpass-code dist-tags` returns `latest: 2.0.29`, a fresh `npm i devpass-code@latest` runs as `devpass-code v2.0.29`, and the Homebrew tap formula is at 2.0.29. ## Verification - `pnpm exec turbo run build --filter=ui` passes, so the frontmatter matches the schema. - Rendered with `next start`: the page shows the cover, the 896×504 YouTube embed with the custom thumbnail, 3 tables, 6 sections and 5 FAQs, with Article, BreadcrumbList and FAQPage JSON-LD. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Added an announcement for DevPass Code 2.0 covering Smart Router behavior, model options and costs, routing and fallback rules, session tabs, configuration, and installation and upgrade guidance. * Included a demo, FAQ, image, and links to related resources. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Luca Steeb <contact@luca-steeb.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
Syncs DevPass Code from opencode v1.18.10 → v2.0.28 (5,108 upstream commits) and adds the Smart Router: a model that lets an LLM Gateway decision model pick which model handles each turn.
Upstream v2 brings a new architecture (
packages/cli+packages/tuiinstead ofpackages/opencode), session tabs (on by default: run several agents side by side with working / waiting / done status per tab), the mini interface, the Effect plugin system, and the background service.Smart Router
New
llmgateway/smart-routermodel, also onllmgateway-devpass. Before each user turn a decision model reads the request over/v1/decisionsand picks a tier:claude-haiku-5-5claude-sonnet-5-5claude-opus-5-5The user picks the decision model with the variant picker (
ctrl+t,/variants, or the new/smart-routercommand). The choices are every model the gateway marks as a decision model:gpt-6-luna-decisions,microsoft-decision-1,jev-1.13.0(the default).One decision per user turn: tool steps stay on the same model, so prompt caching keeps working. Titles and compaction always use the fast tier. If the decision call fails, the turn goes to the balanced tier.
Smart Router is the default model until the user or their config picks another one.
DEVPASS_SMART_ROUTER_MODELS=fast,balanced,frontierchanges the tier models.DEVPASS_SMART_ROUTER_DECISION_MODELchanges the default decision model.Fork behavior ported to v2
devpass-codebinary and packages. Config lives in~/.config/devpass-code,devpass-code.json, and.devpass-code/; existingopencode.jsonand.opencode/files are still read. Prompts, TUI, CLI help, and OAuth pages say DevPass Code. The sidebar onboarding points to LLM Gateway./v1/models(text models only), with models.dev metadata merged in for reasoning options, release dates, and output limits. The bundled snapshot (packages/core/src/models-dev/snapshot.txt, 217 models, 127 KB, was 5.3 MB) is regenerated from the gateway byscript/update-models-snapshot.ts.llmgatewaytheme stays the default, and the DevPass wordmark is kept.packages/clibuildsdevpass-code-<os>-<arch>packages and the release archives, and publishes to npm, the theopenco Homebrew tap, AUR, and ghcr.devpass-code upgradenow checks npm and the tap. Upstream-only@opencode/*libraries, desktop, and winget publishing are skipped.Verification
bun run check(lint + typecheck across 36 packages) passes; it runs in the pre-push hook.devpass-code run -m "llmgateway/smart-router#gpt-6-luna-decisions" "Design a sharded, multi-region event-sourcing architecture…"loggedtier=frontier model=claude-opus-5-5and returned an answer. A simple prompt routed throughmicrosoft-decision-1also answered. Before wiring them in, I called all three decision models directly with the routing question.packages/core/test/plugin/provider-llmgateway.test.tscover building the catalog, the decision-model variants, the browser login loopback (including a forged state being rejected), routing a turn, keeping one model across a turn's tool steps, the fast tier for titles, and the fallback when a decision fails.test/shell-scan/oracle.test.tsfails 1 test both here and upstream.Not covered
/smart-router, sidebar copy) are covered by typecheck and the existing TUI tests only.maincuts a release automatically. The checked-in version is 2.0.28, so the first release will be v2.0.29.Upstream base for the next sync: v2.0.28.