Skip to content

Port Pi extension UI, commands, and model settings to the RPC bridge - #2447

Open
SawyerHood wants to merge 1 commit into
bb/garden-6-provider-extension-plumbingfrom
bb/garden-7-pi-extension-ui
Open

Port Pi extension UI, commands, and model settings to the RPC bridge#2447
SawyerHood wants to merge 1 commit into
bb/garden-6-provider-extension-plumbingfrom
bb/garden-7-pi-extension-ui

Conversation

@SawyerHood

@SawyerHood SawyerHood commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

Pi extensions' ctx.ui calls (select/confirm/input/editor dialogs, notify, setStatus, setWidget, setTitle, setEditorText), extension-registered slash commands, and pi's enabledModels scope were invisible from bb after the bridge moved to pi --mode rpc.

What changed

  • Bridge (plugins/provider-pi/src/bridge): extension_ui_request lines become thread-scoped bb questions (answered back as extension_ui_response) or a bounded extension-state snapshot (statuses, widgets, title, editor text, notifications, 60 KiB cap); dialogs queue until the session is announced and are cancelled on stop; oversized editor prefills are refused; command/list from pi's get_commands; a /name input that is an extension command answers turn/start at once and ends the turn on pi's ack or the run the handler started (pi runs the handler before it answers the prompt, and the daemon's thread lane would otherwise deadlock the dialog answer behind turn/start).
  • Model scope: a port of pi's resolveModelScopeFromModels (globs, partial names, thinking suffixes), a locked, symlink-aware writer for ~/.pi/agent/settings.json, a settings-page editor, and bb pi models list|set|enable-all. docs/model-preferences-policy.md describes the policy.
  • App bundle (app.tsx): renders the state kinds beside the composer, applies editor text once per revision, and toasts notifications once per session with a dismiss X.
  • The fake pi (fake-pi-rpc.mjs) gained /ui, /ask, /ext [json] knobs; 24 test files / 141 tests in the plugin.

No wire change beyond the layer below. Prerequisite: #2446.

How you verified

turbo run typecheck; turbo run test --filter=bb-plugin-provider-pi; live QA of /ui-demo (every dialog kind + notifications) in the dev app, which found and fixed the extension-command deadlock.

Fixes: none (upstream stack split).

AGENT GENERATED

@fgrehm

fgrehm commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

<almost-meat-proxy>

Adding downstream weight here: I run bb + pi in a rootless container daily, and after fixing the Bun fd-4 issue (#3095), the next wall was this — I'm trying to run pi-landstrip for sandboxed tool execution, and its ctx.ui.select/confirm permission prompts get auto-cancelled by the bridge, making a sandbox-approval extension useless over bb 😅

Happy to QA this branch end to end (Bun pi + landstrip, stop/replace mid-dialog) before merge. I also built a narrower bridge-only stopgap (fgrehm/bb, fix/pi-extension-ui) — no core changes, works on today's protocol — not as an alternative, just evidence the bridge slice could ship independentl.

Is this close to merging? Not sure whether the blocker is review time or the protocol changes. If the latter, dialogs-first behind an opt-in would unblock landstrip-style extensions sooner.

</almost-meat-proxy>

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.

2 participants