Port Pi extension UI, commands, and model settings to the RPC bridge - #2447
Port Pi extension UI, commands, and model settings to the RPC bridge#2447SawyerHood wants to merge 1 commit into
Conversation
|
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 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 ( 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.
|
Human comments
What was wrong
Pi extensions'
ctx.uicalls (select/confirm/input/editor dialogs, notify, setStatus, setWidget, setTitle, setEditorText), extension-registered slash commands, and pi'senabledModelsscope were invisible from bb after the bridge moved topi --mode rpc.What changed
plugins/provider-pi/src/bridge):extension_ui_requestlines become thread-scoped bb questions (answered back asextension_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/listfrom pi'sget_commands; a/nameinput that is an extension command answersturn/startat 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 behindturn/start).resolveModelScopeFromModels(globs, partial names, thinking suffixes), a locked, symlink-aware writer for~/.pi/agent/settings.json, a settings-page editor, andbb pi models list|set|enable-all.docs/model-preferences-policy.mddescribes the policy.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.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).