Repository navigation
Releases
Releases · tbosancheros39/opencode-thinking-fix
4.0.5 - fresh-clone deploy procedure
Docs deploy fix for freshly cloned installs.
- README now carries the ordered 7-step Linux systemd procedure (clone,
npm install --omit=dev, copy the six units,daemon-reload, enable per lane 3457/3458/3463/3459/3462, verify) and an ordered 5-step Windows procedure (Node 24+, npm vs clone paths, PowerShell/CMD start, Task Scheduler or NSSM auto-start). - The audited fresh-machine failure (
ERR_MODULE_NOT_FOUND: Cannot find package 'eventsource-parser'at unit boot) is documented with its fix in README and AGENTS Troubleshooting. - Plugin loads through OpenCode: a raw
node require()of the package fails by design, now documented. - CI: tarball verification now resolves the version through npm itself before packing, after v4.0.5 hit a read-replica race.
- No proxy or routing behavior changed. Tests: 214/214.
v4.0.4
- The Zen free-tier lane now tracks the live catalogue.
GET /v1/modelson the Zen relay answered 85 ids on 2026-10-23, of them 8 free:beam-free,deepseek-v4.1-flash-free,flint-40b-free,glm-5.3-flash-free,jev-1.13-free,mimo-v2.6-flash-free,nemotron-3.5-lightning-free,nemotron-3.5-super-vl-free.flint-40b-free,jev-1.13-freeand theiropencode/twins are new inROUTES; thirteen retired ids were removed instead of left pointing at a dead endpoint —x-preview-f-free,hy3-free,mimo-v2.5-free,muse-spark-1.2-contributor-free,muse-spark-1.3-contributor-free,step-5-preview-free,longcat-2.5-preview-free,space-bunny-free,deepseek-v4-flash-free,ling-3.0-flash-fin-free,laguna-s-2.1-free,ox-alpha-free,nemotron-3-ultra-free. Evidence per id: absent from the live list, or answering400 Model is unavailable(space-bunny-free). The route tests now assert the live set and, for every retired id, that it no longer resolves tozen/v1. - The split lives in the repo, not only on one machine.
systemd/carries all five units: 3457 universal auto-routing, 3458 OpenCode Go chat + Responses (inference/go/openai/v1), 3463 OpenCode Go Anthropic messages (inference/go/anthropic/v1), 3459 Zen free lane, 3462 OpenRouter. The old copies still startedproxy.jsfromreasoning-cache-proxy/againstzen/go/v1; they now startproxy.cjsfrom this checkout and use%hso the file is not tied to one home directory. - The watchdog covers the Anthropic unit. It health-checked four ports and would have left a dead 3463 unrestarted;
reasoning-cache-go-anthropic.serviceis on the list now, and the script's paths follow${HOME}instead of a hard-coded home. - The deployed Go path keeps its Z.ai injection. Moving the Go units from
zen/go/v1toinference/go/openai/v1would have silently disabled F12 (Z.ai Preserved Thinking) on that lane:isZAiReachableBase()matched only paths starting/zen/go. It now matches/inference/goas well, and a test pins the deployed base instead of only the legacy one. - The package boundary matches the units.
package.jsonfilesnow shipsproxy/proxy.cjsand the three new unit files, so an npm install contains the exec target and every unit it advertises. - The other docs followed.
AGENTS.mdnow lists all six units, the 3458 chat + Responses upstream, the separate 3463 Anthropic unit and the current 214-assertion suite;proxy/proxy.js's start log reports 4.0.4 instead of 3.2.0, and its header comment no longer pointsUPSTREAM_URLatzen/go/v1. The Anthropic- and OpenAI-wire proxies stay separate binaries-by-configuration: sameproxy.js, two units, becausezen/go/v1/messagesanswers401 Go requires a credential. - README: the "two-proxy" section became the five-port table, and the Go examples no longer suggest
zen/go/v1asUPSTREAM_URL(it serves chat only; the Anthropic wire answers401 Go requires a credentialthere).
v4.0.3
- The install docs lead with the V2 config key. OpenCode v2 registers plugins under
"plugins"; the README still opened with the v1"plugin"array and only mentioned"plugins"further down, which is the wrong way round for a V2 plugin. Quick install, manual config and the manual-copy note now show"plugins"first and keep"plugin"for v1.18.29+. - CI tolerates the npm 12
npm pack --jsonshape. npm 12 prints a map keyed by package name instead of an array, so the package-boundary check readundefinedand crashed on a newer runner. It now accepts both shapes, and the obsolete one-offdist-tag-cleanup.ymlworkflow is gone. - Release history is complete again. The repository had no GitHub releases for 4.0.1 and 4.0.2, so its "latest release" still pointed at 4.0.0 while npm served 4.0.2. Both are published now, and 4.0.3 is the latest in both places.
npm install opencode-thinking-fix@4.0.3v4.0.2
- Node 24 is the supported runtime.
engines.nodeis now>=24(was>=18) and@types/nodemoved from^18to^24, so the published package advertises the runtime it is actually built and tested against instead of one three majors behind. - New Zen free-tier routes in
proxy/core.js:step-5-preview-free,muse-spark-1.3-contributor-free,beam-free,deepseek-v4.1-flash-free,glm-5.3-flash-free,longcat-2.5-preview-free,mimo-v2.6-flash-free,nemotron-3.5-super-vl-freeandspace-bunny-free, plus theiropencode/-prefixed twins — all on thezen/v1lane withreasoning_contentas the passback key. - The watchdog drives systemd instead of spawning processes.
watchdog/watchdog.shhealth-checks ports 3457/3458/3459/3462 and restarts the unit that owns the port, rather thannohup node-ing a second copy on top of a running service. proxy/proxy.cjs— the CommonJS shim the installed systemd units execute — is now tracked in the repository.
npm install opencode-thinking-fix@4.0.2v4.0.1
- CI: the deprecated-action warning is gone.
actions/checkoutandactions/setup-nodemoved from@v4— published against the Node 20 actions runtime, which GitHub-hosted runners now force onto Node 24 and warn about on every step — to@v7. The build and test jobs now run on Node 24 rather than 22, and all three jobs use thenpmcache. - Publishing is idempotent. A re-run of a tag, or a version already pushed by hand, made
npm publishfail withE403 You cannot publish over the previously published versions— which is exactly how thev4.0.0tag run went red while 4.0.0 was already on the registry. Both publish jobs now checknpm view <name>@<version>first and exit successfully when the version is already out, so a re-run reports the truth instead of a false failure. - Preflight failures name the real problem. npm answers a missing or read-only token with a bare
404 Not Found - PUT, which reads like a missing package. The npm job now checks thatNPM_TOKENis non-empty, thatnpm whoamiauthenticates, and that the tag matchespackage.json's version before it publishes. - After publishing, the npm job downloads the tarball the registry actually serves and asserts
proxy/core.js, the plugin entrypoint andpackage.jsonare inside it. - Workflow-level
permissions: contents: read,concurrency(publishing is never cancelled half-way), pinnedubuntu-24.04runners andworkflow_dispatchfor re-publishing without a new commit.
npm install opencode-thinking-fix@4.0.1v4.0.0
- OpenCode V2 plugin API. The package now depends on
@opencode/pluginand default-exportsPlugin.define({ id: "opencode-thinking-fix", setup }), so it can be installed from the V2 catalog. The V1 implementation is kept on the same default export asserver()(OpenCode >= 1.18.29), andThinkingFixPluginremains a named export. - V2 hooks:
ctx.session.hook("model.request")addsx-session-id;ctx.session.hook("context")injects the reasoning passback field on assistant turns vianative.openaiCompatible.reasoning_content. V2's OpenAI Chat protocol maps that carrier to the model's configured reasoning field (reasoning_contentorreasoning), and already emits an empty field natively for DeepSeek-required models. @opencode-ai/pluginis no longer a peer dependency; the V1 hook shapes are typed locally so the package has no V1 runtime import.- Version is a major bump because the entrypoint shape changed. OpenCode 1.x users below 1.18.29 should stay on 3.x.
proof with logger catching dropped reasoning
README evidence section reframed: the "See it happen in 5 minutes" anchor on a single free-tier model id is gone, replaced with a generic 4-step reproduction and a dataset-first section that leads with the 2.29M char / 1,968 drops / 22-OpenRouter-drops / 68% zero-model-change numbers. "The evidence" section kept for the SDK-is-innocent and switches.csv pointers so nothing is lost.
v3.2.0
Audit-hardened v3.2.0 — already deployed live and md5-verified. First clean repo-hygiene publish: test suite, CHANGELOG history, ADR-0002, and AGENTS.md (with Windows setup) are now in the repo.
Reasoning-key routing (v3.2 invariants)
reasoningKeysemantics:'strip'= DeepSeek-R1 (active removal, no cache);null= true passthrough (Qwen/GPT/Claude/unknown); other strings = cache + inject that field only.- F11: glm-5.2 on OpenCode-Go
/chat/completionsnow injectsreasoning_content(fixes HTTP 400; live-verified).
Proxy hardening
- F1: multibyte-safe SSE decoding (
StringDecoder). - F2/F3: hop-by-hop header strip;
x-session-idno longer forwarded upstream. - F4: oversized reasoning skipped (not truncated); store stats gated on actual write.
- F6: MiniMax
reasoning_detailsshape behind a defensive flag (3457-only). - F9/F10: Kimi sampling-param strip +
reasoning_splitgated to model-routing mode. - Option C: derived session keys (header wins); plugin optional.
Published
- Test suite: 95 proxy assertions + L7 MiniMax replay script + 12 plugin tests.
- CHANGELOG 3.1.0–3.1.4 correction history; ADR-0002 (deferred wire-split rationale); AGENTS.md.
Public copy rebranded to reasoning-preservation framing; the historical 400-error symptom is retained only as a deprecated note.