Skip to content

ACP: a model/reasoning change silently rebuilds a non-restorable agent session and drops its conversation #5691

Closed

Description

@thomaswillner

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), modelCli with selectFlag: "--model", reasoningCli with flag: "--thinking", no permissionCli
  • unmanaged workspace path environment

Steps to reproduce

  1. 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"
  2. 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.
  3. 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.ts L2310-2336: launchArgsChanged (launch model selection, which includes the reasoning flag, or permissionCli args) sets restart and calls rebuildAgentSession.
    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/load only if (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

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 GENERATED and 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

  1. added theissue type on Oct 17, 2026
  2. added
    providers
    provider-acp
    confirmed-repro
    on Oct 17, 2026
  3. bb-slop-cop commented on Oct 17, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    • Classification: Bug · Priority: High · Effort: Low.
    • Labels: providers, provider-acp, confirmed-repro.
    • Report: https://get-bb.github.io/reports/issues/5691.html — REPRODUCED, high root-cause confidence. Repeated in two trusted main checkouts using the repository's ACP fixture agent; the third-party agent/macOS setup was not tested.
    • Root cause: Launch model/reasoning changes rebuild the live ACP process without checking whether it can restore the conversation, accepting the turn with contextLost: true.
    • Fix: fix(acp): preserve non-restorable sessions on launch setting changes #5692 — rejects destructive launch-setting changes before teardown and preserves the existing session. Ready for review; not merged. Two files, 95 changed text lines.
    • Verification: Before the fix, both non-restorable regression cases fail and both restorable controls pass; afterward all four pass. ACP suite: 398 passed, 4 skipped; lint/typecheck pass. Strict replay comparison: 10 passed, 1 skipped, no allowed differences; the default stale allowlist was left unchanged.

    AGENT GENERATED

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

    confirmed-reproprovider-acpproviders

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions