Skip to content

Allow plugins to contribute session-scoped Pi extensions without a global Pi install #7187

Closed as not planned

Description

@lalitjeevanrao

The workflow

I am building a BB plugin that displays GitHub Copilot session credits. The Pi path needs a small in-process collector because the native provider emits usage fields before normalization. I want one BB installation to stage that collector on the session's execution host and load it only into BB-managed Pi sessions. Standalone Pi configuration should remain unchanged.

The existing async bb.providers.experimental_contributeEnv("pi", ...) resolver and exact-host plugin RPC can stage the collector. The missing piece is a supported way for the Pi bridge to consume the staged extension path alongside BB's built-in extension.

What happens today

Inspected BB main at faec44168f09618ca3e95428f11487e3d535538c; desktop BB 0.48.1, macOS 26.6.2, Node 22.23.4. The upstream Pi package tests pin 0.84.4; a separate collector-loader prototype used installed Pi 1.5.0.

The Pi launcher supplies BB's own --extension path. The turn reconciliation has no contributed-extension snapshot, and an empty environment map does not by itself trigger reconstruction.

Today the collector is installed separately through Pi's package manager, which also affects standalone Pi using that agent directory. This is a feature request based on the source path and isolated executable tests, not a claim of an end-to-end live remote-host reproduction.

What you would expect

A narrow per-command option supplied through existing plugin environment contributions, tentatively BB_PI_ADDITIONAL_EXTENSIONS, containing a JSON array of absolute extension file paths on the execution host:

  • Validate a bounded list of readable regular files, deduplicate canonical paths, and append separate --extension arguments after BB's built-in extension.
  • Resolve from the current command snapshot, not the bridge's inherited environment.
  • Apply updates and missing/empty snapshots through existing safe-turn reconstruction, preserving session identity and checkpoints. Do not interrupt an active turn.
  • Leave catalog/model-list and fork utility children unchanged.
  • Omit invalid paths with stderr diagnostics. Readable extension code retains normal trusted Pi execution semantics; this does not introduce a sandbox or startup/inference retry.

Reviewed prototype commit implements this within provider-pi plus documentation, without a new SDK registry, downloader or protocol field. I am requesting feature sign-off here before opening a PR, as CONTRIBUTING.md requires.

Prototype validation

32 focused tests pass, including actual spawned fixture-child argument checks, paths with spaces, list/path bounds, invalid entries, A→B updates, removal through []/empty/omitted environment maps, inherited stale-value exclusion, provider identity preservation, active-turn steering, and catalog/fork helper exclusion. Provider typecheck and lint pass.

Commands (from the prototype checkout):

pnpm exec turbo run test --only --filter=bb-plugin-provider-pi -- src/additional-extensions.test.ts src/bridge/bridge.turn-options.test.ts src/session-params.test.ts src/bridge/bridge.checkpoint-fork.test.ts src/bridge/rpc-session.retry.test.ts
pnpm exec turbo run typecheck lint --only --filter=bb-plugin-provider-pi

Focused checks used Turbo --only after building the SDK runtime/types and process-utils profile worker. Full Turbo orchestration was not verified: the sparse checkout lacked app/template and native database build dependencies. No live billing calls or production BB modifications were used.

Context and alternatives

  • A separate global Pi install works today but defeats the single-install, BB-scoped lifecycle.
  • Replacing BB_PI_BRIDGE_COMMAND/BB_PI_BRIDGE_ARGS is a launcher override, not a composable extension lifecycle; it also affects probe/catalog paths and can conflict with an existing custom launcher.
  • Changing PI_CODING_AGENT_DIR or NODE_OPTIONS affects broader runtime state than this feature needs.
  • Existing host RPC/artifact delivery is sufficient: an isolated actual Pi loader accepted a wrapper importing the collector from a relocated managed host bundle, with network blocked. Contributor staging must retain its own immutable generation because BB prunes old cached host-artifact digests.
  • The current first-plugin-wins environment conflict policy would apply to this key. This proposal does not add multi-plugin merging.
  • Related provider-pi bridge: resumed session can use a stale extensionPath from a dead bridge worker's temp dir (ENOENT on pi-tools-*.json at extension load) #5350 concerns the built-in bridge extension's lifetime, rather than third-party per-session extension contribution.

Checks

  • Searched open and closed issues and PRs for Pi extension contribution/installation requests.
  • This agent-written body ends with the required marker.

AGENT GENERATED

Activity

  1. lalitjeevanrao commented on Nov 6, 2026

    @lalitjeevanrao
    Author

    Closing because we are taking a simpler product approach: direct Copilot CLI support and a guided, separately installed Pi collector. This feature is no longer a dependency for our release.

    AGENT GENERATED

  2. added
    providers
    plugins
    provider-pi
    on Nov 6, 2026
  3. bb-slop-cop commented on Nov 6, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    Applied the missing classification:

    • Type: Feature — adds session-scoped extension contribution rather than correcting existing behavior.
    • Priority: Low — narrow, opt-in capability with an installation workaround and no current release dependency.
    • Effort: Medium — coordinated launcher validation and safe session-reconstruction changes.
    • Labels: providers, plugins, provider-pi.

    Verified all values after writing. No existing classification values needed preservation; the issue remains closed. No reproduction report or pull request: this is a feature request, not a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    pluginsprovider-piproviders

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions