Skip to content

fix: leave tesseract.js out of the packaged services and drop an ignored Codex MCP key - #228

Merged
oldwinter53 merged 2 commits into
mainfrom
oldwinter/014-g
Nov 19, 2026
Merged

oldwinter53 merged 2 commits into
mainfrom
oldwinter/014-g

Conversation

@oldwinter53

Copy link
Copy Markdown

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 start

Each projection replaces the whole mcp_servers table, 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 needs

officeparser 8.2.0 declares tesseract.js as a dependency, but imports it lazily (ocrUtils.js:395) only when a parse asks for OCR. document-office-extract.ts always passes ocr: false.

The issue said only macOS was affected, but every platform ships it. The 0.1.3 Linux runtime.tar.zst holds 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 install still installs the package and still does not run its build script.

Evidence

  • P2-13 test: TestCodexManagedProjection now asserts that the projected HTTP server holds only url and http_headers.
    Before: fails with projected = …experimental_use_rmcp_client = true….
    After: go test ./internal/provider/native passes.
  • P2-12 test: apps/desktop/src/main/build-native-runtime.test.ts builds a hoisted node_modules with officeparser → {pdfjs-dist, tesseract.js → {tesseract.js-core, node-fetch}}.
    Before: copyExternals also returns tesseract.js and tesseract.js-core.
    After: it returns only officeparser and pdfjs-dist, and nothing tesseract-related is in the output.
  • P2-12 with a real deploy: I ran pnpm deploy --prod --config.node-linker=hoisted for linux-x64, then copyExternals(["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").
  • Fast checks: make check BASE=origin/main ran 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.

  1. macOS: mount the 0.1.4 DMG and search Linger.app/Contents/Resources for files named *tesseract* or *traineddata* (case-insensitive). Expect 0; 0.1.3 had 26.
  2. Linux and Windows: extract the package and list 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).
  3. All platforms, as part of the CHAT-10 attachment check: attach a .docx and a .pptx in chat. The Agent reads both, which confirms officeparser runs without tesseract.js.
  4. Linux, as part of section 6 Linux item 2 (Codex without a Secret Service): after a Codex chat, the Codex app-server output has no "unrecognized configuration settings" warning about experimental_use_rmcp_client, and the browser and computer MCP tools still work. Check the managed config.toml under the Codex home: its mcp_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_client at 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

oldwinter90 and others added 2 commits November 18, 2026 22:33
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>

@linger-review linger-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 that experimental_use_rmcp_client is no longer written. git grep finds no other reference to the key in the repo. The managed projection rewrites the whole mcp_servers table on every start, so a config.toml written by 0.1.3 loses the key the next time it is projected. No migration is needed, as the PR says. The test now checks len(remote) != 2 (only url and http_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 exclude callback is correct: exclude lists packages in excluded and feeds models.json (modelPackageGroup). Routing tesseract.js through it would advertise the package as a downloadable model package.
    • The only officeparser caller, document-office-extract.ts:73-77, passes ocr: false. officeparser is an esbuild external (bundle-node-services.mjs:30), so the bundle carries no static tesseract import.
  • Test: build-native-runtime.test.ts builds a hoisted tree and asserts that tesseract.js, tesseract.js-core and its only-used node-fetch are absent while pdfjs-dist is kept. Without the fix the test fails. The new .d.mts follows the existing pattern (build-teamhub.d.mts, stage-computer-tools.d.mts) for importing .mjs scripts from typed tests.
  • Docs: docs/desktop-release.md describes 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.yaml already sets tesseract.js: false for 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.

@oldwinter53
oldwinter53 added this pull request to the merge queue Nov 19, 2026
Merged via the queue into main with commit 679bb2a Nov 19, 2026
14 checks passed
@oldwinter53
oldwinter53 deleted the oldwinter/014-g branch November 19, 2026 02:55
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