Repository navigation
fix(deps): migrate pi to maintained secure packages - #500
Sun-sunshine06 merged 14 commits into
Conversation
Bumps [@mariozechner/pi-agent-core](https://github.com/badlogic/pi-mono/tree/HEAD/packages/agent) from 0.72.1 to 0.73.1. - [Release notes](https://github.com/badlogic/pi-mono/releases) - [Changelog](https://github.com/earendil-works/pi/blob/main/packages/agent/CHANGELOG.md) - [Commits](https://github.com/badlogic/pi-mono/commits/v0.73.1/packages/agent) --- updated-dependencies: - dependency-name: "@mariozechner/pi-agent-core" dependency-version: 0.73.1 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Sun-sunshine06 <Sun-sunshine06@users.noreply.github.com>
Signed-off-by: Sun-sunshine06 <Sun-sunshine06@users.noreply.github.com>
There was a problem hiding this comment.
Findings
No blocking, major, minor, or nit findings. The diff is a consistent, well-formed dependency alignment:
pi-agent-core,pi-ai, andpi-coding-agentare all moved to^0.73.1together acrossapps/desktop/package.json:31,packages/core/package.json:16, andpackages/providers/package.json:17, matching the changeset intent ("Keep the pi agent, model, and coding-agent packages on the same compatible version.).- The new
piDependabot group (.github/dependabot.yml:18) with pattern@mariozechner/pi-*will keep future bumps in lockstep. - The changeset covers all three packages that carry the dependency, and the lockfile dedupes cleanly (drops the
@mariozechner/jitifork in favor of upstreamjiti: 2.7.0, and foldsyaml@2.8.4into the already-resolvedyaml@2.9.0).
Summary
Review mode: initial
- No correctness, security, license, or constraint violations introduced.
@mariozechner/pi-*was already a bundled dependency, so this is a version bump, not a new license/size addition. - Residual observation (not blocking): the
@mariozechner/pi-*scope is marked deprecated in the lockfile in favor of@earendil-works/pi-*(pnpm-lock.yamldeprecated:notes on the 0.73.1 entries). Upstream states the rename is not yet published ("after the new package is published"), so staying on the current scope is correct here — consider a tracking issue to migrate when@earendil-works/pi-*ships. - Residual risk: upstream v0.73.0 lists a breaking change to the built-in
xiaomiprovider (endpoint switch, display rename, changedXIAOMI_API_KEYmeaning). This lives inside pi-ai and only matters if the app surfaces/configuresxiaomi; worth confirming it is not advertised in the provider list. - Version note:
0.72 -> 0.73is a minor bump on a0.xline and is effectively potentially breaking.packages/coreandpackages/providersbind directly to pi-ai / pi-coding-agent APIs, so this specifically needs a green typecheck + test run.
Testing
Not run (automation). Recommend CI run pnpm typecheck && pnpm test, and verify the provider connection-test / model-listing paths still work for at least one pi-backed provider given the direct type coupling in packages/core and packages/providers.
Open-CoDesign Bot
|
Dependabot tried to update this pull request, but something went wrong. We're looking into it, but in the meantime you can retry the update by commenting |
Signed-off-by: Sun-sunshine06 <Sun-sunshine06@users.noreply.github.com>
Signed-off-by: Sun-sunshine06 <Sun-sunshine06@users.noreply.github.com>
Signed-off-by: Sun-sunshine06 <Sun-sunshine06@users.noreply.github.com>
There was a problem hiding this comment.
Findings
-
[Minor]
undiciis now split across a major-version boundary between the app and the bundled pi runtime —apps/desktop/package.json:28still pinsundici: ^7.29.1(lockfile resolves7.29.1), while the newly bundled@earendil-works/pi-coding-agent@0.79.10declaresundici: 8.10.2(pnpm-lock.yaml, snapshot@earendil-works/pi-coding-agent@0.79.10).undiciis not inBUNDLED_RUNTIME_PACKAGES(apps/desktop/electron.vite.config.ts:19-29), so pi-coding-agent'sundiciimport is externalized inout/mainand resolves at runtime to the app's7.29.1, not8.10.2. This split is new: pi-ai0.72.1also declaredundici: 7.29.1, so the two matched before. Theundici@>=8.0.0 <8.10.2override (package.json:41) only rewrites 8.x resolutions and does not align the app's own pin.
Suggested fix / next action: bumpapps/desktoptoundici: ^8.10.2(keeping the override as the floor), or addundicitoBUNDLED_RUNTIME_PACKAGESso pi-coding-agent bundles the version it declares; then re-run the packaged build (pnpm --filter @open-codesign/desktop build:dir) to confirm the main-process bundle still loads. -
[Minor] PR title/body no longer match the diff, and the "no additional dependency or telemetry" statement is now inaccurate — the title says
0.73.1, while the manifests ask for^0.79.0and the lockfile resolves0.79.10; the body says Mistral SDK2.2.1is retained and that "No additional dependency or telemetry setup is introduced". The lockfile instead resolves@mistralai/mistralai@2.2.6(@opentelemetry/api@1.9.0)and adds@opentelemetry/api@1.9.0as a direct dependency of@earendil-works/pi-ai@0.79.10, plus@opentelemetry/semantic-conventions@1.43.0. Both are Apache-2.0 and, with no SDK/exporter registered, the OTel API surface alone does not transmit anything — so the hard constraint is not violated — but the claim as written will mislead a maintainer checking it against the project's BYOK / no-telemetry-by-default commitment (AGENTS.md).
Suggested fix: retitle to0.79.x/@earendil-worksand rewrite the dependency paragraph to state the actual resolved versions and that only the OTel API package is pulled in transitively (no SDK, no exporter, no network). -
[Nit]
renovate.json:18-20still groups only@earendil-works/pi-aiand@earendil-works/pi-coding-agent, so Renovate can still open a lone@earendil-works/pi-agent-corebump — the exact split-version breakage this PR is fixing. The new Dependabot group (.github/dependabot.yml:18-20) correctly covers all three via@earendil-works/pi-*.
Suggested fix: use"matchPackagePatterns": ["^@earendil-works/pi-"](or add@earendil-works/pi-agent-coretomatchPackageNames) so both bots keep the trio locked together. -
[Nit]
engines.nodeis now>=22.19.0(package.json:16) to matchundici@8.10.2and the new pi packages'engines, butCLAUDE.mddocuments Node as pinned via.nvmrc+enginesand.nvmrcis not touched in this diff.
Suggested fix: confirm.nvmrc(and anysetup-node/node-version-file: .nvmrcuse in CI) resolves to ≥22.19.0 so local and CI installs match the new floor.
Questions
- The rename appears complete across
packages/*,apps/desktop,README*,CLAUDE.md,website/architecture.md, andrenovate.json, but the old scope is now gone from every manifest. Can you confirm a repo-widerg '@mariozechner/pi-'returns no import specifiers left (for examplescripts/smoke-models.tsbehindpnpm smoke,CONTRIBUTING.md, or workflow files)? Files outside this diff could not be verified from the public checkout. - The changeset claims 0.79.x "fixes extension loading, credential-file, and HTML-export security issues". Those upstream release notes are not in the public repo, so this reviewer could not verify them; if they were checked against the published changelog, a one-line link would help future readers.
Summary
Review mode: follow-up after new commits
- The previous review's only residual item — staying on the deprecated
@mariozechner/pi-*scope — is resolved: the migration to@earendil-works/pi-*is consistent across all three packages, the Electron bundler config, the lockfile, and docs, and.github/prompts/codex-pr-review.mdwas reviewed as data (a benign one-line namespace rename matching the code, not an instruction change to act on). - The runtime change in
packages/core/src/agent.ts:1334-1350,1429-1490(turning the turn-boundary throw into a controlled halt, trackingagent_endper agent, and synthesizing the missingagent_endonly when pi bypasses it) is directionally correct and well-narrowed; the added negative test inpackages/core/src/agent.native-lifecycle.test.ts:494-509covers the "unrelated observer failure must propagate" case. Residual risk:turnBoundaryHaltis reused across attempts on the same wrapper and is reset only by reassignment, and the synthesized-agent_endbranch relies on existing repair-limit/tool-loop tests to exercise it — worth a targeted assertion that it fires exactly once. - No new direct prod dependencies, no new license concerns (
@opentelemetry/api/@opentelemetry/semantic-conventionsare Apache-2.0), and the merge-relevant items above are theundicisplit and the stale PR description.
Testing
Not run (automation). CI on this head should include pnpm typecheck && pnpm test plus a packaged main-process build, since packages/core binds directly to pi-agent-core / pi-coding-agent APIs and the undici resolution only fails at package/runtime time.
Open-CoDesign Bot
Signed-off-by: Sun-sunshine06 <Sun-sunshine06@users.noreply.github.com>
Signed-off-by: Sun-sunshine06 <Sun-sunshine06@users.noreply.github.com>
There was a problem hiding this comment.
Findings
- [Minor] Bundled
pi-coding-agentstill resolvesundicito the app's 7.x at runtime —apps/desktop/package.json:28pinsundici: ^7.29.1(lock resolves7.29.1), while@earendil-works/pi-coding-agent@0.79.10declaresundici: 8.10.2in its lockfile snapshot. Becauseundiciis a prod dependency ofapps/desktopand is not inBUNDLED_RUNTIME_PACKAGES(apps/desktop/electron.vite.config.ts:19-29), electron-vite externalizes it, so the bundled pi code calls the app's 7.29.1 rather than the 8.10.2 it was built against. The newundici@>=8.0.0 <8.10.2override (package.json:41) only rewrites 8.x resolutions and does not align the app's own pin. This is the one substantive item from the previous round that the new commits did not address.
Suggested fix / next action: bumpapps/desktoptoundici: ^8.10.2(keeping the override as a floor), or add'undici'toBUNDLED_RUNTIME_PACKAGESso pi bundles the version it declares; then runpnpm --filter @open-codesign/desktop build:dirand one smoke generation to confirm the main-process bundle still loads.
Summary
Review mode: follow-up after new commits
- The new commits fix a real hole from the previous round. Because
turnBoundaryHaltinitializes tonull, the earlierif (err !== turnBoundaryHalt) throw err;treated an observer that throwsnull(orundefined) as the controlled halt, swallowing it and fabricating anagent_endplus an "incomplete" result.packages/core/src/agent.ts:1476now guards withturnBoundaryHalt === null ||, andpackages/core/src/agent.native-lifecycle.test.ts:494-518extends coverage tonull/undefinedwhile asserting no terminal event is synthesized. Behavior for the genuine halt path (settle the native agent, complete the transcript, forward exactly one terminal event) is unchanged. - The previous round's main structural item is resolved: the
@earendil-works/pi-*migration is consistent across all three packages, the Electron bundler config, the lockfile, and docs;.github/prompts/codex-pr-review.mdwas reviewed as data (a benign one-line namespace rename), and the changeset plus the new Dependabot@earendil-works/pi-*group cover the trio. - Residual, non-blocking:
renovate.jsonstill groups only@earendil-works/pi-aiand@earendil-works/pi-coding-agent, so Renovate can still open a lonepi-agent-corebump (usematchPackagePatterns: ["^@earendil-works/pi-"]); the PR body still says Mistral SDK2.2.1is retained while the lock resolves@mistralai/mistralai@2.2.6(@opentelemetry/api@1.9.0)— the OTel API package alone has no SDK/exporter, so the no-telemetry constraint holds, but the description should state the resolved versions;.nvmrcis untouched whileengines.nodemoved to>=22.19.0— worth confirming the pinned dev Node meets it, though pnpm fails loudly on an engine mismatch rather than silently. - No new direct prod dependency and no license concern (Apache-2.0 OTel API only). Apart from the
undiciresolution gap above, this looks ready to merge.
Testing
Not run (automation). CI on this head should include pnpm typecheck && pnpm test plus pnpm --filter @open-codesign/desktop build:dir, since packages/core binds directly to pi-agent-core / pi-coding-agent and the undici resolution only surfaces at package/runtime time.
Open-CoDesign Bot
Signed-off-by: Sun-sunshine06 <Sun-sunshine06@users.noreply.github.com>
There was a problem hiding this comment.
Findings
No blocking, major, or minor findings on this head. The single Minor from the previous review — apps/desktop resolving undici to 7.x while bundled pi-coding-agent@0.79.10 expects 8.10.2, so electron-vite's externalized import 'undici' would load the wrong HTTP runtime — is resolved:
apps/desktop/package.json:28now pinsundici: "8.10.2".package.json:41keeps a scoped floor overrideundici@>=8.0.0 <8.10.2 → 8.10.2.apps/desktop/src/main/undici-runtime.test.ts:12-27asserts the app-resolved and nested-pi-resolvedundiciversions match, which fails on the prior 7.x/8.x mismatch and passes now — a genuine regression guard.
The packages/core/src/agent.ts controlled-halt change from the prior round (guard turnBoundaryHalt === null || err !== turnBoundaryHalt at agent.ts:1476, plus null/undefined observer-failure coverage in agent.native-lifecycle.test.ts:494-518) is unchanged and still correct: unrelated observer failures propagate, and only the exact internal halt synthesizes one terminal agent_end.
Residual observations (non-blocking, not merge blockers)
renovate.json:18still groups only@earendil-works/pi-aiand@earendil-works/pi-coding-agent, omittingpi-agent-core..github/dependabot.ymlnow covers the full@earendil-works/pi-*pattern, but if Renovate is the active bot it can still open a lonepi-agent-corebump and reintroduce the exact version skew this PR removes. Consider"matchPackagePatterns": ["^@earendil-works/pi-"].- The PR body says "Existing compatible Mistral SDK 2.2.1 is retained", but
pnpm-lock.yamlresolves@mistralai/mistralai@2.2.6(@opentelemetry/api@1.9.0). The OTel package present is the API-only package (no SDK/exporter), so the no-telemetry constraint holds; just align the description with the resolved versions. apps/desktop/src/main/undici-runtime.test.ts:29-50's second case only asserts that a plain-HTTPfetchsucceeds and that the dispatcher is swapped/restored; it does not prove nativefetchactually routes through the injected undici dispatcher (an HTTP request would succeed either way). The version-equality test above is the meaningful guard against the previous regression — treat the bridge case as supplementary.
Summary
Review mode: follow-up after new commits
The prior round's one substantive item (undici app-vs-pi mismatch) is fixed and now covered by a regression test, so I'm not re-filing it. The pi migration remains internally consistent across packages/core, packages/providers, apps/desktop/electron.vite.config.ts (bundled-package list + treeshake path), the lockfile snapshots, the docs, and the changeset. @opentelemetry/api is API-only, so the default-no-telemetry constraint is upheld, and no new direct prod dependency pushes the desktop list toward the 30-dep cap. Remaining items are consistency/description polish only; this looks ready to merge subject to fresh CI on this head.
Testing
Not run (automation). CI on this head should run pnpm typecheck && pnpm test plus pnpm --filter @open-codesign/desktop build:dir, since packages/core binds directly to pi-agent-core/pi-coding-agent and the undici resolution surface only shows up at package/runtime time (the new undici-runtime.test.ts exercises it at unit level but not in the packaged main bundle).
Open-CoDesign Bot
There was a problem hiding this comment.
Findings
No blocking, major, or minor findings on this head. The only substantive delta from the prior reviewed commit is the Undici 8.10.2 → 8.12.4 bump (apps/desktop/package.json:28, package.json:41, .changeset/align-pi-packages.md:7), and the existing version-equality regression test still guards the app-vs-pi runtime match (apps/desktop/src/main/undici-runtime.test.ts:12-27).
Residual observations
- The lockfile still contains an
undici@7.29.1entry while the scoped override only covers>=8.0.0 <8.12.4. I could not determine from the provided diff which importer pulls that 7.x copy; if it is dev/website-only, no action is needed. If it can reach the packaged main process, the override/test should cover it too.
Summary
Review mode: follow-up after new commits
The previous round's Undici mismatch is resolved at 8.12.4, and the changeset, package manifest, and lockfile agree on that version. The pi namespace migration remains consistent across source, patches, docs, and the bundled-package list. I found no new correctness, security, license, or constraint issue introduced by this head. The remaining item above is a verification gap, not a merge blocker.
Testing
Not run (automation). CI should run pnpm typecheck && pnpm test and pnpm --filter @open-codesign/desktop build:dir; the new undici-runtime.test.ts exercises the app/pi version match at unit level but not the packaged main bundle.
Open-CoDesign Bot
There was a problem hiding this comment.
Findings
No blocking, major, or minor findings on this head.
Residual observations
- The only delta since the previously reviewed commit is dev/test-tooling lockfile churn:
happy-dom20.9.0→21.0.4(packages/ui/package.json) andws8.20.0→8.22.2, which also pulls the transitivebuffer-image-size@0.6.4. These are test-only (happy-dom/wsdo not ship in the packaged main process), so no changeset is implied and the permissive-license rule for shipped deps is unaffected. CI will catch any happy-dom 21 behavior change inpackages/uitests. - The earlier
undici@7.29.1observation is now explainable from the lockfile: the 7.x copy is@electron/get's install-timeoptionalDependenciesentry (Electron binary downloader), not the packaged main process. The app external stays pinned atundici: 8.12.4(apps/desktop/package.json), andundici-runtime.test.tsstill asserts the app-vs-pi runtime match, so the residual is resolved as dev-only. - Verification gap I could not close from the diff:
package.jsonnow requiresnode >=22.19.0, but the diff does not touch.nvmrcor the CI workflows. If the pinned.nvmrc/CI Node is older than22.19.0, local dev and CI installs ofundici@8.12.4(engines>=22.19.0) will be inconsistent. Confirm those pins already meet the new floor; this is not a merge blocker.
Summary
Review mode: follow-up after new commits
The pi @earendil-works migration, the Undici 8.12.4 alignment, the >=8.0.0 <8.12.4 override, the Node >=22.19.0 engines bump, and the refreshed native-event patch remain internally consistent across manifests, lockfile, patches, and tests. The one prior residual (a stray undici@7.x) is confirmed to be dev-only Electron install tooling. I found nothing introduced by this head that should block merge; the only outstanding item is the .nvmrc/CI Node-floor check above, which is verification, not a code defect.
Testing
Not run (automation). CI should run pnpm typecheck && pnpm test and pnpm --filter @open-codesign/desktop build:dir; the new undici-runtime.test.ts covers the app/pi version match at unit level but not the packaged main bundle, and packages/ui tests cover the happy-dom 21 bump.
Open-CoDesign Bot
There was a problem hiding this comment.
Findings
No blocking, major, or minor findings on this head.
What the new commits changed
- The only delta since the last reviewed commit (
f9b612d) is a scoped 7.x security floor:package.json:43adds"undici@>=7.0.0 <7.30.1": "7.30.1", and the lockfile resolves the transitive@electron/getcopy from7.29.1→7.30.1(pnpm-lock.yamlundici@7.30.1). This closes the prior residual (the 7.x copy is install-time Electron tooling only, not the packaged main process) without touching the app external, which stays pinned atundici: 8.12.4(apps/desktop/package.json:29). The two overrides don't overlap —7.30.1is below the>=8.0.0 <8.12.4range and8.12.4is outside the 7.x range — so there's no override conflict.
Residual observations
- The
packages/core/src/agent.ts:1389-1544turn-boundary-halt handling was already in the previously reviewed commit. The object-identity guard (if (turnBoundaryHalt === null || err !== turnBoundaryHalt) throw err) correctly distinguishes the controlledCodesignErrorhalt from unrelated observer failures, and the synthesizedagent_endonly fires when pi bypassed it. This is covered by the unrelated-failure test case inagent.native-lifecycle.test.ts:494-513. No new concern here. - Node-floor verification I still cannot close from the diff:
package.json:16now requiresnode >=22.19.0, but.nvmrcand CI workflow Node pins are not touched by this PR. If those pins are below22.19.0,undici@8.12.4(engines>=22.19.0) will install with a warning but fail at runtime on the old interpreter. This is verification, not a code defect, and does not block merge — but confirm.nvmrc/CI already meet the new floor. - Pre-existing pattern carried forward:
patchedDependencieskeys@earendil-works/pi-ai@0.79.10while the manifests declare^0.79.0(package.json:57). If a future install resolves^0.79.0past0.79.10, the hosted-searchonNativeEventpatch silently stops applying. This is the same fragility the0.72.1pin had, so it is not introduced by this PR — worth a pinned/synced note inpatches/README.mdrather than a code change.
Summary
Review mode: follow-up after new commits
The pi @earendil-works migration, the Undici 8.12.4 alignment, the refreshed native-event/message-replay patch, and the new >=7.0.0 <7.30.1 security floor are internally consistent across manifests, lockfile, patches, and tests. The prior residual about the stray undici@7.x copy is now resolved by the new override. The only outstanding item is the .nvmrc/CI Node-floor check, which is verification rather than a defect. I found nothing introduced by this head that should block merge.
Testing
Not run (automation). CI should run pnpm typecheck && pnpm test and pnpm --filter @open-codesign/desktop build:dir. apps/desktop/src/main/undici-runtime.test.ts asserts app-vs-pi Undici version parity and dispatcher bridging at unit level, but not the packaged main bundle; the packages/core native-lifecycle tests cover the controlled-halt vs. unrelated-failure paths.
Open-CoDesign Bot
Migrate all three pi packages together to the maintained
@earendil-worksnamespace (0.79.10), preserving existing sessions, provider integration and native hosted web search. Integrate current main and refresh the native-event/message-replay patch against the new SDK. Keep the current monthly Dependabot groups and disabled Renovate configuration.Align the desktop and nested pi Undici runtime at 8.12.4 with a scoped 8.x security floor, addressing advisories affecting the earlier 8.10.2 pin. Require Node >=22.19.0. The transitive OpenTelemetry API packages do not add an SDK or exporter. Existing lifecycle guards handle only the exact internal halt error; unrelated observer exceptions still propagate.
Validation on the updated tree: repository typechecks and lint, core/provider tests (including hosted-search protocol and patched SDK hook tests), HTTP runtime version/dispatcher regressions, and desktop production build passed. Production audit reports no remaining Undici advisories; unrelated baseline advisories remain. Full pre-push and remote integration checks are tracked on the latest head.
Supersedes the deprecated-namespace update in #544. The independent Undici 7.x security update #531 is already merged; this migration retains its security intent on the SDK-required 8.x line.