← reports

#5051 · ACP pre-prompt reconciliation retains launch-time selection

BugHighEffort: Mediumproviders · provider-acpopen on GitHub2026-10-06 · base 6e348ee

Verdict: REPRODUCED · Root-cause confidence: high · Reproduction label: confirmed-repro

1. TL;DR

The ACP bridge accepts a different model on a completed-turn follow-up, but sends the next prompt using the startup selection. Two real stdio tests against the trusted repository bridge request strong → default → strong and observe strong → strong → strong, using either supported ACP model interface. A supported effort/tier change also remains low/default instead of high/fast. An environment-triggered rebuild uses the old construction selection. The issue is below the model picker: the shared pre-prompt reconciliation never applies the incoming selection.

2. Claims vs findings

ClaimStatusEvidence
Live native model follow-ups keep the first choiceVerifiedBoth config-options and models-field cases fail at the requested second selection. Each has one session/new, zero session/load, three completed prompts.
Supported effort and tier follow-ups are ignoredVerifiedThe trusted parameterized synthetic agent reports selected-effort:low and selected-fast:false after explicit high/fast requests.
Environment recreation retains old selectionVerifiedWith model capabilities retained in the new process, requesting fake/strong after starting fake/default still yields selected-model:fake/default.
The omission remains in mainVerifiedBoth executions use trusted main source at 6e348ee48c5d4e23d67b2d31d98b31acb3494739. Later main at 8abfcd77e571b9db44e15de618d6ba805e8abe73 has no ACP subsystem diff.
Queued inputs lack execution optionsNot true of this main baseAcpPendingTurnInput already retains options, and runTurn reconciles pending.options. The remaining omission is specifically model/effort/tier reconciliation.
Real OpenCode backend identity, shipped desktop behavior, release/resume workaroundNot exercised hereNo reporter script or artifact was executed; no live provider, paid inference, desktop UI, or installed application was accessed.

3. Environment

4. Minimal reproduction

The inline regression patch was authored from trusted source and adds four expected-contract cases to the existing bridge suite. It changes tests only; production and the synthetic agent remain unchanged. Save the patch block as regression.patch; all reproduction material is inline, in accordance with the public reports repository's publication policy.

  1. Obtain the trusted base and install/build its normal frozen dependencies:
    git clone --branch main https://github.com/get-bb/bb.git bb-5051
    cd bb-5051
    git checkout --detach 6e348ee48c5d4e23d67b2d31d98b31acb3494739
    pnpm install --frozen-lockfile --prefer-offline
    pnpm exec turbo run build
  2. Save this report's regression.patch locally and apply it to that checkout:
    git apply /absolute/path/to/regression.patch
    pnpm exec turbo run test --filter=@bb/provider-bridge-acp -- src/bridge/bridge.test.ts -t 'issue 5051'
  3. Expected on a corrected bridge: four cases pass. Actual on the trusted base: exit 1 with four assertion failures:
    Both live model interfaces:
    Expected: ["selected-model:fake/strong", "selected-model:fake/default", "selected-model:fake/strong"]
    Received: ["selected-model:fake/strong", "selected-model:fake/strong", "selected-model:fake/strong"]
    
    Same-model settings:
    Expected: ["selected-effort:high", "selected-fast:true"]
    Received: ["selected-effort:low", "selected-fast:false"]
    
    Environment rebuild:
    AssertionError: expected [ 'selected-model:fake/default' ] to include 'selected-model:fake/strong'
    
    Tests  4 failed | 128 skipped (132)

The live model cases assert successful bridge responses, wait for a new completion count on every turn, and check one session/new and no session/load before comparing agent-reported values. The environment case explicitly retains the model capability flag in the rebuilt process and requests a non-default model, avoiding an accidental pass from a fresh agent's default. These are behavior checks at the real bridge/agent boundary, not source greps or mock implementations of selection.

Complete added test cases
  it.each([
    { interfaceName: "config-options", envFlag: "FAKE_ACP_MODEL_CONFIG" },
    { interfaceName: "models-field", envFlag: "FAKE_ACP_MODELS_FIELD" },
  ])(
    "issue 5051 applies live model choices through $interfaceName",
    async ({ envFlag }) => {
      const requestLog = join(workspaceDir, "selection-requests.jsonl");
      const { providerThreadId } = await startThread({
        envVars: { [envFlag]: "1", FAKE_ACP_REQUEST_LOG: requestLog },
        model: "fake/strong",
      });
      const actualModels: string[] = [];
      for (const model of ["fake/strong", "fake/default", "fake/strong"]) {
        const completed = threadEventsOfType("turn/completed").length;
        const response = await waitForResponse(
          sendTurnRequest("turn/start", providerThreadId, {
            options: executionOptions({ model }),
            input: [
              { type: "text", text: "echo-selected-model", mentions: [] },
            ],
          }),
        );
        expect(response.error).toBeUndefined();
        await waitFor(
          () =>
            threadEventsOfType("turn/completed").length > completed
              ? true
              : undefined,
          "new completed model turn",
        );
        actualModels.push(agentMessageTexts().at(-1) ?? "missing model output");
      }
      const requests = loggedAcpRequests(requestLog);
      expect(
        requests.filter((request) => request.method === "session/new"),
      ).toHaveLength(1);
      expect(
        requests.filter((request) => request.method === "session/load"),
      ).toHaveLength(0);
      expect(actualModels).toEqual([
        "selected-model:fake/strong",
        "selected-model:fake/default",
        "selected-model:fake/strong",
      ]);
    },
  );

  it("issue 5051 applies effort and tier changes without changing the model", async () => {
    const { providerThreadId } = await startThread({
      dialectId: "cursor",
      parameterizedModelPicker: true,
      envVars: { FAKE_ACP_CURSOR_PARAMETERIZED_MODELS: "1" },
      model: "grok-4.6",
      reasoningLevel: "low",
      serviceTier: "default",
    });
    const actualSettings: string[] = [];
    for (const text of ["echo-selected-effort", "echo-selected-fast"]) {
      const completed = threadEventsOfType("turn/completed").length;
      const response = await waitForResponse(
        sendTurnRequest("turn/start", providerThreadId, {
          options: executionOptions({
            model: "grok-4.6",
            reasoningLevel: "high",
            serviceTier: "fast",
          }),
          input: [{ type: "text", text, mentions: [] }],
        }),
      );
      expect(response.error).toBeUndefined();
      await waitFor(
        () =>
          threadEventsOfType("turn/completed").length > completed
            ? true
            : undefined,
        "new completed settings turn",
      );
      actualSettings.push(
        agentMessageTexts().at(-1) ?? "missing settings output",
      );
    }
    expect(actualSettings).toEqual([
      "selected-effort:high",
      "selected-fast:true",
    ]);
  });

  it("issue 5051 preserves the current model choice when environment changes rebuild the agent", async () => {
    const { providerThreadId } = await startThread({
      envVars: { FAKE_ACP_MODEL_CONFIG: "1" },
      model: "fake/default",
    });
    const response = await waitForResponse(
      sendTurnRequest("turn/start", providerThreadId, {
        options: executionOptions({
          model: "fake/strong",
          envVars: {
            FAKE_ACP_MODEL_CONFIG: "1",
            SELECTION_TEST_MARKER: "changed",
          },
        }),
        input: [{ type: "text", text: "echo-selected-model", mentions: [] }],
      }),
    );
    expect(response.error).toBeUndefined();
    await waitForTurnCompleted();
    expect(agentMessageTexts()).toContain("selected-model:fake/strong");
  });

Added test snippet · First run · Second run

5. Root cause

runTurn, lines 2109–2133, invokes reconciliation for each pending input and then dispatches session/prompt. reconcileExecutionSettings, lines 2184–2235, handles environment and permission/write-root state, but omits options.model, options.reasoningLevel and options.serviceTier:

const construction = {
  ...session.construction,
  envVars,
  permissionMode: options.permissionMode,
  workspaceWriteRoots,
};

The spread preserves the original modelSelection. Rebuild therefore also receives the old selection. Session construction, lines 1875–1911, applies native selection at new/load/fork construction, but no live pre-prompt call reaches that selector.

selectAcpNativeModel, lines 1155–1219, compares requested values with current configuration and uses setter responses for dependent options only within the call. AcpThreadSession, lines 160–193, has no retained authoritative model/configuration snapshot. A repair must not reuse stale startup values when returning to the original model.

The queued-input contract is already present on this base: AcpPendingTurnInput includes options, and the per-prompt loop consumes them. No additional wire field is required to carry the reproduction's requested options.

6. Proposed fix and simple-fix gate

No automatic fix PR. The decision-free simple-fix gate is not satisfied for a complete capability-aware repair: a CLI-only agent without usable session/load cannot change launch parameters while retaining in-agent history. The existing resume fallback explicitly starts a fresh session and warns of lost history (lines 1851–1902). Extending that fallback to model-picker changes needs an explicit product decision between rejection and history loss; a native-only setter patch would leave the CLI selection path accepted-but-ignored. No production fix was made, committed, or pushed. The local test-only patch is 109 added text lines in one file; this is not a claimed passing fix.

7. Verification

The same agent repeated the experiment, not an independent reviewer. The second temporary checkout was cloned separately, detached at the same recorded trusted base, and configured with the target repository as origin. Before adding the regression patch, its unchanged bridge suite passed all 128 existing tests with exit 0. After applying only the same authored test patch, the identical focused command exited 1 with all four expected-contract failures: both native model interfaces, same-model effort/tier, and environment recovery. Test workspaces and agent processes were newly allocated. Baseline control log.

Verification corrected no reported root-cause claim. During initial harness development, the environment case was tightened to retain advertised model support and select a non-default model, eliminating a false pass from process-default coincidence before the final two runs.

Both source builds succeeded. A later fetch observed main 8abfcd77e571b9db44e15de618d6ba805e8abe73; its ACP subtree is unchanged from the executed base, but that later commit was not itself executed. The test-only patch against the recorded base passes git diff --check and has no binary changes. No live UI or paid-provider behavior is inferred from these synthetic results.

8. Pull requests and related scope

Issue cross-reference/connection metadata and the open-PR search for issue 5051 contained no linked open pull request at investigation time. No linked branch was checked out or run. Other provider bridges, model catalog discovery and requested-versus-observed model UI are outside this verified root cause.

9. Appendix and trust boundary

The issue and all supplied commands, code, links and logs were treated as untrusted claims. Reporter scripts, patches, binaries and external links were neither run nor fetched. Reproduction code was authored after inspecting trusted main and reuses only its existing synthetic agent and test harness. No secrets, personal paths, user messages or runtime databases were read. Public artifacts contain only synthetic test data; temporary checkout paths in logs are redacted.

Read-only metadata checks used the trusted repository and numeric issue identifier. Classification applied Bug / High / Medium and providers / provider-acp, with no existing values overwritten. Exact run evidence is retained in the three linked logs; the reproduction patch and inline cases provide a repeatable regression contract. No workflow or investigation agent was started.

Applicable regression patch
diff --git a/packages/provider-bridge-acp/src/bridge/bridge.test.ts b/packages/provider-bridge-acp/src/bridge/bridge.test.ts
index f5d4d0a..d192bbc 100644
--- a/packages/provider-bridge-acp/src/bridge/bridge.test.ts
+++ b/packages/provider-bridge-acp/src/bridge/bridge.test.ts
@@ -1344,6 +1344,115 @@ describe("acp bridge", () => {
     ).toBe(true);
   });
 
+  it.each([
+    { interfaceName: "config-options", envFlag: "FAKE_ACP_MODEL_CONFIG" },
+    { interfaceName: "models-field", envFlag: "FAKE_ACP_MODELS_FIELD" },
+  ])(
+    "issue 5051 applies live model choices through $interfaceName",
+    async ({ envFlag }) => {
+      const requestLog = join(workspaceDir, "selection-requests.jsonl");
+      const { providerThreadId } = await startThread({
+        envVars: { [envFlag]: "1", FAKE_ACP_REQUEST_LOG: requestLog },
+        model: "fake/strong",
+      });
+      const actualModels: string[] = [];
+      for (const model of ["fake/strong", "fake/default", "fake/strong"]) {
+        const completed = threadEventsOfType("turn/completed").length;
+        const response = await waitForResponse(
+          sendTurnRequest("turn/start", providerThreadId, {
+            options: executionOptions({ model }),
+            input: [
+              { type: "text", text: "echo-selected-model", mentions: [] },
+            ],
+          }),
+        );
+        expect(response.error).toBeUndefined();
+        await waitFor(
+          () =>
+            threadEventsOfType("turn/completed").length > completed
+              ? true
+              : undefined,
+          "new completed model turn",
+        );
+        actualModels.push(agentMessageTexts().at(-1) ?? "missing model output");
+      }
+      const requests = loggedAcpRequests(requestLog);
+      expect(
+        requests.filter((request) => request.method === "session/new"),
+      ).toHaveLength(1);
+      expect(
+        requests.filter((request) => request.method === "session/load"),
+      ).toHaveLength(0);
+      expect(actualModels).toEqual([
+        "selected-model:fake/strong",
+        "selected-model:fake/default",
+        "selected-model:fake/strong",
+      ]);
+    },
+  );
+
+  it("issue 5051 applies effort and tier changes without changing the model", async () => {
+    const { providerThreadId } = await startThread({
+      dialectId: "cursor",
+      parameterizedModelPicker: true,
+      envVars: { FAKE_ACP_CURSOR_PARAMETERIZED_MODELS: "1" },
+      model: "grok-4.6",
+      reasoningLevel: "low",
+      serviceTier: "default",
+    });
+    const actualSettings: string[] = [];
+    for (const text of ["echo-selected-effort", "echo-selected-fast"]) {
+      const completed = threadEventsOfType("turn/completed").length;
+      const response = await waitForResponse(
+        sendTurnRequest("turn/start", providerThreadId, {
+          options: executionOptions({
+            model: "grok-4.6",
+            reasoningLevel: "high",
+            serviceTier: "fast",
+          }),
+          input: [{ type: "text", text, mentions: [] }],
+        }),
+      );
+      expect(response.error).toBeUndefined();
+      await waitFor(
+        () =>
+          threadEventsOfType("turn/completed").length > completed
+            ? true
+            : undefined,
+        "new completed settings turn",
+      );
+      actualSettings.push(
+        agentMessageTexts().at(-1) ?? "missing settings output",
+      );
+    }
+    expect(actualSettings).toEqual([
+      "selected-effort:high",
+      "selected-fast:true",
+    ]);
+  });
+
+  it("issue 5051 preserves the current model choice when environment changes rebuild the agent", async () => {
+    const { providerThreadId } = await startThread({
+      envVars: { FAKE_ACP_MODEL_CONFIG: "1" },
+      model: "fake/default",
+    });
+    const response = await waitForResponse(
+      sendTurnRequest("turn/start", providerThreadId, {
+        options: executionOptions({
+          model: "fake/strong",
+          envVars: {
+            FAKE_ACP_MODEL_CONFIG: "1",
+            SELECTION_TEST_MARKER: "changed",
+          },
+        }),
+        input: [{ type: "text", text: "echo-selected-model", mentions: [] }],
+      }),
+    );
+    expect(response.error).toBeUndefined();
+    await waitForTurnCompleted();
+    expect(agentMessageTexts()).toContain("selected-model:fake/strong");
+  });
+
   it("selects ACP-native models with session/set_config_option before the first prompt", async () => {
     const { providerThreadId } = await startThread({
       envVars: { FAKE_ACP_MODEL_CONFIG: "1" },
First reproduction run: exit 1
• turbo 2.10.12

   • Packages in scope: @bb/provider-bridge-acp
   • Running test in 1 packages
   • Remote caching disabled

//:ensure-native-modules: cache bypass, force executing 0cdc0850e9bf693c
//:ensure-native-modules: 
//:ensure-native-modules: > bb@ ensure-native-modules <checkout-1>
//:ensure-native-modules: > node scripts/ensure-native-modules.mjs
//:ensure-native-modules: 
@bb/provider-bridge-acp:test: cache miss, executing ac4a69d8455819a8
@bb/provider-bridge-acp:test: 
@bb/provider-bridge-acp:test: > @bb/provider-bridge-acp@0.0.1 test <checkout-1>/packages/provider-bridge-acp
@bb/provider-bridge-acp:test: > vitest run --config vitest.config.ts "src/bridge/bridge.test.ts" "-t" "issue 5051"
@bb/provider-bridge-acp:test: 
@bb/provider-bridge-acp:test: 
@bb/provider-bridge-acp:test:  RUN  v4.1.1 <checkout-1>/packages/provider-bridge-acp
@bb/provider-bridge-acp:test: 
@bb/provider-bridge-acp:test: (node:11220) ExperimentalWarning: SQLite is an experimental feature and might change at any time
@bb/provider-bridge-acp:test: (Use `node --trace-warnings ...` to show where the warning was created)
@bb/provider-bridge-acp:test:  ❯ |@bb/provider-bridge-acp:isolated| src/bridge/bridge.test.ts (132 tests | 4 failed | 128 skipped) 613ms
@bb/provider-bridge-acp:test:      ↓ answers initialize and lists grouped models without spawning an agent
@bb/provider-bridge-acp:test:      ↓ answers a minimal model/list (no params) with the synthetic default
@bb/provider-bridge-acp:test:      ↓ uses the CLI model list before ACP-native session discovery when both are present
@bb/provider-bridge-acp:test:      ↓ uses Cursor CLI variants as reasoning metadata for bare ACP models
@bb/provider-bridge-acp:test:      ↓ discovers ACP-native models and per-model reasoning from session configOptions
@bb/provider-bridge-acp:test:      ↓ keeps probing reasoning for later models after one model's probe fails
@bb/provider-bridge-acp:test:      ↓ advertises Cursor's parameterized model picker during discovery
@bb/provider-bridge-acp:test:      ↓ applies Cursor model parameters and maps 'default' to fast='false'
@bb/provider-bridge-acp:test:      ↓ applies Cursor model parameters and maps 'fast' to fast='true'
@bb/provider-bridge-acp:test:      ↓ translates a legacy Cursor model for thread/start session construction
@bb/provider-bridge-acp:test:      ↓ translates a legacy Cursor model for thread/resume session construction
@bb/provider-bridge-acp:test:      ↓ translates a legacy Cursor model for thread/fork session construction
@bb/provider-bridge-acp:test:      ↓ fails session construction when an advertised Fast selection is rejected
@bb/provider-bridge-acp:test:      ↓ leaves service tier untouched when the agent advertises no Fast option
@bb/provider-bridge-acp:test:      ↓ discovers ACP-native models from session models state
@bb/provider-bridge-acp:test:      ↓ advertises launch-time reasoning CLI levels on ACP-native models
@bb/provider-bridge-acp:test:      ↓ authenticates before ACP-native model discovery
@bb/provider-bridge-acp:test:      ↓ probes per-model reasoning across large catalogs instead of falling back
@bb/provider-bridge-acp:test:      ↓ times out hung ACP-native discovery, kills the child, and falls back to the synthetic model
@bb/provider-bridge-acp:test:      ↓ serves ACP-native discovered models from cache within the TTL and re-discovers after it
@bb/provider-bridge-acp:test:      ↓ falls back to the synthetic model when ACP-native session discovery has no model option
@bb/provider-bridge-acp:test:      ↓ fails model/list with a clear error when the list command is missing
@bb/provider-bridge-acp:test:      ↓ fails model/list when the list command reports ACP auth is required
@bb/provider-bridge-acp:test:      ↓ falls back to the synthetic model when the list command prints no models
@bb/provider-bridge-acp:test:      ↓ keeps CLI reasoning on the resolved model variant instead of ACP config
@bb/provider-bridge-acp:test:      ↓ sets native question availability only for 'opencode' sessions
@bb/provider-bridge-acp:test:      ↓ sets native question availability only for 'acp' sessions
@bb/provider-bridge-acp:test:      ↓ launches ACP agents with a configured reasoning CLI flag
@bb/provider-bridge-acp:test:      ↓ launches full-mode ACP agents with configured permission CLI args
@bb/provider-bridge-acp:test:      ↓ does not apply full-mode permission CLI args in workspace-write mode
@bb/provider-bridge-acp:test:      ↓ uses modelCli only for model selection when reasoningCli owns effort
@bb/provider-bridge-acp:test:      × issue 5051 applies live model choices through 'config-options' 185ms
@bb/provider-bridge-acp:test:      × issue 5051 applies live model choices through 'models-field' 151ms
@bb/provider-bridge-acp:test:      × issue 5051 applies effort and tier changes without changing the model 128ms
@bb/provider-bridge-acp:test:      × issue 5051 preserves the current model choice when environment changes rebuild the agent 147ms
@bb/provider-bridge-acp:test:      ↓ selects ACP-native models with session/set_config_option before the first prompt
@bb/provider-bridge-acp:test:      ↓ falls back to session/set_model when the model config option errors
@bb/provider-bridge-acp:test:      ↓ selects ACP-native models from session models state
@bb/provider-bridge-acp:test:      ↓ selects ACP-native reasoning with session/set_config_option before the first prompt
@bb/provider-bridge-acp:test:      ↓ applies configured native reasoning when the ACP agent does not advertise thought_level
@bb/provider-bridge-acp:test:      ↓ keeps ACP-native models without thought_level at the single managed level
@bb/provider-bridge-acp:test:      ↓ keeps reasoning empty when an ACP-native model advertises only unmapped thought levels
@bb/provider-bridge-acp:test:      ↓ shows configured native reasoning for ACP-native models without thought_level
@bb/provider-bridge-acp:test:      ↓ preserves Electron Node mode for the dynamic-tool MCP process only
@bb/provider-bridge-acp:test:      ↓ warns and launches the family id when a reasoning variant is missing
@bb/provider-bridge-acp:test:      ↓ starts a session and runs a prompt turn end to end
@bb/provider-bridge-acp:test:      ↓ rebuilds the agent with environment from a later turn
@bb/provider-bridge-acp:test:      ↓ authenticates ACP sessions with cached tokens when advertised
@bb/provider-bridge-acp:test:      ↓ prefers xAI API-key auth when XAI_API_KEY is available
@bb/provider-bridge-acp:test:      ↓ lets agents surface their own error for unsupported advertised auth methods
@bb/provider-bridge-acp:test:      ↓ keeps a non-auth session failure untyped when the agent advertises a login bb cannot perform
@bb/provider-bridge-acp:test:      ↓ keeps an agent exit during session/new untyped when the agent advertises a login bb cannot perform
@bb/provider-bridge-acp:test:      ↓ approves Cursor session MCP servers for the session lifetime (#2018)
@bb/provider-bridge-acp:test:      ↓ forwards ACP dynamic tool calls through the runtime tool-call contract
@bb/provider-bridge-acp:test:      ↓ cancels the runtime tool request after socket-close
@bb/provider-bridge-acp:test:      ↓ cancels the runtime tool request after provider-exit
@bb/provider-bridge-acp:test:      ↓ cancels the runtime tool request after turn-end
@bb/provider-bridge-acp:test:      ↓ keeps the dynamic-tool TCP server alive after a client reset on initialize
@bb/provider-bridge-acp:test:      ↓ lists skills/configure roots in canonical session instructions
@bb/provider-bridge-acp:test:      ↓ prepends instructions to the first prompt only
@bb/provider-bridge-acp:test:      ↓ auto-allows permission requests in full mode
@bb/provider-bridge-acp:test:      ↓ forwards permission requests to the runtime in ask mode
@bb/provider-bridge-acp:test:      ↓ presents an external-directory write permission as a file-change approval
@bb/provider-bridge-acp:test:      ↓ answers session-grant decisions with the allow_always option
@bb/provider-bridge-acp:test:      ↓ acknowledges fs add writes
@bb/provider-bridge-acp:test:      ↓ acknowledges fs update writes
@bb/provider-bridge-acp:test:      ↓ reconciles 'accept-edits' -> 'full' on 'turn/start' (CLI: false, load: false)
@bb/provider-bridge-acp:test:      ↓ reconciles 'accept-edits' -> 'full' on 'turn/start' (CLI: false, load: true)
@bb/provider-bridge-acp:test:      ↓ reconciles 'accept-edits' -> 'full' on 'turn/start' (CLI: true, load: false)
@bb/provider-bridge-acp:test:      ↓ reconciles 'accept-edits' -> 'full' on 'turn/start' (CLI: true, load: true)
@bb/provider-bridge-acp:test:      ↓ reconciles 'accept-edits' -> 'full' on 'turn/steer' (CLI: false, load: false)
@bb/provider-bridge-acp:test:      ↓ reconciles 'accept-edits' -> 'full' on 'turn/steer' (CLI: false, load: true)
@bb/provider-bridge-acp:test:      ↓ reconciles 'accept-edits' -> 'full' on 'turn/steer' (CLI: true, load: false)
@bb/provider-bridge-acp:test:      ↓ reconciles 'accept-edits' -> 'full' on 'turn/steer' (CLI: true, load: true)
@bb/provider-bridge-acp:test:      ↓ reconciles 'full' -> 'accept-edits' on 'turn/start' (CLI: false, load: false)
@bb/provider-bridge-acp:test:      ↓ reconciles 'full' -> 'accept-edits' on 'turn/start' (CLI: false, load: true)
@bb/provider-bridge-acp:test:      ↓ reconciles 'full' -> 'accept-edits' on 'turn/start' (CLI: true, load: false)
@bb/provider-bridge-acp:test:      ↓ reconciles 'full' -> 'accept-edits' on 'turn/start' (CLI: true, load: true)
@bb/provider-bridge-acp:test:      ↓ reconciles 'full' -> 'accept-edits' on 'turn/steer' (CLI: false, load: false)
@bb/provider-bridge-acp:test:      ↓ reconciles 'full' -> 'accept-edits' on 'turn/steer' (CLI: false, load: true)
@bb/provider-bridge-acp:test:      ↓ reconciles 'full' -> 'accept-edits' on 'turn/steer' (CLI: true, load: false)
@bb/provider-bridge-acp:test:      ↓ reconciles 'full' -> 'accept-edits' on 'turn/steer' (CLI: true, load: true)
@bb/provider-bridge-acp:test:      ↓ rejects simultaneous starts while reconciling unchanged permissions
@bb/provider-bridge-acp:test:      ↓ preserves stacked steers across permission CLI rebuilds
@bb/provider-bridge-acp:test:      ↓ reports a permission-changing steer whose replacement fails to start
@bb/provider-bridge-acp:test:      ↓ denies client fs writes outside the workspace in accept-edits mode
@bb/provider-bridge-acp:test:      ↓ allows canonical accept-edits writes into a configured extra write root
@bb/provider-bridge-acp:test:      ↓ keeps partial output from the cancelled prompt then continues
@bb/provider-bridge-acp:test:      ↓ rebuilds a stuck agent after a steer cancellation error (session/load=0)
@bb/provider-bridge-acp:test:      ↓ rebuilds a stuck agent after a steer cancellation error (session/load=1)
@bb/provider-bridge-acp:test:      ↓ delivers stacked steers on the same turn
@bb/provider-bridge-acp:test:      ↓ cancels a stacked steer prompt that also hangs
@bb/provider-bridge-acp:test:      ↓ runs the builtin /compact command as compaction, not as a prompt
@bb/provider-bridge-acp:test:      ↓ fails the compaction turn legibly when the agent rejects the request
@bb/provider-bridge-acp:test:      ↓ does not report an ACP refusal as successful compaction
@bb/provider-bridge-acp:test:      ↓ does not apply OMP compaction prose to 'generic' ACP
@bb/provider-bridge-acp:test:      ↓ does not apply OMP compaction prose to 'OpenCode' ACP
@bb/provider-bridge-acp:test:      ↓ fails the compaction turn when the agent reports the failure in an end-turn message
@bb/provider-bridge-acp:test:      ↓ completes a no-op compaction turn without reporting a compacted context
@bb/provider-bridge-acp:test:      ↓ keeps classifying a no-op compaction when the agent rewords its prose
@bb/provider-bridge-acp:test:      ↓ fails the compaction turn when the failure report is reworded or preceded by other text
@bb/provider-bridge-acp:test:      ↓ accepts turn input only after the prompt carrying it goes out
@bb/provider-bridge-acp:test:      ↓ never accepts a queued steer the stopped turn did not send
@bb/provider-bridge-acp:test:      ↓ rejects steers when no turn is active
@bb/provider-bridge-acp:test:      ↓ cancels the active turn on thread/stop
@bb/provider-bridge-acp:test:      ↓ settles the interrupted turn itself when the agent ignores session/cancel
@bb/provider-bridge-acp:test:      ↓ forks an advertised ACP session with the target cwd and MCP servers
@bb/provider-bridge-acp:test:      ↓ rejects a checkpoint fork before session/fork
@bb/provider-bridge-acp:test:      ↓ rejects a fork result that reuses the source session id
@bb/provider-bridge-acp:test:      ↓ rejects fork before session/fork when the agent omits the capability
@bb/provider-bridge-acp:test:      ↓ emits session.reset after identity at every construction (start, resume, fork)
@bb/provider-bridge-acp:test:      ↓ surfaces Grok context window size and prompt usage from session _meta
@bb/provider-bridge-acp:test:      ↓ ignores Grok-shaped session _meta on other ACP dialects
@bb/provider-bridge-acp:test:      ↓ holds an agent update written with the session/new response until thread/identity is out
@bb/provider-bridge-acp:test:      ↓ holds an agent update written with the session/fork response until the fork's thread/identity is out
@bb/provider-bridge-acp:test:      ↓ forwards context usage reported during session/load
@bb/provider-bridge-acp:test:      ↓ ignores load-time context usage for a different session
@bb/provider-bridge-acp:test:      ↓ discards load-time context usage when session/load fails
@bb/provider-bridge-acp:test:      ↓ re-applies ACP-native reasoning after session/load resume
@bb/provider-bridge-acp:test:      ↓ falls back to a fresh session with a warning when load is unsupported
@bb/provider-bridge-acp:test:      ↓ reports unexpected agent exits as a single provider error
@bb/provider-bridge-acp:test:      ↓ recovers after an external agent exit (load='0', failLoad='0', active=false)
@bb/provider-bridge-acp:test:      ↓ recovers after an external agent exit (load='1', failLoad='0', active=false)
@bb/provider-bridge-acp:test:      ↓ recovers after an external agent exit (load='1', failLoad='1', active=false)
@bb/provider-bridge-acp:test:      ↓ recovers after an external agent exit (load='0', failLoad='0', active=true)
@bb/provider-bridge-acp:test:      ↓ recovers after an external agent exit (load='1', failLoad='0', active=true)
@bb/provider-bridge-acp:test:      ↓ recovers after an external agent exit (load='1', failLoad='1', active=true)
@bb/provider-bridge-acp:test:      ↓ fails the interrupted turn and accepts the next message while an exited agent's process tree is still being cleaned up
@bb/provider-bridge-acp:test:      ↓ releases a session still under construction: the agent is reaped and the pending thread/start fails
@bb/provider-bridge-acp:test:      ↓ lets a retried thread/start supersede a construction still in flight for the same thread
@bb/provider-bridge-acp:test:      ↓ fails thread/start with a clear error when the agent command is missing
@bb/provider-bridge-acp:test:      ↓ rejects thread/start without an ACP launch spec
@bb/provider-bridge-acp:test: 
@bb/provider-bridge-acp:test: ⎯⎯⎯⎯⎯⎯⎯ Failed Tests 4 ⎯⎯⎯⎯⎯⎯⎯
@bb/provider-bridge-acp:test: 
@bb/provider-bridge-acp:test:  FAIL  |@bb/provider-bridge-acp:isolated| src/bridge/bridge.test.ts > acp bridge > issue 5051 applies live model choices through 'config-options'
@bb/provider-bridge-acp:test:  FAIL  |@bb/provider-bridge-acp:isolated| src/bridge/bridge.test.ts > acp bridge > issue 5051 applies live model choices through 'models-field'
@bb/provider-bridge-acp:test: AssertionError: expected [ 'selected-model:fake/strong', …(2) ] to deeply equal [ 'selected-model:fake/strong', …(2) ]
@bb/provider-bridge-acp:test: 
@bb/provider-bridge-acp:test: - Expected
@bb/provider-bridge-acp:test: + Received
@bb/provider-bridge-acp:test: 
@bb/provider-bridge-acp:test:   [
@bb/provider-bridge-acp:test:     "selected-model:fake/strong",
@bb/provider-bridge-acp:test: -   "selected-model:fake/default",
@bb/provider-bridge-acp:test: +   "selected-model:fake/strong",
@bb/provider-bridge-acp:test:     "selected-model:fake/strong",
@bb/provider-bridge-acp:test:   ]
@bb/provider-bridge-acp:test: 
@bb/provider-bridge-acp:test:  ❯ src/bridge/bridge.test.ts:1386:28
@bb/provider-bridge-acp:test:     1384|         requests.filter((request) => request.method === "session/load"…
@bb/provider-bridge-acp:test:     1385|       ).toHaveLength(0);
@bb/provider-bridge-acp:test:     1386|       expect(actualModels).toEqual([
@bb/provider-bridge-acp:test:        |                            ^
@bb/provider-bridge-acp:test:     1387|         "selected-model:fake/strong",
@bb/provider-bridge-acp:test:     1388|         "selected-model:fake/default",
@bb/provider-bridge-acp:test: 
@bb/provider-bridge-acp:test: ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/4]⎯
@bb/provider-bridge-acp:test: 
@bb/provider-bridge-acp:test:  FAIL  |@bb/provider-bridge-acp:isolated| src/bridge/bridge.test.ts > acp bridge > issue 5051 applies effort and tier changes without changing the model
@bb/provider-bridge-acp:test: AssertionError: expected [ 'selected-effort:low', …(1) ] to deeply equal [ 'selected-effort:high', …(1) ]
@bb/provider-bridge-acp:test: 
@bb/provider-bridge-acp:test: - Expected
@bb/provider-bridge-acp:test: + Received
@bb/provider-bridge-acp:test: 
@bb/provider-bridge-acp:test:   [
@bb/provider-bridge-acp:test: -   "selected-effort:high",
@bb/provider-bridge-acp:test: -   "selected-fast:true",
@bb/provider-bridge-acp:test: +   "selected-effort:low",
@bb/provider-bridge-acp:test: +   "selected-fast:false",
@bb/provider-bridge-acp:test:   ]
@bb/provider-bridge-acp:test: 
@bb/provider-bridge-acp:test:  ❯ src/bridge/bridge.test.ts:1428:28
@bb/provider-bridge-acp:test:     1426|       );
@bb/provider-bridge-acp:test:     1427|     }
@bb/provider-bridge-acp:test:     1428|     expect(actualSettings).toEqual([
@bb/provider-bridge-acp:test:        |                            ^
@bb/provider-bridge-acp:test:     1429|       "selected-effort:high",
@bb/provider-bridge-acp:test:     1430|       "selected-fast:true",
@bb/provider-bridge-acp:test: 
@bb/provider-bridge-acp:test: ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/4]⎯
@bb/provider-bridge-acp:test: 
@bb/provider-bridge-acp:test:  FAIL  |@bb/provider-bridge-acp:isolated| src/bridge/bridge.test.ts > acp bridge > issue 5051 preserves the current model choice when environment changes rebuild the agent
@bb/provider-bridge-acp:test: AssertionError: expected [ 'selected-model:fake/default' ] to include 'selected-model:fake/strong'
@bb/provider-bridge-acp:test:  ❯ src/bridge/bridge.test.ts:1453:33
@bb/provider-bridge-acp:test:     1451|     expect(response.error).toBeUndefined();
@bb/provider-bridge-acp:test:     1452|     await waitForTurnCompleted();
@bb/provider-bridge-acp:test:     1453|     expect(agentMessageTexts()).toContain("selected-model:fake/strong"…
@bb/provider-bridge-acp:test:        |                                 ^
@bb/provider-bridge-acp:test:     1454|   });
@bb/provider-bridge-acp:test:     1455|
@bb/provider-bridge-acp:test: 
@bb/provider-bridge-acp:test: ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[3/4]⎯
@bb/provider-bridge-acp:test: 
@bb/provider-bridge-acp:test: 
@bb/provider-bridge-acp:test:  Test Files  1 failed (1)
@bb/provider-bridge-acp:test:       Tests  4 failed | 128 skipped (132)
@bb/provider-bridge-acp:test:    Start at  20:58:24
@bb/provider-bridge-acp:test:    Duration  2.43s (transform 1.06s, setup 0ms, import 1.54s, tests 613ms, environment 0ms)
@bb/provider-bridge-acp:test: 
@bb/provider-bridge-acp:test:  ELIFECYCLE  Test failed. See above for more details.
@bb/provider-bridge-acp#test:  ERROR  command (<checkout-1>/packages/provider-bridge-acp) /usr/local/bin/pnpm run test src/bridge/bridge.test.ts -t issue 5051 exited (1)

 Tasks:    1 successful, 2 total
Cached:    0 cached, 2 total
  Time:    4.826s 
Failed:    @bb/provider-bridge-acp#test

 ERROR  run failed: command  exited (1)
Second clean reproduction run: exit 1
• turbo 2.10.12

   • Packages in scope: @bb/provider-bridge-acp
   • Running test in 1 packages
   • Remote caching disabled

//:ensure-native-modules: cache bypass, force executing 0cdc0850e9bf693c
//:ensure-native-modules: 
//:ensure-native-modules: > bb@ ensure-native-modules <checkout-2>
//:ensure-native-modules: > node scripts/ensure-native-modules.mjs
//:ensure-native-modules: 
@bb/provider-bridge-acp:test: cache miss, executing ac4a69d8455819a8
@bb/provider-bridge-acp:test: 
@bb/provider-bridge-acp:test: > @bb/provider-bridge-acp@0.0.1 test <checkout-2>/packages/provider-bridge-acp
@bb/provider-bridge-acp:test: > vitest run --config vitest.config.ts "src/bridge/bridge.test.ts" "-t" "issue 5051"
@bb/provider-bridge-acp:test: 
@bb/provider-bridge-acp:test: 
@bb/provider-bridge-acp:test:  RUN  v4.1.1 <checkout-2>/packages/provider-bridge-acp
@bb/provider-bridge-acp:test: 
@bb/provider-bridge-acp:test: (node:13283) ExperimentalWarning: SQLite is an experimental feature and might change at any time
@bb/provider-bridge-acp:test: (Use `node --trace-warnings ...` to show where the warning was created)
@bb/provider-bridge-acp:test:  ❯ |@bb/provider-bridge-acp:isolated| src/bridge/bridge.test.ts (132 tests | 4 failed | 128 skipped) 610ms
@bb/provider-bridge-acp:test:      ↓ answers initialize and lists grouped models without spawning an agent
@bb/provider-bridge-acp:test:      ↓ answers a minimal model/list (no params) with the synthetic default
@bb/provider-bridge-acp:test:      ↓ uses the CLI model list before ACP-native session discovery when both are present
@bb/provider-bridge-acp:test:      ↓ uses Cursor CLI variants as reasoning metadata for bare ACP models
@bb/provider-bridge-acp:test:      ↓ discovers ACP-native models and per-model reasoning from session configOptions
@bb/provider-bridge-acp:test:      ↓ keeps probing reasoning for later models after one model's probe fails
@bb/provider-bridge-acp:test:      ↓ advertises Cursor's parameterized model picker during discovery
@bb/provider-bridge-acp:test:      ↓ applies Cursor model parameters and maps 'default' to fast='false'
@bb/provider-bridge-acp:test:      ↓ applies Cursor model parameters and maps 'fast' to fast='true'
@bb/provider-bridge-acp:test:      ↓ translates a legacy Cursor model for thread/start session construction
@bb/provider-bridge-acp:test:      ↓ translates a legacy Cursor model for thread/resume session construction
@bb/provider-bridge-acp:test:      ↓ translates a legacy Cursor model for thread/fork session construction
@bb/provider-bridge-acp:test:      ↓ fails session construction when an advertised Fast selection is rejected
@bb/provider-bridge-acp:test:      ↓ leaves service tier untouched when the agent advertises no Fast option
@bb/provider-bridge-acp:test:      ↓ discovers ACP-native models from session models state
@bb/provider-bridge-acp:test:      ↓ advertises launch-time reasoning CLI levels on ACP-native models
@bb/provider-bridge-acp:test:      ↓ authenticates before ACP-native model discovery
@bb/provider-bridge-acp:test:      ↓ probes per-model reasoning across large catalogs instead of falling back
@bb/provider-bridge-acp:test:      ↓ times out hung ACP-native discovery, kills the child, and falls back to the synthetic model
@bb/provider-bridge-acp:test:      ↓ serves ACP-native discovered models from cache within the TTL and re-discovers after it
@bb/provider-bridge-acp:test:      ↓ falls back to the synthetic model when ACP-native session discovery has no model option
@bb/provider-bridge-acp:test:      ↓ fails model/list with a clear error when the list command is missing
@bb/provider-bridge-acp:test:      ↓ fails model/list when the list command reports ACP auth is required
@bb/provider-bridge-acp:test:      ↓ falls back to the synthetic model when the list command prints no models
@bb/provider-bridge-acp:test:      ↓ keeps CLI reasoning on the resolved model variant instead of ACP config
@bb/provider-bridge-acp:test:      ↓ sets native question availability only for 'opencode' sessions
@bb/provider-bridge-acp:test:      ↓ sets native question availability only for 'acp' sessions
@bb/provider-bridge-acp:test:      ↓ launches ACP agents with a configured reasoning CLI flag
@bb/provider-bridge-acp:test:      ↓ launches full-mode ACP agents with configured permission CLI args
@bb/provider-bridge-acp:test:      ↓ does not apply full-mode permission CLI args in workspace-write mode
@bb/provider-bridge-acp:test:      ↓ uses modelCli only for model selection when reasoningCli owns effort
@bb/provider-bridge-acp:test:      × issue 5051 applies live model choices through 'config-options' 179ms
@bb/provider-bridge-acp:test:      × issue 5051 applies live model choices through 'models-field' 149ms
@bb/provider-bridge-acp:test:      × issue 5051 applies effort and tier changes without changing the model 130ms
@bb/provider-bridge-acp:test:      × issue 5051 preserves the current model choice when environment changes rebuild the agent 149ms
@bb/provider-bridge-acp:test:      ↓ selects ACP-native models with session/set_config_option before the first prompt
@bb/provider-bridge-acp:test:      ↓ falls back to session/set_model when the model config option errors
@bb/provider-bridge-acp:test:      ↓ selects ACP-native models from session models state
@bb/provider-bridge-acp:test:      ↓ selects ACP-native reasoning with session/set_config_option before the first prompt
@bb/provider-bridge-acp:test:      ↓ applies configured native reasoning when the ACP agent does not advertise thought_level
@bb/provider-bridge-acp:test:      ↓ keeps ACP-native models without thought_level at the single managed level
@bb/provider-bridge-acp:test:      ↓ keeps reasoning empty when an ACP-native model advertises only unmapped thought levels
@bb/provider-bridge-acp:test:      ↓ shows configured native reasoning for ACP-native models without thought_level
@bb/provider-bridge-acp:test:      ↓ preserves Electron Node mode for the dynamic-tool MCP process only
@bb/provider-bridge-acp:test:      ↓ warns and launches the family id when a reasoning variant is missing
@bb/provider-bridge-acp:test:      ↓ starts a session and runs a prompt turn end to end
@bb/provider-bridge-acp:test:      ↓ rebuilds the agent with environment from a later turn
@bb/provider-bridge-acp:test:      ↓ authenticates ACP sessions with cached tokens when advertised
@bb/provider-bridge-acp:test:      ↓ prefers xAI API-key auth when XAI_API_KEY is available
@bb/provider-bridge-acp:test:      ↓ lets agents surface their own error for unsupported advertised auth methods
@bb/provider-bridge-acp:test:      ↓ keeps a non-auth session failure untyped when the agent advertises a login bb cannot perform
@bb/provider-bridge-acp:test:      ↓ keeps an agent exit during session/new untyped when the agent advertises a login bb cannot perform
@bb/provider-bridge-acp:test:      ↓ approves Cursor session MCP servers for the session lifetime (#2018)
@bb/provider-bridge-acp:test:      ↓ forwards ACP dynamic tool calls through the runtime tool-call contract
@bb/provider-bridge-acp:test:      ↓ cancels the runtime tool request after socket-close
@bb/provider-bridge-acp:test:      ↓ cancels the runtime tool request after provider-exit
@bb/provider-bridge-acp:test:      ↓ cancels the runtime tool request after turn-end
@bb/provider-bridge-acp:test:      ↓ keeps the dynamic-tool TCP server alive after a client reset on initialize
@bb/provider-bridge-acp:test:      ↓ lists skills/configure roots in canonical session instructions
@bb/provider-bridge-acp:test:      ↓ prepends instructions to the first prompt only
@bb/provider-bridge-acp:test:      ↓ auto-allows permission requests in full mode
@bb/provider-bridge-acp:test:      ↓ forwards permission requests to the runtime in ask mode
@bb/provider-bridge-acp:test:      ↓ presents an external-directory write permission as a file-change approval
@bb/provider-bridge-acp:test:      ↓ answers session-grant decisions with the allow_always option
@bb/provider-bridge-acp:test:      ↓ acknowledges fs add writes
@bb/provider-bridge-acp:test:      ↓ acknowledges fs update writes
@bb/provider-bridge-acp:test:      ↓ reconciles 'accept-edits' -> 'full' on 'turn/start' (CLI: false, load: false)
@bb/provider-bridge-acp:test:      ↓ reconciles 'accept-edits' -> 'full' on 'turn/start' (CLI: false, load: true)
@bb/provider-bridge-acp:test:      ↓ reconciles 'accept-edits' -> 'full' on 'turn/start' (CLI: true, load: false)
@bb/provider-bridge-acp:test:      ↓ reconciles 'accept-edits' -> 'full' on 'turn/start' (CLI: true, load: true)
@bb/provider-bridge-acp:test:      ↓ reconciles 'accept-edits' -> 'full' on 'turn/steer' (CLI: false, load: false)
@bb/provider-bridge-acp:test:      ↓ reconciles 'accept-edits' -> 'full' on 'turn/steer' (CLI: false, load: true)
@bb/provider-bridge-acp:test:      ↓ reconciles 'accept-edits' -> 'full' on 'turn/steer' (CLI: true, load: false)
@bb/provider-bridge-acp:test:      ↓ reconciles 'accept-edits' -> 'full' on 'turn/steer' (CLI: true, load: true)
@bb/provider-bridge-acp:test:      ↓ reconciles 'full' -> 'accept-edits' on 'turn/start' (CLI: false, load: false)
@bb/provider-bridge-acp:test:      ↓ reconciles 'full' -> 'accept-edits' on 'turn/start' (CLI: false, load: true)
@bb/provider-bridge-acp:test:      ↓ reconciles 'full' -> 'accept-edits' on 'turn/start' (CLI: true, load: false)
@bb/provider-bridge-acp:test:      ↓ reconciles 'full' -> 'accept-edits' on 'turn/start' (CLI: true, load: true)
@bb/provider-bridge-acp:test:      ↓ reconciles 'full' -> 'accept-edits' on 'turn/steer' (CLI: false, load: false)
@bb/provider-bridge-acp:test:      ↓ reconciles 'full' -> 'accept-edits' on 'turn/steer' (CLI: false, load: true)
@bb/provider-bridge-acp:test:      ↓ reconciles 'full' -> 'accept-edits' on 'turn/steer' (CLI: true, load: false)
@bb/provider-bridge-acp:test:      ↓ reconciles 'full' -> 'accept-edits' on 'turn/steer' (CLI: true, load: true)
@bb/provider-bridge-acp:test:      ↓ rejects simultaneous starts while reconciling unchanged permissions
@bb/provider-bridge-acp:test:      ↓ preserves stacked steers across permission CLI rebuilds
@bb/provider-bridge-acp:test:      ↓ reports a permission-changing steer whose replacement fails to start
@bb/provider-bridge-acp:test:      ↓ denies client fs writes outside the workspace in accept-edits mode
@bb/provider-bridge-acp:test:      ↓ allows canonical accept-edits writes into a configured extra write root
@bb/provider-bridge-acp:test:      ↓ keeps partial output from the cancelled prompt then continues
@bb/provider-bridge-acp:test:      ↓ rebuilds a stuck agent after a steer cancellation error (session/load=0)
@bb/provider-bridge-acp:test:      ↓ rebuilds a stuck agent after a steer cancellation error (session/load=1)
@bb/provider-bridge-acp:test:      ↓ delivers stacked steers on the same turn
@bb/provider-bridge-acp:test:      ↓ cancels a stacked steer prompt that also hangs
@bb/provider-bridge-acp:test:      ↓ runs the builtin /compact command as compaction, not as a prompt
@bb/provider-bridge-acp:test:      ↓ fails the compaction turn legibly when the agent rejects the request
@bb/provider-bridge-acp:test:      ↓ does not report an ACP refusal as successful compaction
@bb/provider-bridge-acp:test:      ↓ does not apply OMP compaction prose to 'generic' ACP
@bb/provider-bridge-acp:test:      ↓ does not apply OMP compaction prose to 'OpenCode' ACP
@bb/provider-bridge-acp:test:      ↓ fails the compaction turn when the agent reports the failure in an end-turn message
@bb/provider-bridge-acp:test:      ↓ completes a no-op compaction turn without reporting a compacted context
@bb/provider-bridge-acp:test:      ↓ keeps classifying a no-op compaction when the agent rewords its prose
@bb/provider-bridge-acp:test:      ↓ fails the compaction turn when the failure report is reworded or preceded by other text
@bb/provider-bridge-acp:test:      ↓ accepts turn input only after the prompt carrying it goes out
@bb/provider-bridge-acp:test:      ↓ never accepts a queued steer the stopped turn did not send
@bb/provider-bridge-acp:test:      ↓ rejects steers when no turn is active
@bb/provider-bridge-acp:test:      ↓ cancels the active turn on thread/stop
@bb/provider-bridge-acp:test:      ↓ settles the interrupted turn itself when the agent ignores session/cancel
@bb/provider-bridge-acp:test:      ↓ forks an advertised ACP session with the target cwd and MCP servers
@bb/provider-bridge-acp:test:      ↓ rejects a checkpoint fork before session/fork
@bb/provider-bridge-acp:test:      ↓ rejects a fork result that reuses the source session id
@bb/provider-bridge-acp:test:      ↓ rejects fork before session/fork when the agent omits the capability
@bb/provider-bridge-acp:test:      ↓ emits session.reset after identity at every construction (start, resume, fork)
@bb/provider-bridge-acp:test:      ↓ surfaces Grok context window size and prompt usage from session _meta
@bb/provider-bridge-acp:test:      ↓ ignores Grok-shaped session _meta on other ACP dialects
@bb/provider-bridge-acp:test:      ↓ holds an agent update written with the session/new response until thread/identity is out
@bb/provider-bridge-acp:test:      ↓ holds an agent update written with the session/fork response until the fork's thread/identity is out
@bb/provider-bridge-acp:test:      ↓ forwards context usage reported during session/load
@bb/provider-bridge-acp:test:      ↓ ignores load-time context usage for a different session
@bb/provider-bridge-acp:test:      ↓ discards load-time context usage when session/load fails
@bb/provider-bridge-acp:test:      ↓ re-applies ACP-native reasoning after session/load resume
@bb/provider-bridge-acp:test:      ↓ falls back to a fresh session with a warning when load is unsupported
@bb/provider-bridge-acp:test:      ↓ reports unexpected agent exits as a single provider error
@bb/provider-bridge-acp:test:      ↓ recovers after an external agent exit (load='0', failLoad='0', active=false)
@bb/provider-bridge-acp:test:      ↓ recovers after an external agent exit (load='1', failLoad='0', active=false)
@bb/provider-bridge-acp:test:      ↓ recovers after an external agent exit (load='1', failLoad='1', active=false)
@bb/provider-bridge-acp:test:      ↓ recovers after an external agent exit (load='0', failLoad='0', active=true)
@bb/provider-bridge-acp:test:      ↓ recovers after an external agent exit (load='1', failLoad='0', active=true)
@bb/provider-bridge-acp:test:      ↓ recovers after an external agent exit (load='1', failLoad='1', active=true)
@bb/provider-bridge-acp:test:      ↓ fails the interrupted turn and accepts the next message while an exited agent's process tree is still being cleaned up
@bb/provider-bridge-acp:test:      ↓ releases a session still under construction: the agent is reaped and the pending thread/start fails
@bb/provider-bridge-acp:test:      ↓ lets a retried thread/start supersede a construction still in flight for the same thread
@bb/provider-bridge-acp:test:      ↓ fails thread/start with a clear error when the agent command is missing
@bb/provider-bridge-acp:test:      ↓ rejects thread/start without an ACP launch spec
@bb/provider-bridge-acp:test: 
@bb/provider-bridge-acp:test: ⎯⎯⎯⎯⎯⎯⎯ Failed Tests 4 ⎯⎯⎯⎯⎯⎯⎯
@bb/provider-bridge-acp:test: 
@bb/provider-bridge-acp:test:  FAIL  |@bb/provider-bridge-acp:isolated| src/bridge/bridge.test.ts > acp bridge > issue 5051 applies live model choices through 'config-options'
@bb/provider-bridge-acp:test:  FAIL  |@bb/provider-bridge-acp:isolated| src/bridge/bridge.test.ts > acp bridge > issue 5051 applies live model choices through 'models-field'
@bb/provider-bridge-acp:test: AssertionError: expected [ 'selected-model:fake/strong', …(2) ] to deeply equal [ 'selected-model:fake/strong', …(2) ]
@bb/provider-bridge-acp:test: 
@bb/provider-bridge-acp:test: - Expected
@bb/provider-bridge-acp:test: + Received
@bb/provider-bridge-acp:test: 
@bb/provider-bridge-acp:test:   [
@bb/provider-bridge-acp:test:     "selected-model:fake/strong",
@bb/provider-bridge-acp:test: -   "selected-model:fake/default",
@bb/provider-bridge-acp:test: +   "selected-model:fake/strong",
@bb/provider-bridge-acp:test:     "selected-model:fake/strong",
@bb/provider-bridge-acp:test:   ]
@bb/provider-bridge-acp:test: 
@bb/provider-bridge-acp:test:  ❯ src/bridge/bridge.test.ts:1386:28
@bb/provider-bridge-acp:test:     1384|         requests.filter((request) => request.method === "session/load"…
@bb/provider-bridge-acp:test:     1385|       ).toHaveLength(0);
@bb/provider-bridge-acp:test:     1386|       expect(actualModels).toEqual([
@bb/provider-bridge-acp:test:        |                            ^
@bb/provider-bridge-acp:test:     1387|         "selected-model:fake/strong",
@bb/provider-bridge-acp:test:     1388|         "selected-model:fake/default",
@bb/provider-bridge-acp:test: 
@bb/provider-bridge-acp:test: ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/4]⎯
@bb/provider-bridge-acp:test: 
@bb/provider-bridge-acp:test:  FAIL  |@bb/provider-bridge-acp:isolated| src/bridge/bridge.test.ts > acp bridge > issue 5051 applies effort and tier changes without changing the model
@bb/provider-bridge-acp:test: AssertionError: expected [ 'selected-effort:low', …(1) ] to deeply equal [ 'selected-effort:high', …(1) ]
@bb/provider-bridge-acp:test: 
@bb/provider-bridge-acp:test: - Expected
@bb/provider-bridge-acp:test: + Received
@bb/provider-bridge-acp:test: 
@bb/provider-bridge-acp:test:   [
@bb/provider-bridge-acp:test: -   "selected-effort:high",
@bb/provider-bridge-acp:test: -   "selected-fast:true",
@bb/provider-bridge-acp:test: +   "selected-effort:low",
@bb/provider-bridge-acp:test: +   "selected-fast:false",
@bb/provider-bridge-acp:test:   ]
@bb/provider-bridge-acp:test: 
@bb/provider-bridge-acp:test:  ❯ src/bridge/bridge.test.ts:1428:28
@bb/provider-bridge-acp:test:     1426|       );
@bb/provider-bridge-acp:test:     1427|     }
@bb/provider-bridge-acp:test:     1428|     expect(actualSettings).toEqual([
@bb/provider-bridge-acp:test:        |                            ^
@bb/provider-bridge-acp:test:     1429|       "selected-effort:high",
@bb/provider-bridge-acp:test:     1430|       "selected-fast:true",
@bb/provider-bridge-acp:test: 
@bb/provider-bridge-acp:test: ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/4]⎯
@bb/provider-bridge-acp:test: 
@bb/provider-bridge-acp:test:  FAIL  |@bb/provider-bridge-acp:isolated| src/bridge/bridge.test.ts > acp bridge > issue 5051 preserves the current model choice when environment changes rebuild the agent
@bb/provider-bridge-acp:test: AssertionError: expected [ 'selected-model:fake/default' ] to include 'selected-model:fake/strong'
@bb/provider-bridge-acp:test:  ❯ src/bridge/bridge.test.ts:1453:33
@bb/provider-bridge-acp:test:     1451|     expect(response.error).toBeUndefined();
@bb/provider-bridge-acp:test:     1452|     await waitForTurnCompleted();
@bb/provider-bridge-acp:test:     1453|     expect(agentMessageTexts()).toContain("selected-model:fake/strong"…
@bb/provider-bridge-acp:test:        |                                 ^
@bb/provider-bridge-acp:test:     1454|   });
@bb/provider-bridge-acp:test:     1455|
@bb/provider-bridge-acp:test: 
@bb/provider-bridge-acp:test: ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[3/4]⎯
@bb/provider-bridge-acp:test: 
@bb/provider-bridge-acp:test: 
@bb/provider-bridge-acp:test:  Test Files  1 failed (1)
@bb/provider-bridge-acp:test:       Tests  4 failed | 128 skipped (132)
@bb/provider-bridge-acp:test:    Start at  21:00:26
@bb/provider-bridge-acp:test:    Duration  2.16s (transform 969ms, setup 0ms, import 1.35s, tests 610ms, environment 0ms)
@bb/provider-bridge-acp:test: 
@bb/provider-bridge-acp:test:  ELIFECYCLE  Test failed. See above for more details.
@bb/provider-bridge-acp#test:  ERROR  command (<checkout-2>/packages/provider-bridge-acp) /usr/local/bin/pnpm run test src/bridge/bridge.test.ts -t issue 5051 exited (1)

 Tasks:    1 successful, 2 total
Cached:    0 cached, 2 total
  Time:    3.845s 
Failed:    @bb/provider-bridge-acp#test

 ERROR  run failed: command  exited (1)
Unchanged existing bridge suite: exit 0
• turbo 2.10.12

   • Packages in scope: @bb/provider-bridge-acp
   • Running test in 1 packages
   • Remote caching disabled

//:ensure-native-modules: cache bypass, force executing cd2b52004dd07cab
//:ensure-native-modules: 
//:ensure-native-modules: > bb@ ensure-native-modules <checkout-2>
//:ensure-native-modules: > node scripts/ensure-native-modules.mjs
//:ensure-native-modules: 
//:ensure-native-modules: [ensure-native-modules] Detached hardlinked better-sqlite3 binary before verification
@bb/provider-bridge-acp:test: cache miss, executing e7742429aab2afdb
@bb/provider-bridge-acp:test: 
@bb/provider-bridge-acp:test: > @bb/provider-bridge-acp@0.0.1 test <checkout-2>/packages/provider-bridge-acp
@bb/provider-bridge-acp:test: > vitest run --config vitest.config.ts "src/bridge/bridge.test.ts"
@bb/provider-bridge-acp:test: 
@bb/provider-bridge-acp:test: 
@bb/provider-bridge-acp:test:  RUN  v4.1.1 <checkout-2>/packages/provider-bridge-acp
@bb/provider-bridge-acp:test: 
@bb/provider-bridge-acp:test: (node:11917) ExperimentalWarning: SQLite is an experimental feature and might change at any time
@bb/provider-bridge-acp:test: (Use `node --trace-warnings ...` to show where the warning was created)
@bb/provider-bridge-acp:test: acp bridge: ACP-native reasoning discovery for model "fake/strong" failed: model config probe failed
@bb/provider-bridge-acp:test: acp bridge: ACP-native model discovery for "/usr/local/bin/node" failed: ACP-native model discovery timed out after 30000ms
@bb/provider-bridge-acp:test: acp bridge: model list command "/usr/local/bin/node" printed no models
@bb/provider-bridge-acp:test: acp bridge: built "bb-bridge" session MCP config for thread "thread-17" (1 tools)
@bb/provider-bridge-acp:test: acp bridge: built "bb-bridge" session MCP config for thread "thread-26" (1 tools)
@bb/provider-bridge-acp:test: acp bridge: installed Cursor session MCP approval for thread "thread-26"
@bb/provider-bridge-acp:test: acp bridge: built "bb-bridge" session MCP config for thread "thread-27" (1 tools)
@bb/provider-bridge-acp:test: acp bridge: built "bb-bridge" session MCP config for thread "thread-28" (1 tools)
@bb/provider-bridge-acp:test: acp bridge: built "bb-bridge" session MCP config for thread "thread-29" (1 tools)
@bb/provider-bridge-acp:test: acp bridge: built "bb-bridge" session MCP config for thread "thread-30" (1 tools)
@bb/provider-bridge-acp:test: acp bridge: built "bb-bridge" session MCP config for thread "thread-31" (1 tools)
@bb/provider-bridge-acp:test: acp bridge: "bb-bridge" answered initialize for thread "thread-31" (1 tools)
@bb/provider-bridge-acp:test: acp bridge: built "bb-bridge" session MCP config for thread "thread-fork" (1 tools)
@bb/provider-bridge-acp:test:  ✓ |@bb/provider-bridge-acp:isolated| src/bridge/bridge.test.ts (128 tests) 19387ms
@bb/provider-bridge-acp:test:      ✓ settles the interrupted turn itself when the agent ignores session/cancel  4283ms
@bb/provider-bridge-acp:test:      ✓ fails the interrupted turn and accepts the next message while an exited agent's process tree is still being cleaned up  1189ms
@bb/provider-bridge-acp:test: 
@bb/provider-bridge-acp:test:  Test Files  1 passed (1)
@bb/provider-bridge-acp:test:       Tests  128 passed (128)
@bb/provider-bridge-acp:test:    Start at  20:59:43
@bb/provider-bridge-acp:test:    Duration  20.93s (transform 988ms, setup 0ms, import 1.35s, tests 19.39s, environment 0ms)
@bb/provider-bridge-acp:test: 

 Tasks:    2 successful, 2 total
Cached:    0 cached, 2 total
  Time:    22.524s 

Agent-generated reproduction report.