Repository navigation
fix: leave tesseract.js out of the packaged services and drop an ignored Codex MCP key - #228
Merged
Merged
Conversation
The managed Codex home set experimental_use_rmcp_client = true on every HTTP MCP server. Current Codex always uses its streamable HTTP client, ignores the key and warns about it on every app-server start. Each projection replaces the whole mcp_servers table, so configs written before drop the key on the next start. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
officeparser declares tesseract.js as a dependency, so the packaged Node Services runtime copied it and its wasm (about 45 MB unpacked) for every platform. The macOS app has it unpacked; Linux and Windows have it inside runtime.tar.zst, where a search of the package folder does not see it. officeparser imports it only when a parse asks for OCR, and document extraction always passes ocr: false, so the runtime build now skips it and everything only it needs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Approve (0 findings)
Scope: base main, merge-base cb4c8b67 (branch is up to date with main); 2 commits, 6 files reviewed. Helper skills loaded: coderbook; ponytail-review and karpathy-guidelines were not loaded, and their checklists were applied from the review instructions. Ran in a separate session.
Findings
None.
Verified as fine
- Codex MCP key (
codex_home_config.go:198): the only change is thatexperimental_use_rmcp_clientis no longer written.git grepfinds no other reference to the key in the repo. The managed projection rewrites the wholemcp_serverstable on every start, so aconfig.tomlwritten by 0.1.3 loses the key the next time it is projected. No migration is needed, as the PR says. The test now checkslen(remote) != 2(onlyurlandhttp_headers), so a stray key fails it. - tesseract.js exclusion (
build-native-runtime.mjs:115,172):- The skip happens at the top of
visit, so tesseract.js's own dependencies are never visited from that path. - A package that tesseract.js shares with another root (for example
node-fetch) is still copied when that other root visits it. - Using a separate set instead of the existing
excludecallback is correct:excludelists packages inexcludedand feedsmodels.json(modelPackageGroup). Routing tesseract.js through it would advertise the package as a downloadable model package. - The only
officeparsercaller,document-office-extract.ts:73-77, passesocr: false. officeparser is an esbuild external (bundle-node-services.mjs:30), so the bundle carries no static tesseract import.
- The skip happens at the top of
- Test:
build-native-runtime.test.tsbuilds a hoisted tree and asserts that tesseract.js, tesseract.js-core and its only-usednode-fetchare absent whilepdfjs-distis kept. Without the fix the test fails. The new.d.mtsfollows the existing pattern (build-teamhub.d.mts,stage-computer-tools.d.mts) for importing.mjsscripts from typed tests. - Docs:
docs/desktop-release.mddescribes the new packaging behavior. - PR description: every claim matches the diff. Each change removes a few lines, and nothing unrelated rides along.
- Security and dependencies: no manifest or lockfile change.
pnpm-workspace.yamlalready setstesseract.js: falsefor build scripts.
Process notes
- No merge commits and no fixup commits. Both commits are atomic and their authors are linked to a GitHub account.
CI
All checks that ran pass: check (computer-go), check (desktop), check (web), repository-gate, changes, CodeQL. The other checks were skipped by path filtering. I ran no tests locally; the Go change has no concurrency impact, so a -race run was not needed.
Automated review by Claude Code
Automated review of ea0fe8e by Claude Code.
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.
Two small 0.1.4 cleanups from the 0.1.3 triage: P2-12 (GitHub #184) and P2-13 (GitHub #185). P2-15 (#187, the release test map) needs no repository change, because the repo keeps no test map. The corrected 0.1.4 map lives outside the repo with the 0.1.4 fix list.
Summary
P2-13: the managed Codex config writes a key Codex ignores (
apps/computer/local-daemon/internal/provider/native/codex_home_config.go:201)codexProjectServer(server) # every HTTP MCP server (browser, computer, …) drop type, headers → http_headers - experimental_use_rmcp_client = true # Codex 0.169 ignores it and warns on every app-server startEach projection replaces the whole
mcp_serverstable, so a config.toml written by 0.1.3 loses the key on the next start. No migration is needed.P2-12: the packaged services ship tesseract.js (
apps/desktop/scripts/build-native-runtime.mjs)copyExternals(deployed, output, roots) # copy each external package and its dependencies visit(name) + skip UNLOADED_PACKAGES (tesseract.js) and everything only it needsofficeparser 8.2.0 declares
tesseract.jsas a dependency, but imports it lazily (ocrUtils.js:395) only when a parse asks for OCR.document-office-extract.tsalways passesocr: false.The issue said only macOS was affected, but every platform ships it. The 0.1.3 Linux
runtime.tar.zstholds 107 tesseract entries. The searches that found "0 files" on Linux and Windows did not look inside that archive. Windows builds the same archive the same way. Development is unchanged:pnpm installstill installs the package and still does not run its build script.Evidence
TestCodexManagedProjectionnow asserts that the projected HTTP server holds onlyurlandhttp_headers.Before: fails with
projected = …experimental_use_rmcp_client = true….After:
go test ./internal/provider/nativepasses.apps/desktop/src/main/build-native-runtime.test.tsbuilds a hoisted node_modules withofficeparser → {pdfjs-dist, tesseract.js → {tesseract.js-core, node-fetch}}.Before:
copyExternalsalso returnstesseract.jsandtesseract.js-core.After: it returns only officeparser and pdfjs-dist, and nothing tesseract-related is in the output.
pnpm deploy --prod --config.node-linker=hoistedfor linux-x64, thencopyExternals(["officeparser","word-extractor","pdfjs-dist"]). It wrote 0 files matching tesseract or traineddata, and it dropped about 45 MB (the unpacked size of tesseract.js plus tesseract.js-core). Node then imported officeparser from that output and turned a .docx into Markdown ("Hello from the pruned runtime").make check BASE=origin/mainran check-repository, check-docs, check-desktop, check-scripts-fast, check-node-services and check-computer. The repository gate also ran.Real-machine checks for the 0.1.4 RC (FIXLIST section 6)
The macOS checks are in section 6, item 7 (smoke, package listing). The Linux and Windows checks are added because of what this PR found.
Linger.app/Contents/Resourcesfor files named*tesseract*or*traineddata*(case-insensitive). Expect 0; 0.1.3 had 26.resources/app/dist/installer/native/runtime-<target>/runtime.tar.zst(zstd, then tar). Expect no entry matching tesseract or traineddata; the 0.1.3 Linux archive had 107. Note the package size against 0.1.3 (about 45 MB smaller unpacked).experimental_use_rmcp_client, and the browser and computer MCP tools still work. Check the managedconfig.tomlunder the Codex home: itsmcp_servers.*tables no longer contain the key.Merge Danger
Door: two-way
Both changes are small subtractions. Revert either commit to restore the old behavior.
Blast Radius: packaging
If some code path loaded tesseract.js, it would fail with a module-not-found error at that point. The only importer is officeparser's OCR path, which Linger never enables. If an older Codex still needed the key to use HTTP MCP, its browser and computer tools would stop working. The pinned Codex 0.150.1 binary and the 0.170.0 binary do not contain the string
experimental_use_rmcp_clientat all, so neither reads the key. With the key in config.toml, both list the HTTP server as enabled. No open PR (#213, #222, #223, #224, or localmodels !540) touches these files.🤖 Generated with Claude Code