Skip to content

fix(pi-cli): use inverted provider env mapping for future-proof isolation#784

Merged
christso merged 2 commits intomainfrom
fix/pi-cli-env-mapping
Mar 26, 2026
Merged

fix(pi-cli): use inverted provider env mapping for future-proof isolation#784
christso merged 2 commits intomainfrom
fix/pi-cli-env-mapping

Conversation

@christso
Copy link
Copy Markdown
Collaborator

Summary

  • Refactors the pi-cli env var isolation to use an inverted mapping: each provider defines its own env var prefixes, and all other providers' vars are stripped automatically
  • Adding a new provider requires one map entry instead of updating every existing entry
  • Fixes pre-existing biome formatting in package.json files

Before/After

Before: Hardcoded per-provider removal lists — if subprovider: mistral was configured, no vars would be stripped (provider not in map), and Azure could still hijack the session.

After: Unknown providers still get all known competing vars stripped. New providers just need one entry in PROVIDER_OWN_PREFIXES.

Test plan

  • Unit tests pass (1598 tests)
  • Pre-push hooks pass

🤖 Generated with Claude Code

christso and others added 2 commits March 26, 2026 08:38
…tion

Instead of hardcoding which env vars to strip per provider, define which
env vars each provider owns and strip all others. Adding a new provider
only requires one map entry instead of updating every existing entry.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying agentv with  Cloudflare Pages  Cloudflare Pages

Latest commit: 792a873
Status: ✅  Deploy successful!
Preview URL: https://f3cc4e45.agentv.pages.dev
Branch Preview URL: https://fix-pi-cli-env-mapping.agentv.pages.dev

View logs

@christso christso merged commit 65256f2 into main Mar 26, 2026
2 checks passed
@christso christso deleted the fix/pi-cli-env-mapping branch March 26, 2026 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant