FE-1345: Bump @earendil-works/pi-coding-agent to 0.84.1 to clear its bundled shrinkwrap advisories - #422
FE-1345: Bump @earendil-works/pi-coding-agent to 0.84.1 to clear its bundled shrinkwrap advisories#422claude[bot] wants to merge 2 commits into
Conversation
…bundled shrinkwrap advisories pi-coding-agent ships an npm-shrinkwrap, so its dependencies resolve under node_modules/@earendil-works/pi-coding-agent/node_modules and root overrides cannot reach them. At 0.79.8 that subtree held brace-expansion 5.0.6, protobufjs 7.6.4 and undici 8.5.0 — nine open advisories between them. The parent version is the only lever; 0.84.1 is the first release whose shrinkwrap clears all three (5.0.9 / 7.6.5 / 8.9.0). pi 0.80.8 removed the AuthStorage export and replaced the authStorage and modelRegistry session options with a single async modelRuntime, so the cook agent's auth wiring moves to ModelRuntime.create(). modelsPath: null and refreshOnCreate: false reproduce the built-ins-only, no-network behaviour of the old ModelRegistry.inMemory path. Also bumps the root protobufjs override off its stale 7.6.4 pin. Nothing in the tree resolves through it today, so the lockfile is unchanged by that edit, but leaving an exact pin on a vulnerable version is a trap for the next resolve. Closes GHSA-3jxr-9vmj-r5cp, GHSA-mh99-v99m-4gvg, GHSA-rgw5-rvv9-x895, GHSA-4cwx-7wf7-3272, GHSA-8xcm-r25x-g524, GHSA-jr45-8vmc-qm54, GHSA-m8rv-5g2x-5cg5, GHSA-v3r7-h72x-cjcm and GHSA-j3f2-48v5-ccww.
PR SummaryMedium Risk Overview
Reviewed by Cursor Bugbot for commit 18d6a3e. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 6feeab0. Configure here.
…e call Cursor Bugbot flagged `refreshOnCreate` as a non-existent option. It does exist (CreateModelRuntimeOptions declares it, and create() reads `options.refreshOnCreate !== false`, so passing false actively skips the initial refresh the default would run), but the finding was right that `allowModelNetwork` is the create-time network gate and that the comment attributed the offline behaviour to the wrong option. Pass allowModelNetwork: false explicitly rather than relying on its default, and describe what each of the three options actually does.
TimDiekmann
left a comment
There was a problem hiding this comment.
@hashintel/frontend to look at this before merging please.

Requested by Tim Diekmann · Slack thread
Nine of brunch's thirty findings in the 2026-08-10 scan live in one place. This clears all nine — but it is not a version-only bump, and the part worth reviewing is the code change, not the lockfile.
Before
@earendil-works/pi-coding-agentships an npm-shrinkwrap, so its dependencies resolve intonode_modules/@earendil-works/pi-coding-agent/node_modules/and are pinned by that file. Rootoverridescannot reach inside a dependency's own shrinkwrap. At 0.79.8 that subtree held:brace-expansionundiciprotobufjsThe 2026-08-03 run recorded the
brace-expansioncopy as "unfixable locally". It is fixable — just not by an override. The parent version is the only lever.After
0.84.1, whose shrinkwrap carries
brace-expansion5.0.9,protobufjs7.6.5 andundici8.9.0. All nine advisories close.0.82.1, which the Renovate dashboard (#407) offers, is not enough: it still ships
brace-expansion5.0.7 (open for GHSA-mh99 and GHSA-rgw5) andundici8.5.0 (open for all five). Shrinkwraps read out of the published tarballs:brace-expansionprotobufjsundici0.84.0 is the first release that clears all three; 0.84.1 is latest.
The code change — please read this bit
pi 0.80.8 removed the
AuthStorageexport and replaced theauthStorage+modelRegistrysession options with a single asyncmodelRuntime. Five minors of the agent SDK cannot be crossed without migrating the cook agent's auth wiring, sosrc/orchestrator/src/pi-actions.tsmoves from:AuthStorage.create(path)→setRuntimeApiKey→ModelRegistry.inMemory(authStorage)→find(...)to:
ModelRuntime.create({ authPath, modelsPath: null, refreshOnCreate: false })→await setRuntimeApiKey→getModel(...)modelsPath: null,allowModelNetwork: falseandrefreshOnCreate: falseare what reproduce the oldModelRegistry.inMemorybehaviour: built-in models only, nomodels.json, no I/O at construction time.allowModelNetwork: falseis already the default — it is stated explicitly so an upstream default flip cannot quietly put a network call on this path — whilerefreshOnCreate: falseis load-bearing, sincecreate()runs an initial catalog/availability refresh unless it is passed exactlyfalse. Behaviour is otherwise meant to be identical — same isolatedauth.jsonpath, sameANTHROPIC_API_KEYsource, same "model not found" error branch.This path has no unit-test coverage (it needs a real API key), so I exercised it directly instead:
ModelRuntime.createwith those options resolvesanthropic/claude-opus-4-8from built-ins offline,setRuntimeApiKeystores the key andgetAuth('anthropic')returns it, and an unknown model id still comes backundefinedso the existing throw still fires. That is a mechanical check, not a real agent run — a live cook run before merge is the thing I'd most want a second pair of eyes on.Also in the 0.80.x–0.84.x range but not obviously reaching brunch: the harness session model was replaced with pi-agent-core's v4 lane-based API, and
message_updatenow emits onlyassistantMessageEventdeltas (the cumulativemessagefield is gone). brunch already consumes the delta form, and the suite passes.Also: the stale protobufjs override
package.jsonpinnedoverrides.protobufjsto 7.6.4 — the vulnerable version. Nothing in the tree resolves through it today, so the lockfile is unchanged by this edit, but leaving an exact pin on a vulnerable version is a trap for the next resolve that does hit it. Bumped to 7.6.5.This is what #409 was trying to do. That PR is ineffective and I'd suggest closing it: it bumps the same root override, but its
package-lock.jsondiff only adds two"dev": truemarkers and does not moveprotobufjsat all — the nested 7.6.4 survives, because a root override cannot reach into the shrinkwrap. Its gone-check fails. This PR is the fix.Gone-check
Confirmed absent from
package-lock.jsonafter the change — 0 occurrences each ofbrace-expansion-5.0.6,protobufjs-7.6.4,undici-8.5.0. Each entry is replaced in place, not added alongside a survivor.Re-running the full lockfile through npm's bulk advisory endpoint before and after: 11 advisory rows removed, 0 added. The pi bump brings in four new nested packages (
grok-mermaid,pi-client,pi-protocol,pi-telemetry) and none of them carries an advisory.Still open afterwards and covered elsewhere:
dompurify(#418),hono(#408),mermaid(#417),nanoid(#419/#420), andundici7.28.0 viarelease-it(separate PR).Verification
npm run verify—checkclean (0 errors, 11 pre-existing warnings, same asmain),buildpasses.test: the 3 known failures (sandbox-guard.test.ts×2,petrinaut-events.test.ts×1) which reproduce on unmodifiedmainin this container — bwrap-sensitive, unrelated. A handful of other files timed out at 5s under load during the full run and all pass when re-run on their own;pi-actions.test.tsitself passes.brunch has no lint/test/build workflow in CI, so the green checks on this PR say nothing about tests — the runs above are the real gate.
Linear: FE-1345