Repository navigation
Description
Summary
On an ACP provider whose agent advertises loadSession: false (here Prime Agent 0.10.0), changing a thread's model or reasoning level silently starts a new agent session, and the agent loses the whole conversation. bb records a warning event, but the change is applied without asking, and the next reply comes from a fresh context. I expected bb to warn and ask before applying a change that discards the agent's history, or to refuse it and suggest a new thread.
Versions and environment
- bb 0.46.1 (desktop app), macOS 26
- provider
acp-prime: custom ACP agent Prime Agent 0.10.0 (Rust),modelCliwithselectFlag: "--model",reasoningCliwithflag: "--thinking", nopermissionCli - unmanaged workspace path environment
Steps to reproduce
bb thread spawn --project <proj> --environment <empty dir> --provider acp-prime --permission-mode accept-edits --prompt "Remember this exact marker: ZEBRA-4417-KITE. Do not run any tools. Reply with only: OK"bb thread tell <thr> "What is the exact marker I asked you to remember? Reply with only the marker."→ZEBRA-4417-KITE. It is still correct after 6.5 min idle.bb thread tell <thr> --reasoning-level high "What is the exact marker I asked you to remember? Reply with only the marker."
Did not reproduce with the same question and unchanged settings, including after 6.5 min idle.
Expected vs actual
turn 3 (no settings change): completed "ZEBRA-4417-KITE"
turn 4 (--reasoning-level high):
thread/identity {"providerThreadId": "f82d1713-…"} (was e81f2aee-…)
provider/warning "… --mode acp could not restore the previous session; continuing in a fresh session without in-agent history."
provider/warning "Provider session was replaced; provider-side context was lost."
details: "Execution settings changed; the ACP session was rebuilt to apply them."
turn/completed completed "I don't have the marker in the available context."
Expected: when the session is not restorable (sessionRestorable: false) and the change requires a rebuild, the change should not silently cost the conversation. Either:
- block it with an explanation ("this agent cannot restore its session; start a new thread to change model/reasoning"), or
- require explicit confirmation in the composer before rebuilding.
The model and reasoning pickers could also mark these settings as fixed for such threads.
Evidence
At 411eac54ac16d0a3cb57d1de8396d37564884a73 (desktop-v0.46.1):
packages/provider-bridge-acp/src/bridge/bridge.tsL2310-2336:launchArgsChanged(launch model selection, which includes the reasoning flag, orpermissionCliargs) setsrestartand callsrebuildAgentSession.bb/packages/provider-bridge-acp/src/bridge/bridge.ts
Lines 2310 to 2336 in 411eac5
const launchArgsChanged = !isDeepStrictEqual( permissionCliArgsForMode( session.construction.permissionCli, session.construction.permissionMode, ), permissionCliArgsForMode( construction.permissionCli, construction.permissionMode, ), ) || !isDeepStrictEqual( launchModelSelection(session.construction), launchModelSelection(construction), ); const restart = session.connection.exited || session.restartAfterCancelError || launchArgsChanged || !isDeepStrictEqual(envVars ?? {}, session.construction.envVars ?? {}); cancelPendingPermissions(session); session.policy = { permissionMode: options.permissionMode, workspaceWriteRoots, }; if (restart) { return rebuildAgentSession(session, construction); - L1933: a resume uses
session/loadonlyif (request.kind === "resume" && supportsLoadSession). Otherwise L1981-1984 emits the "could not restore" warning and starts fresh. sessionRestorable: session.supportsLoadSession(L2020) is already known to the runtime before the rebuild, so the bridge has what it needs to warn or refuse.
Agent side: Prime 0.10.0 advertises loadSession: false. Its in-session session/set_config_option persists global defaults, which is why this agent uses launch flags (modelCli/reasoningCli) and why a rebuild is the only path today. Prime-side request: PrimeIntellect-ai/prime-agent#3624 (Prime takes requests through Discussions; issue #3667 was auto-closed for vouching)
Measured over 14 days on one machine: 23 "could not restore" fallbacks on Prime threads, across 5 long-running threads (47 to 196 turns); most on 0.46.0, and not every trigger was identified.
What you ruled out
- Not idle reaping: same session id and pid after 6.5 min idle; a Prime ACP process has also stayed alive for 9 h idle on 0.46.1.
- Not the host plugin-worker 5-min idle stop: per-thread
bb-provider-bridge-workerprocesses are separate, and the session survived it. - Permission-mode changes alone do not rebuild for this agent (no
permissionCli). That is by code reading only; I did not measure it. - Not Idle agent processes are never reclaimed for non-Codex providers #1604 (idle reclamation), not ACP has no token-usage field, and no way to express that a provider cannot report usage #2397 (ACP usage field).
Suggested priority and effort (optional)
Medium. Silent loss of in-agent context in long agent threads. The workaround is to never change model or reasoning mid-thread on such agents. Effort probably low: a guard on sessionRestorable before rebuildAgentSession when the trigger is a settings change.
Checks
- I reproduced this on the latest release or on
main, or I say above that I could not. (Reproduced on desktop 0.46.1, the latest release.) - I searched open and closed issues for the same problem.
- If an agent wrote this, the body ends with
> AGENT GENERATEDand links the thread or report.
AGENT GENERATED. Written by Claude (Opus 5.5) from a live canary thread (local bb thread
thr_43uu69p3px, now archived) and the code permalinks above; filed at the reporter's request.
Activity
bb-slop-cop commentedon Oct 17, 2026
🚨 SLOP COP 🚨 ·
new-issue-autopilotproviders,provider-acp,confirmed-repro.contextLost: true.fix(acp): refuse launch model changes an agent cannot restore across (#…