Repository navigation
fix(ports): stop joining an undefined resourcesPath on a non-Electron host - #16370
Merged
nwparker merged 1 commit intoAug 25, 2026
Merged
Conversation
nwparker
force-pushed
the
nwparker/orcad-item1-honesty
branch
from
August 25, 2026 05:22
96506e0 to
6b26520
Compare
… host `resolveWorkerEntryPath` branched on `isPackaged` alone and joined `process.resourcesPath`. orcad reports `isPackaged` true — correctly, it is a production build, and ~15 consumers read it that way to gate HTTPS-only skill downloads and the real CLI name — but `process.resourcesPath` is Electron-only and `undefined` under plain Node. So the packaged branch threw `TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string` where a clean "worker unavailable" was the honest outcome. The type said `resourcesPath: string`, which is how it went unnoticed; it is now `string | undefined`, so the compiler carries the fact. A host with no Electron resources tree has no asar to look in, so it falls back to the module directory and lets the caller report a missing worker. Found by the item 1 agent while auditing the same `isPackaged` defect class in the watcher. Verified in both directions: reverting the guard reproduces the TypeError.
nwparker
force-pushed
the
nwparker/orcad-item2-declare-gaps
branch
from
August 25, 2026 05:22
6f13689 to
22a5070
Compare
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.
Plan item 2's remainder, stacked on #16369. A live crash path in the shipped
orcadbundle.The bug
resolveWorkerEntryPathbranched onisPackagedalone and joinedprocess.resourcesPath:orcadreportsisPackagedtrue — correctly; it is a production build, and ~15 consumers read it that way to gate HTTPS-only skill downloads and the real CLI name. Butprocess.resourcesPathis Electron-only andundefinedunder plain Node, and the worker entry name is in the orcad bundle.So the packaged branch threw:
where a clean "worker unavailable" was the honest outcome. A crash, not a degradation.
Why it hid
The type said
resourcesPath: string. It is nowstring | undefined, so the compiler carries the fact rather than a comment asserting it.A host with no Electron resources tree has no asar to look in, so it falls back to the module directory and lets the caller report a missing worker.
Provenance
Found by the item 1 agent while auditing the same
isPackageddefect class that broke the watcher — it flagged this one as worse, because it throws rather than degrades. Correct call.It also flagged two siblings I am not fixing here:
ai-vault/session-scanner-service-entry-path.tsandcomputer/sidecar-client.tscarry the same!isPackagedgate and are in the bundle, but neither child is shipped in any orcad layout, so correcting their paths only relocates the failure. Those are declare-the-gap material, not path fixes.Proof
Verified in both directions — reverting the guard reproduces the exact TypeError:
Ratchet 0,
build-orcadgreen (incl. the plain-Node smoke-load),smoke:orcad-terminalpasses, typecheck and lint clean.Trade-offs
Zero user-facing. The desktop path is unchanged: with a real Electron resources tree,
layout.resourcesPathis truthy and the asar branch is taken exactly as before.