Bump pi-coding-agent to 0.81.0 to resolve brace-expansion DoS alert #288 - #4327
Merged
Conversation
Upgrade @earendil-works/pi-coding-agent (and the pi-* siblings in apps/cli) from 0.80.3 to 0.81.0 across all three declarations so the bundled brace-expansion is the patched 5.0.7. 0.80.x ships the vulnerable 5.0.6 in its shrinkwrap, and because the package declares hasShrinkwrap, npm overrides cannot reach into that sealed subtree — only a 0.81.0+ bump fixes it. Migrate the CLI pi runtime to the 0.81.0 API: createAgentSession now takes a modelRuntime instead of authStorage/modelRegistry. Build a ModelRuntime backed by an in-memory CredentialStore so no auth.json is read or written, preserving the previous in-memory behavior. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Collaborator
📊 Performance Test ResultsComparing 73d2072 vs trunk app-size
site-editor
site-startup
Results are median values from multiple test runs. Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff) |
sejas
approved these changes
Jul 24, 2026
Member
There was a problem hiding this comment.
Studio Code CLI works as expected. I couldn't test the desktop app as currently is not starting for me. The error doesn't seem related to this PR. I dropped the error I got in #4319 (comment)
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.
Related issues
How AI was used in this PR
Claude Code investigated the alert, determined the only viable remediation path, performed the
@earendil-works/pi-coding-agentAPI migration in the CLI pi runtime, and updated the affected tests. All changes were reviewed by the author.Proposed Changes
Dependabot alert #288 is a high-severity DoS in
brace-expansion(exponential-time brace expansion, CVE-2026-13149), which reaches Studio transitively through@earendil-works/pi-coding-agent.The fix isn't a plain version bump. Findings while scoping it:
0.80.xrelease ofpi-coding-agent— including the latest0.80.10— bundles the vulnerablebrace-expansion@5.0.6in its shrinkwrap. Only0.81.0+ ships the patched5.0.7.overridesentry (scoped or global) can't fix it either:pi-coding-agentdeclareshasShrinkwrap, so npm treats its whole dependency subtree as sealed and parent overrides don't penetrate it (verified empirically).pi-coding-agentis declared in three places (apps/cli,apps/studio,packages/common); all must move in lockstep, otherwise the hoisted0.80.xcopy keeps the vulnerable transitive dependency and the alert stays open.So this bumps all three declarations (plus the
pi-*siblings inapps/cli) to0.81.0, which deduplicates to a single copy carrying patchedbrace-expansion@5.0.7.0.81.0also has breaking API changes.apps/studioandpackages/commononly import types and are unaffected, but the CLI pi runtime uses the runtime API, so it's migrated:createAgentSessionnow takes amodelRuntime(aModelRuntime) instead of the removedauthStorage/modelRegistryoptions. The runtime is built over an in-memoryCredentialStoreso noauth.jsonis read or written, preserving the previous in-memory-only behavior. No user-visible behavior change — the AI assistant authenticates and runs exactly as before.Testing Instructions
npm run typecheck— passes across all workspaces.npm test -- apps/cli/ai/tests/pi-runtime.test.ts— 10/10 pass; the WPCOM Anthropic/OpenAI provider and token-escaping auth-resolution tests were updated to the newmodelRuntimeAPI and still assert the same credential resolution.npm test -- apps/cli/ai packages/common/ai— 306/306 pass.npm run cli:buildsucceeds;node apps/cli/dist/cli/main.mjs --versionruns.Manual smoke test worth doing: run an AI assistant turn against both a WordPress.com (bearer-token proxy) provider and a direct API-key provider to confirm authentication still resolves.
Pre-merge Checklist