Skip to content

Localize Pi provider injection to each Workspace - #981

Merged
luokerenx4 merged 2 commits into
devfrom
codex/pi-local-model-injection
Aug 4, 2026
Merged

Localize Pi provider injection to each Workspace#981
luokerenx4 merged 2 commits into
devfrom
codex/pi-local-model-injection

Conversation

@luokerenx4

Copy link
Copy Markdown
Contributor

What changed

  • register the OpenAlice-managed Pi provider through a generic Workspace-local .pi/extensions/openalice-provider.ts
  • keep provider credentials and reversible binding ownership in the git-excluded local .pi/openalice-provider.json sidecar
  • preserve Pi global models, auth, settings, packages, trust, and sessions
  • migrate active and departed version-1 bindings with backups, idempotency, stale-node cleanup, and torn model-selection repair
  • preserve user-edited provider extensions instead of overwriting or stranding them
  • document the new ownership boundary and execution plan

Root cause

OpenAlice previously wrote every Workspace custom provider into Pi’s user-global models.json. Concurrent Workspace launches could race on that shared file, leak Workspace-specific defaults across scopes, and leave project defaultModel selection pointing at a different global provider model. The extension API also requires complete model objects, unlike models.json, so the local projection supplies Pi’s own documented compatibility defaults at registration time.

User impact

Pi model and credential injection is now isolated per Workspace. Automated Issues and resumed Sessions use the Workspace provider without mutating global Pi model configuration, while user-owned global configuration remains visible and untouched. Existing installations migrate automatically with a backup and keep a legacy global provider whenever one Workspace cannot be localized safely.

Verification

  • npx tsc --noEmit
  • pnpm test — 3916 passed, 9 skipped
  • focused runtime/package matrix — 147 passed
  • migration/adapter matrix — 106 passed
  • real managed Pi --list-models discovery from the local extension
  • real managed Pi authenticated request against the isolated acceptance mock
  • CSC_IDENTITY_AUTO_DISCOVERY=false pnpm electron:smoke:workspace — packaged Electron, PTY/CLI, scheduled Issue, managed Pi response, migration, and cleanup all passed

@vercel

vercel Bot commented Aug 4, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
openalice-demo Ready Ready Preview Aug 4, 2026 4:17pm

Request Review

@luokerenx4 luokerenx4 added area:workspace Workspace, Session, templates, or sidebar lifecycle area:settings Settings, configuration, credentials, or permissions theme:reliability Failure recovery, retries, loading, or resilience review:deep Requires deliberate human review before merge labels Aug 4, 2026
@luokerenx4
luokerenx4 merged commit 3b92449 into dev Aug 4, 2026
2 of 3 checks passed
@luokerenx4
luokerenx4 deleted the codex/pi-local-model-injection branch August 4, 2026 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:settings Settings, configuration, credentials, or permissions area:workspace Workspace, Session, templates, or sidebar lifecycle review:deep Requires deliberate human review before merge theme:reliability Failure recovery, retries, loading, or resilience

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant