headroom/plugins/opencode/src
Tejas Chopra 01f86665e5 fix(opencode): don't preload a missing transport shim into child processes
The wrap transport plugin appended
`NODE_OPTIONS=--import=<plugin dir>/../hook-shim/handler.js` to its own env
and to every child it spawns. That path only resolves in a repo checkout
(`plugins/opencode/dist/` has a `hook-shim/` sibling). Wheel installs load
the standalone bundle from `headroom/providers/opencode/_dist/`, where no
shim exists — `hook-shim/` lives under `plugins/` and maturin only ships
files under `headroom/`.

Every Node child then aborted with ERR_MODULE_NOT_FOUND before running,
including OpenCode's stdio MCP servers, which surfaced as
`<server> MCP error -32000: Connection closed` for third-party servers
(codegraph, firecrawl) while Headroom's own Python MCP server stayed up.

Resolve the shim only when it is present on disk, and skip the NODE_OPTIONS
mutation otherwise: children go direct instead of dying. Checkout builds keep
child-process transport hooking unchanged.
2026-08-05 11:42:17 -07:00
..
entry.opencode.ts fix(opencode): route native providers + load transport plugin, fix Serena context (#1573) 2026-06-29 15:04:56 -07:00
index.ts feat: headroom wrap opencode / unwrap opencode CLI (#1105) 2026-06-22 11:07:12 -05:00
plugin.test.ts fix(ccr): make headroom_retrieve a hash-only full-content lookup (#1532) 2026-06-28 10:32:43 -07:00
plugin.ts fix(ccr): make headroom_retrieve a hash-only full-content lookup (#1532) 2026-06-28 10:32:43 -07:00
provider.ts fix(opencode): expose headroom/* models in injected provider config (#1716) 2026-07-03 15:20:14 -07:00
retrieve.ts docs(ccr): correct stale 5-minute TTL hints to 30 minutes (#2224) 2026-07-15 18:15:53 +00:00
transport.test.ts fix(opencode): don't preload a missing transport shim into child processes 2026-08-05 11:42:17 -07:00
transport.ts fix(opencode): don't preload a missing transport shim into child processes 2026-08-05 11:42:17 -07:00