Replies: 1 comment
|
Verified against master Source confirmation ( packages:
- .
nodeLinker: hoisted
autoInstallPeers: falsewith the design comment above it: the hoisted linker gives out-of-tree plugins a flat node_modules whose missing peers fall through to the healed On glob vs explicit list: I'd take the On healing existing profiles — this is the one part with a real wrinkle: Worth a proper thread/upstream note since it's a small, self-contained change to |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Symptom
Running a plugin install on a profile emits noisy pnpm warnings that are misleading:
The same command for
dshmarket(or for these peers in a different install order) stays quiet. Both plugins then work normally.Finding: the peers are not actually missing
The peers pnpm flags (
@deepseek-ai/cordis,@deepseek-ai/dsh-web,@deepseek-ai/dsh-launch-environment, and fordshmarketalso@deepseek-ai/dsh-settingsand@deepseek-ai/schemastery) all resolve fine at runtime. They are provided by the shared installation fallback at$DSH_HOME/profiles/node_modules, which Node resolves through its ordinary parent-walk when a plugin is loaded from$DSH_HOME/profiles/<profile>/node_modules.Verified: every one of those packages is present in
$DSH_HOME/profiles/node_modules/@deepseek-ai/, and both plugins load and function after the warning.Root cause
The warning is a false positive produced by two interacting facts:
The profile's
pnpm-workspace.yamlis generated automatically byinitProfile(packages/app-boot/src/profile.ts) and setsautoInstallPeers: falsewithnodeLinker: hoisted. WithautoInstallPeers: false, pnpm does not install peer dependencies and instead reports them as missing.The shared fallback
$DSH_HOME/profiles/node_moduleslives outside the profile's pnpm workspace (the workspace ispackages: ['.']), so pnpm's install-time peer graph cannot see it. pnpm stops at the workspace root and reports the peers as absent, even though Node finds them at runtime.The design intent (see the comment in profile.ts) is that every plugin shares the installation's single cordis instance rather than a duplicate copy. Keeping
autoInstallPeers: falseis what preserves that; the warning is the side effect of pnpm being unable to see the fallback that makes the design work.Note on the inconsistent behavior: in an isolated install both
dshmarketand@deepseek-ai/dsh-web-search-exawarn. Whether a givendsh plugin addprints the warning depends on the transient pnpm store/graph state at that moment (what is already cached and linked), which varies by install order and pnpm version. Neither case indicates a real problem.Why this is a "trick" and why it bothers users
The current approach relies on
autoInstallPeers: false+ silent runtime parent-walk: pnpm is put into a state where it reports peers as missing that are in fact present, anddsh plugin addis a thin forwarder (spawnSync("pnpm", args, {stdio: "inherit"})) that relays that output verbatim. The peers resolve correctly, but pnpm is misled and the user is handed a warning that looks like a broken install.Suggested fix (verified)
pnpm has a first-class, honest setting for exactly this:
peerDependencyRules.ignoreMissing. Add it topnpm-workspace.yaml:Or, to cover the whole harness scope in one line:
I tested this against pnpm v12.3.4 (the version the profile uses). With it set:
pnpm installprints no[WARN]line.pnpm peers checkreports "No peer dependency issues found."autoInstallPeers: falseis kept, so no duplicate cordis is installed and the single-instance invariant is preserved.This replaces a covert state with an explicit declaration of intent ("these harness peers are provided by the shared fallback, not by pnpm"), which is both more correct and easier to understand.
Open questions for the maintainers
"@deepseek-ai/*") vs. an explicit list. The glob is future-proof and one line, but it suppresses missing-peer warnings for any@deepseek-aipeer. In the harness's controlled design every harness peer resolves via the fallback, so nothing real is masked; an explicit list is more precise but must be maintained as the peer set grows.pnpm-workspace.yamlon first use, so they would need a manual edit or a one-time regen to pick up the new block. ShouldinitProfilealso heal existing profiles?All reactions