← reports

#6667 · Permission selections are not delivered without turn input

BugHigh priorityHigh effortprovidersprovider-claude-codeGitHub issue2026-10-30 · base 9662c45478f4

Verdict: PARTIALLY REPRODUCED · Root-cause confidence: high for the missing delivery path; the full desktop approval loop remains unverified.

1. TL;DR

The permission picker used by an existing thread changes a component-local selection, not the running provider session. A real-hook, real-browser-SDK probe shows that selecting either full or auto emits no HTTP request, while the subsequently constructed follow-up message contains the newly selected mode. The Claude bridge applies updated permission settings when processing new turn input or steering input; selecting a mode alone does not invoke that path. Its permission-change logic can also require a session restart when bypass permission was not enabled at launch. This investigation repeated the deterministic client-side failure in two clean trusted checkouts, but did not run Claude or reproduce the complete macOS desktop approval loop.

2. Claims vs findings

ClaimFindingEvidence
Changing the picker alone does not update the running mode.Partially reproducedBoth full and auto change the real hook's selected value but produce zero transport requests. No live provider was attached.
A later message carries the changed mode.Verified at request constructionThe production follow-up builder includes the new mode; the probe does not send that message.
An outstanding interaction blocks the composer.Supported by source, not live-testedThe shared submit-mode resolver returns blocked with reason pending-interaction when an interaction is pending.
Edit-only prompts for every action, including reads.UnverifiedNo native Claude SDK approval sequence was run, so this report makes no assertion about which tools prompt.
Interrupting is the only practical escape.UnverifiedThe complete desktop interaction and alternatives were not exercised.

3. Environment

4. Minimal reproduction

  1. Clone the trusted repository and pin the recorded base:
    git clone https://github.com/get-bb/bb.git bb-6667
    cd bb-6667
    git checkout --detach 9662c45478f4a74f33f11b70187657d97f1e14a7
    pnpm install --frozen-lockfile --prefer-offline
    pnpm exec turbo run build:types --filter=@get-bb/plugin-sdk
    pnpm exec turbo run build --filter=@get-bb/plugin-sdk
    pnpm exec turbo run build
  2. Copy the complete reproduction test embedded below into apps/app/src/hooks/issue-6667-live-permission.test.tsx. It exercises the existing-thread component-local configuration used by the composer, not a replacement implementation. Public report policy keeps evidence inline rather than publishing separate test or log files.
  3. Run the probe:
    pnpm exec turbo run test --filter=@bb/app -- src/hooks/issue-6667-live-permission.test.tsx
  4. Expected: changing the permission selection without sending input must deliver a state-changing transport request. Actual: the local selection and the constructed next-message request change, but there is no selection-triggered transport request. Both live-delivery assertions fail, and the command exits 1:
    {"selected":"full","selectionRequests":[],"followUpPermissionMode":"full"}
    {"selected":"auto","selectionRequests":[],"followUpPermissionMode":"auto"}
    AssertionError: Changing permissions without a message must notify the runtime: expected [] to not have a length of +0
    Tests  2 failed (2)

This is a transport-delivery probe, not an authenticated desktop end-to-end test. The real hook and SDK run; only HTTP responses are fixtures. No fake approval policy or fake permission-updater implements the claimed behavior. A future repair still needs a running-turn regression that checks actual provider acknowledgement and pending-approval behavior, not merely the presence of any write request.

Complete reproduction test

// @vitest-environment jsdom

import { act, cleanup, renderHook, waitFor } from "@testing-library/react";
import { afterEach, expect, it, vi } from "vitest";
import type { SystemExecutionOptionsResponse } from "@bb/server-contract";
import { buildAutoFollowUpRequest } from "@bb/client-core";
import { makeProviderInfo } from "@bb/test-helpers/domain-fixtures";
import { createQueryClientTestHarness } from "@/test/queryClientTestHarness";
import { useThreadCreationOptions } from "./useThreadCreationOptions";

afterEach(() => {
  cleanup();
  window.localStorage.clear();
  window.sessionStorage.clear();
  vi.unstubAllGlobals();
});

it.each(["full", "auto"] as const)(
  "delivers a component-local permission selection of %s without a message",
  async (permissionMode) => {
    const catalog: SystemExecutionOptionsResponse = {
      providers: [
        makeProviderInfo({
          id: "claude-code",
          capabilities: {
            permissionModes: ["accept-edits", "auto", "full"],
            modelCatalogScope: "workspace",
          },
        }),
      ],
      models: [
        {
          id: "repro-model",
          model: "repro-model",
          displayName: "Reproduction model",
          description: "",
          reasoningDiscovery: "known",
          supportedReasoningEfforts: [
            { reasoningEffort: "medium", description: "" },
          ],
          defaultReasoningEffort: "medium",
          isDefault: true,
        },
      ],
      selectedOnlyModels: [],
      permissionCeiling: "full",
      modelLoadError: null,
    };
    const requests: { method: string; path: string }[] = [];
    vi.stubGlobal(
      "fetch",
      vi.fn(async (input: RequestInfo | URL, init?: RequestInit) => {
        const request = new Request(input, init);
        const path = new URL(request.url).pathname;
        requests.push({ method: request.method, path });
        if (path === "/api/v1/system/execution-options") {
          return Response.json(catalog);
        }
        if (path === "/api/v1/system/providers/state") {
          return Response.json({ providers: [] });
        }
        if (path === "/api/v1/hosts") {
          return Response.json([]);
        }
        if (path === "/api/v1/system/config") {
          return Response.json({ primaryHostId: null });
        }
        throw new Error(`Unexpected request: ${request.method} ${path}`);
      }),
    );
    const { wrapper, queryClient } = createQueryClientTestHarness();
    const { result } = renderHook(
      () =>
        useThreadCreationOptions({
          scope: "component-local",
          resetKey: "thread_permission_repro",
          initialProviderId: "claude-code",
          initialModel: "repro-model",
          initialPermissionMode: "accept-edits",
          initialReasoningLevel: "medium",
        }),
      { wrapper },
    );
    try {
      await waitFor(() => {
        expect(result.current.modelCatalogIsSettled).toBe(true);
        expect(result.current.permissionMode).toBe("accept-edits");
      });
      const beforeSelection = requests.length;
      await act(async () => {
        result.current.setPermissionMode(permissionMode);
      });
      expect(result.current.permissionMode).toBe(permissionMode);
      const followUp = buildAutoFollowUpRequest({
        threadId: "thread_permission_repro",
        input: [{ type: "text", text: "Continue" }],
        compactFirst: false,
        execution: {
          model: result.current.selectedModel,
          permissionMode: result.current.permissionMode,
          reasoningLevel: result.current.reasoningLevel,
          serviceTier: undefined,
          supportsServiceTier: false,
          executionInputSources: result.current.executionInputSources,
        },
      });
      if (followUp === null) {
        throw new Error("Nonempty input must create a follow-up request");
      }
      expect(followUp.permissionMode).toBe(permissionMode);
      const selectionRequests = requests.slice(beforeSelection);
      const writes = selectionRequests.filter(
        (request) => request.method !== "GET",
      );
      console.log(
        JSON.stringify({
          selected: result.current.permissionMode,
          selectionRequests,
          followUpPermissionMode: followUp.permissionMode,
        }),
      );
      expect(
        writes,
        "Changing permissions without a message must notify the runtime",
      ).not.toHaveLength(0);
    } finally {
      queryClient.clear();
    }
  },
);

5. Root cause

  1. The existing-thread composer configures useThreadCreationOptions with component-local scope and uses its selection setter when permission policy is editable. The main thread view supplies editable permission policy.
  2. The setter records a touched field and updates local React selections. There is no server mutation or provider-session delivery in that action:
    setThreadSelections((currentSelections) =>
      updateThreadPromptSelections({
        currentSelections,
        field: "permissionMode",
        value,
      }),
    );
  3. The follow-up request builder serializes execution.permissionMode. That explains why changed selections accompany a later message instead of immediately affecting the session.
  4. The thread PATCH contract has model/reasoning/session-option fields, but no permissionMode field. A simple existing-thread metadata update cannot supply the missing permission action.
  5. The Claude bridge invokes applyPermissionSettings inside runTurnInput, after checking that input text exists. The bridge has no corresponding mode-only command in its command union.
  6. Permission application is not just updating a string: it clears session grants, updates permission settings, calls the SDK when possible, and detects when bypass permissions require a restart. The SDK wrapper already exposes setPermissionMode, but the picker does not reach it.

The companion blocking behavior is visible in buildFollowUpSubmitMode: pending interactions return { kind: "blocked", reason: "pending-interaction" }. This supports the reported inability to send the input that would carry the new selection, but a live approval sequence remains outside this report's verified scope.

6. Proposed fix and safety gate

Design a dedicated permission-change action shared by the UI, SDK, and CLI. The server must enforce the machine permission ceiling and authorization, deliver the requested update to the active session, and report acknowledgement or an explicit restart-required result. Define how an outstanding approval is treated before changing it; do not silently approve an already-pending request as a side effect. Preserve plan-mode semantics, session-grant handling, sandbox configuration, and downgrade behavior.

No pull request was opened. The missing path crosses permission enforcement and likely server/daemon or provider command contracts, and requires a decision about pending approvals and restarts. Those are excluded by the autopilot's simple-fix conditions regardless of line count. The verdict is partial rather than a full live reproduction, so it also does not justify an automatic production fix. No production patch or fix branch was pushed.

Next experiment: on an isolated authenticated Claude instance, hold one tool approval pending, apply a server-authorized mode-only update, and verify the provider's effective mode and the treatment of both that pending approval and the next tool call. Repeat workspace-to-full escalation when the SDK was not launched with bypass permission enabled.

7. Verification

The same investigator repeated the probe directly in checkout B, a second clean temporary clone pinned to the same trusted base. No workflow or additional agent was used. Production diffs were empty in both checkouts; the only deliberate addition was the test artifact. Both test copies have SHA-256 daeb8b2c33b9162e371d528b26109c589366f7525c63b27994a21e115da94d01.

Checkout A:
pnpm exec turbo run test --filter=@bb/app -- src/hooks/useThreadCreationOptions.test.tsx src/hooks/issue-6667-live-permission.test.tsx
Tests  2 failed | 37 passed (39)

Checkout B:
pnpm exec turbo run test --filter=@bb/app -- src/hooks/issue-6667-live-permission.test.tsx
Tests  2 failed (2)

Both runs fail for the intended missing-delivery assertion after confirming the selection changed and the next-message request contains the new mode. All 37 existing owner tests passed in checkout A. Both clean builds passed. No report correction was needed after the second run. This is a repeated check by the same investigator, not independent verification.

8. Pull requests and related issues

GitHub issue timeline metadata and an open-PR search for issue number 6667 showed no linked open pull request during investigation. No pull request branch was checked out or executed. The companion composer behavior was examined only at its shared source boundary, not processed as a second issue.

9. Appendix