Repository navigation
Description
Summary
In a Pi thread, changing the model in BB did not change the model Pi actually used. BB recorded GPT or Claude for new turns, but Pi continued sending requests to the previous Grok model until manual compaction; the next response then used GPT as selected.
Versions and environment
- bb
0.39.1-nightly.32358956903.1(packaged macOS app) - macOS 15.6.1
- Built-in Pi provider with bundled Pi 0.84.0
Steps to reproduce
-
Start a Pi thread with an xAI/Grok model.
-
After the turn finishes, select an OpenAI/Codex model in BB's model picker.
-
Send several normal new-turn prompts.
-
Inspect only assistant metadata in the Pi bridge session:
jq -r 'select(.type == "message" and .message.role == "assistant") | [.timestamp, .message.provider, .message.model] | @tsv' ~/.bb/pi-bridge-sessions/<thread-id>.jsonl | tail
-
Run
/compact, then send another prompt and inspect the metadata again.
Expected vs actual
Expected: turns after the picker change use the selected OpenAI/Codex model.
Actual: BB recorded openai-codex/gpt-5.6-sol for multiple new turns, while Pi assistant records remained xai/grok-4.6. Immediately after /compact, Pi assistant records changed to openai-codex/gpt-5.6-sol.
Evidence
- BB
client/turn/requestedevents repeatedly recorded the newly selected model. - The Pi session had only the initial Grok
model_change; actual assistant messages remained Grok across later new turns. - Manual compaction was the synchronization boundary. The compaction itself appears to have used the stale Grok model, so it may also consume unintended quota.
- No prompts, credentials, account data, local paths, or private thread IDs are included here.
What you ruled out
- This was real Grok inference, not usage-dashboard polling; Pi persisted provider, model, and token usage on assistant messages.
- No matching open or closed issue was found. Does the pi provider persist per-turn records anywhere? BB-invoked pi sessions leave nothing in pi's own session store #2035 concerns session persistence, and pi provider: no way to manually compact a thread's context #1103/pi
/compacton a small session surfaces as a failed turn and puts the thread in error state #1721 concern manual compaction behavior rather than model switching.
Suggested priority: High — users can unknowingly consume the wrong provider's quota. Starting a new thread is the safest workaround.
AGENT GENERATED: by GPT-5.6 Sol. Investigation report available from the reporter without private conversation content.
Activity
iamhenry commentedon Aug 21, 2026
@ymichael @SawyerHood can y'all plz take a look at this when you get a chance?
Switching model within Pi was draining my grok usage after switching mid session from grok to as sol
SawyerHood commentedon Aug 21, 2026
Reproduced the same bug on the ACP providers (Cursor confirmed; Grok Build takes the same path), and traced it to one commit. Full report with repro script, bridge wire recordings, and screenshots: https://get-bb.github.io/reports/issues/2160.html. I think this issue should cover both Pi and ACP; the fix sites differ, but the cause is one change.
Root cause
#1640 (
c5b53caab, merged 2026-08-17, first in desktop 0.39.0) replaced the runtime's option-drift classification with() => "live"for both the Pi adapter and the ACP adapter, and moved reconciliation into the bridges. Neither bridge readsparams.optionsonturn/start:classifySessionExecutionSettingsChange, which returnssessionon any drift, so the runtime issuedthread/resumeand the agent relaunched with the new--model. The Pi adapter lost the same classification in the same commit.mainthe bridge adapter always classifies drift asliveandreconfigureThreadIfNeededonly records the new options.startAgentSession; for Cursor it is a--modellaunch flag.turn/startnever readsparams.options;turn/steerhas the same shape.handleTurnStartnever readsparams.optionseither. Your/compactboundary is a session rebuild picking up the recorded options.session.setModelper turn (verified:tell --model claude-sonnet-5on a Haiku thread sentcontrol_request set_model).ACP repro (source
15f21ade7, 2026-08-21;cursor-agent 2026.08.11)Same result from the real composer picker (provider locked to Cursor; picked "Cursor Grok 4.6", and in a second independent run "Composer 2.5"). Workaround:
bb thread stop <thr>, then send again; that doesthread/resumeand relaunchescursor-agent --model cursor-grok-4.6-low acp, which answers "Cursor Grok 4.6". Because #1604 never reaps idle ACP sessions, the stale process otherwise lives until the thread is stopped or the daemon restarts.Reproduced on two fresh dev instances by two independent agents (threads
thr_44p2unpauk,thr_cz92hmc6nv).Origin and what I ruled out
Suggested fix shape
On
turn/startandturn/steer, compareparams.options(model, reasoningLevel, serviceTier) with the session's pinned selection: native-selection agents applysession/set_model/set_config_option(Pi: its own model change) in place; CLI-flag agents (Cursor, Grok Build) rebuild the session with new launch args and emitsession/replaced. Or restore asessionclassification at the adapter level for bridges that do not reconcile per turn, which fixes Pi and ACP in one place. Suggest retitling to cover both providers.Investigation thread: bb
thr_5cdapt5sfp.iamhenry commentedon Aug 21, 2026
ty
Apply turn options to the live Pi session
Apply turn options to the live Pi session
Verify the replacement Pi child before retiring the old one
Apply turn options to the live Pi session (#2221)