← reports

#8058 · Workflow selection skips per-model reasoning discovery

BugPriority: MediumEffort: Mediumproviders · provider-acp · workflowsGitHub issue

November 23, 2026 · trusted origin/main commit 02239e9e373fe8a74a75f91afbfb06016ed5a1ef

Verdict: REPRODUCED at the workflow plugin boundary · Root-cause confidence: high · reproduction label: confirmed-repro.

1. TL;DR

A workflow consults a model catalog before choosing a worker's reasoning level. When that catalog has not discovered a model's reasoning capabilities yet, the workflow treats the missing list as if discovery had already completed. An explicit high setting is rejected, while an inherited high setting launches a worker at the medium default without an error. Three focused regression cases reproduce these outcomes on trusted main in two separate clean checkouts; three corresponding pre-discovered catalog controls pass in each. This is a real workflow policy failure reproduced with an SDK transport fixture, not a claim that a live ACP process or the reporter's desktop environment was exercised.

2. Claims vs findings

ClaimStatusEvidence
Source validation rejects a supported explicit level while discovery is unknown.Verified at the workflow boundaryThe real prepareWorkflowSource rejects high with an unsupported-level error. The matching known-catalog control validates successfully.
Inherited high is silently replaced by medium.Verified at the worker-spawn boundaryThe actual service calls threads.spawn with medium and a null workflow error. The test expected high.
The runtime explicit-selection path also needs discovery.VerifiedThe actual service fails the run with Reasoning level "high" is not supported by codex/gpt-5 before spawning a worker.
A discovered catalog avoids the failure.Verified with controlsAll three cases pass when the same catalog initially contains medium and high. No app selection or CLI warm-up command was executed.
ACP can return unknown discovery and an empty capability list.Verified in trusted sourceThe ACP catalog's undiscovered-model branch sets unknown, an empty list, and default medium.
The reported desktop version and specific ACP agents reproduce end to end.Not separately verifiedNo desktop app, ACP process, live provider credentials, or original issue script was run.

3. Environment

4. Minimal reproduction

  1. Clone the trusted target and prepare the dependencies. The explicit SDK builds avoid clean-checkout plugin-build ordering failures; they do not change product source.
    git clone --branch main --single-branch https://github.com/get-bb/bb.git repro-checkout
    cd repro-checkout
    git checkout --detach 02239e9e373fe8a74a75f91afbfb06016ed5a1ef
    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. Save the complete patch below as /tmp/issue-8058.patch and apply it. It adds tests only, reusing the existing service fixture; no production change or dependency is needed.
    git apply /tmp/issue-8058.patch
    pnpm exec turbo run test --filter=bb-plugin-workflows -- src/service-policy.test.ts -t '8058 catalog discovery' --reporter=verbose
  3. Expected after a root-cause fix: six passing cases, all preserving a supported high setting. Actual on the trusted base: three unknown-catalog failures and three known-catalog passes, exit status 1. The inherited case reaches a worker spawn with medium, not high.
Complete reproducible regression patch
diff --git a/plugins/workflows/src/service-policy.test.ts b/plugins/workflows/src/service-policy.test.ts
index 6365685303..a5c99b5d74 100644
--- a/plugins/workflows/src/service-policy.test.ts
+++ b/plugins/workflows/src/service-policy.test.ts
@@ -22,6 +22,7 @@ import {
   DEFAULT_WORKFLOW_SETTINGS,
   type WorkflowSettings,
 } from "./settings.js";
+import { prepareWorkflowSource } from "./workflow-input.js";
 
 async function eventually(
   assertion: () => void | Promise<void>,
@@ -284,6 +285,93 @@ describe("workflow service policy integration", () => {
     harnesses.length = 0;
   });
 
+  it.each(
+    ["validation", "explicit", "inherited"].flatMap((surface) =>
+      [false, true].map((initiallyKnown) => ({ surface, initiallyKnown })),
+    ),
+  )(
+    "8058 catalog discovery $surface initiallyKnown=$initiallyKnown",
+    async ({ surface, initiallyKnown }) => {
+      const test = setup();
+      harnesses.push(test.harness);
+      let discovered = initiallyKnown;
+      test.harness.sdk.stub("providers.models", async (input) => {
+        if ("selectedModel" in input && input.selectedModel === "gpt-5") {
+          discovered = true;
+        }
+        return {
+          providers: [],
+          models: [
+            {
+              ...model(),
+              id: "gpt-5",
+              model: "gpt-5",
+              reasoningDiscovery: discovered ? "known" : "unknown",
+              supportedReasoningEfforts: discovered
+                ? [
+                    { reasoningEffort: "medium", description: "Standard" },
+                    { reasoningEffort: "high", description: "Extended" },
+                  ]
+                : [],
+            },
+          ],
+          selectedOnlyModels: [],
+          modelLoadError: null,
+        };
+      });
+      test.harness.sdk.stub("threads.defaultExecutionOptions", async () => ({
+        model: "gpt-5",
+        reasoningLevel: "high",
+        permissionMode: "full",
+        serviceTier: "default",
+        source: "default",
+      }));
+      const script = source(
+        surface === "inherited"
+          ? 'return await agent("inspect workspace");'
+          : 'return await agent("inspect workspace", { provider: "codex", model: "gpt-5", reasoningLevel: "high" });',
+      );
+      if (surface === "validation") {
+        await expect(
+          prepareWorkflowSource(
+            test.bb,
+            { projectId: "project-test", threadId: "origin" },
+            { script },
+          ),
+        ).resolves.toMatchObject({ validation: { valid: true } });
+        return;
+      }
+      const run = await test.start(script);
+      const controller = new AbortController();
+      const worker = test.service.runWorker(controller.signal);
+      try {
+        await eventually(() => {
+          expect(
+            test.childCount() > 0 ||
+              getRunRequired(test.db, run.id).status === "failed",
+          ).toBe(true);
+        });
+        expect(getRunRequired(test.db, run.id).error).toBeNull();
+        expect(test.harness.sdk.callsTo("threads.spawn")[0]?.[0]).toMatchObject(
+          {
+            model: "gpt-5",
+            reasoningLevel: "high",
+          },
+        );
+        expect(getCall(test.db, run.id, 0)).toMatchObject({
+          resolvedReasoningLevel: "high",
+        });
+        test.service.onThreadIdle("child-1", "completed");
+        await eventually(() =>
+          expect(getRunRequired(test.db, run.id).status).toBe("succeeded"),
+        );
+      } finally {
+        controller.abort();
+        await worker;
+      }
+    },
+  );
+
   it.each([
     {
       discovery: "known",

This patch is authored from trusted repository fixtures. It does not copy or execute an issue-supplied script or pull-request test. The provider SDK boundary is simulated intentionally; the workflow policy being asserted is real.

5. Root cause

  1. packages/provider-bridge-acp/src/bridge/model-catalog.ts:180-L200 gives undiscovered models reasoningDiscovery: "unknown", no supported levels, and default medium. That is meaningful pending state, not evidence of no reasoning support.
  2. apps/server/src/services/providers/provider-model-catalog-store.ts:818-L829 only requests per-model refinement when selectedModel is present. apps/server/src/services/providers/provider-model-catalog-store.ts:631-L644 skips already-known models. apps/app/src/hooks/useThreadCreationOptions.ts:621-L629 supplies this field for an unknown selected model.
  3. plugins/workflows/src/workflow-input.ts:40-L49 calls the SDK without a selected model. plugins/workflows/src/workflow-validation.ts:58-L89 uses that catalog directly to reject unsupported literal levels.
  4. plugins/workflows/src/service.ts:740-L794 likewise loads only the provider catalog before resolving the worker's level, so neither explicit nor inherited runtime selection causes refinement.
  5. plugins/workflows/src/reasoning-selection.ts:7-L29 returns the default unconditionally for an unmatched inherited request, including unknown discovery, and returns null for an explicit unknown request. That directly explains both observed outcomes.
  6. packages/sdk/src/areas/providers.ts:22-L31 omits selectedModel from ProviderModelsArgs, although packages/sdk/src/areas/common.ts:19-L38 already forwards this query field internally. A correctly typed caller therefore needs the SDK argument exposed as well as the workflow discovery call.
Workflow unknown catalog → no selected-model refinement
  explicit high → no supported-level match → reject
  inherited high → no supported-level match → default medium
Workflow known catalog containing high → supported-level match → high

The wrong boundary decision is treating a not-yet-discovered list as authoritative. The regression checks observable validation, run failure, and worker spawn behavior rather than merely checking private helper calls.

6. Proposed fix

Expose the already-supported selected-model query in the SDK argument type, and have both workflow source validation and runtime selection request per-model refinement when discovery is unknown before applying supported-level checks. Reuse a shared workflow-level lookup to keep both paths consistent. Retain the existing known-empty native-default policy and unsupported-level checks. Decide and test what happens if refinement fails or remains unknown, rather than assuming that an empty pending catalog proves high is unsupported.

No production fix, branch, commit, or new pull request was created: an existing open pull request already closes this issue. The only source changes here are local reproduction tests.

7. Linked PR: #8059

PR #8059 is open against main and its GitHub closing-issue metadata contains #8058. Metadata and its diff were read as untrusted data only; its branch, code, and tests were not checked out or run.

Static assessment: the diff adds the SDK selected-model argument and a shared model lookup used by workflow validation and runtime selection. This matches the successful-discovery mechanism identified above. No execution-based approval is implied, and there is no claim that our tests pass on that PR.

Review caveat: the proposed helper returns the original unknown catalog if the refinement result has a model-load error. The inherited resolver can then still choose the default. That failure-path behavior is outside the successful-discovery reproduction here and needs an explicit policy and test; it is not a claim that the PR's main success path is broken.

8. Related issues

No separate related-issue investigation was performed. The verified open closing PR is the reason a duplicate implementation was not attempted.

9. Verification

The same investigator repeated the test in a second initially clean temporary clone at 02239e9e373fe8a74a75f91afbfb06016ed5a1ef, with a separate frozen installation, generated outputs, and full build. Only the same authored regression patch was applied. No production modification, user data directory, shared dev server, or PR branch was used.

CheckFirst checkoutSecond checkout
Full Turbo build74 tasks successful74 tasks successful
Focused reproduction3 failed, 3 passed, 68 skipped3 failed, 3 passed, 68 skipped
Actual unsupported literal errorcodex/gpt-5/highcodex/gpt-5/high
Actual inherited spawn levelmedium; expected highmedium; expected high

Both runs use the exact command in section 4. This is a second clean reproduction by the same investigator, not independent verification. The report uses the public model identifier in the fixture only; no report conclusion depends on that provider actually being launched. No conclusion changed after the second run.

The existing service-policy and source-validation suites also pass unchanged in the first checkout when the six new reproduction cases are excluded: 75 passed, 6 skipped, across two files. Command:

pnpm exec turbo run test --filter=bb-plugin-workflows -- src/service-policy.test.ts src/workflow-validation.test.ts -t '^(?!.*8058 catalog discovery)'

10. Appendix: actual failure output

Below are the actual final test outputs with only temporary checkout paths normalized. Raw local logs and reproduction artifacts remain outside the public reports repository. Initial broad builds encountered missing SDK declaration/runtime artifacts; after the explicit SDK preparation commands, the complete builds succeeded. These build-order failures are not counted as product reproduction evidence.

First checkout

bb-plugin-workflows:test:  FAIL  |bb-plugin-workflows| src/service-policy.test.ts > workflow service policy integration > 8058 catalog discovery 'validation' initiallyKnown=false
bb-plugin-workflows:test: AssertionError: promise rejected "Error: Unsupported reasoning level for li…" instead of resolving
bb-plugin-workflows:test:  ❯ src/service-policy.test.ts:341:10
bb-plugin-workflows:test:     339|             { script },
bb-plugin-workflows:test:     340|           ),
bb-plugin-workflows:test:     341|         ).resolves.toMatchObject({ validation: { valid: true } });
bb-plugin-workflows:test:        |          ^
bb-plugin-workflows:test:     342|         return;
bb-plugin-workflows:test:     343|       }
bb-plugin-workflows:test: 
bb-plugin-workflows:test: Caused by: Error: Unsupported reasoning level for literal workflow selection codex/gpt-5/high
bb-plugin-workflows:test:  ❯ validateWorkflowSource src/workflow-validation.ts:88:15
bb-plugin-workflows:test:  ❯ prepareWorkflowSource src/workflow-input.ts:40:22
bb-plugin-workflows:test:  ❯ src/service-policy.test.ts:335:9
bb-plugin-workflows:test: 
bb-plugin-workflows:test: ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/3]⎯
bb-plugin-workflows:test: 
bb-plugin-workflows:test:  FAIL  |bb-plugin-workflows| src/service-policy.test.ts > workflow service policy integration > 8058 catalog discovery 'explicit' initiallyKnown=false
bb-plugin-workflows:test: AssertionError: expected 'Reasoning level "high" is not support…' to be null
bb-plugin-workflows:test: 
bb-plugin-workflows:test: - Expected:
bb-plugin-workflows:test: null
bb-plugin-workflows:test: 
bb-plugin-workflows:test: + Received:
bb-plugin-workflows:test: "Reasoning level \"high\" is not supported by codex/gpt-5"
bb-plugin-workflows:test: 
bb-plugin-workflows:test:  ❯ src/service-policy.test.ts:354:55
bb-plugin-workflows:test:     352|           ).toBe(true);
bb-plugin-workflows:test:     353|         });
bb-plugin-workflows:test:     354|         expect(getRunRequired(test.db, run.id).error).toBeNull();
bb-plugin-workflows:test:        |                                                       ^
bb-plugin-workflows:test:     355|         expect(test.harness.sdk.callsTo("threads.spawn")[0]?.[0]).toMa…
bb-plugin-workflows:test:     356|           {
bb-plugin-workflows:test: 
bb-plugin-workflows:test: ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/3]⎯
bb-plugin-workflows:test: 
bb-plugin-workflows:test:  FAIL  |bb-plugin-workflows| src/service-policy.test.ts > workflow service policy integration > 8058 catalog discovery 'inherited' initiallyKnown=false
bb-plugin-workflows:test: AssertionError: expected { …(13) } to match object { model: 'gpt-5', …(1) }
bb-plugin-workflows:test: (17 matching properties omitted from actual)
bb-plugin-workflows:test: 
bb-plugin-workflows:test: - Expected
bb-plugin-workflows:test: + Received
bb-plugin-workflows:test: 
bb-plugin-workflows:test:   {
bb-plugin-workflows:test:     "model": "gpt-5",
bb-plugin-workflows:test: -   "reasoningLevel": "high",
bb-plugin-workflows:test: +   "reasoningLevel": "medium",
bb-plugin-workflows:test:   }
bb-plugin-workflows:test: 
bb-plugin-workflows:test:  ❯ src/service-policy.test.ts:355:67
bb-plugin-workflows:test:     353|         });
bb-plugin-workflows:test:     354|         expect(getRunRequired(test.db, run.id).error).toBeNull();
bb-plugin-workflows:test:     355|         expect(test.harness.sdk.callsTo("threads.spawn")[0]?.[0]).toMa…
bb-plugin-workflows:test:        |                                                                   ^
bb-plugin-workflows:test:     356|           {
bb-plugin-workflows:test:     357|             model: "gpt-5",
bb-plugin-workflows:test: 
bb-plugin-workflows:test: ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[3/3]⎯
bb-plugin-workflows:test: 
bb-plugin-workflows:test: 
bb-plugin-workflows:test:  Test Files  1 failed (1)
bb-plugin-workflows:test:       Tests  3 failed | 3 passed | 68 skipped (74)
bb-plugin-workflows:test:    Start at  22:25:57
bb-plugin-workflows:test:    Duration  889ms (transform 327ms, setup 0ms, import 605ms, tests 142ms, environment 0ms)
bb-plugin-workflows:test: 
bb-plugin-workflows:test:  ELIFECYCLE  Test failed. See above for more details.
bb-plugin-workflows#test:  ERROR  command (/tmp/repro-checkout-first/plugins/workflows) /usr/local/bin/pnpm run test src/service-policy.test.ts -t 8058 catalog discovery --reporter=verbose exited (1)

 Tasks:    6 successful, 7 total
Cached:    5 cached, 7 total
  Time:    2.517s 
Failed:    bb-plugin-workflows#test

 ERROR  run failed: command  exited (1)

Second checkout

bb-plugin-workflows:test:  FAIL  |bb-plugin-workflows| src/service-policy.test.ts > workflow service policy integration > 8058 catalog discovery 'validation' initiallyKnown=false
bb-plugin-workflows:test: AssertionError: promise rejected "Error: Unsupported reasoning level for li…" instead of resolving
bb-plugin-workflows:test:  ❯ src/service-policy.test.ts:341:10
bb-plugin-workflows:test:     339|             { script },
bb-plugin-workflows:test:     340|           ),
bb-plugin-workflows:test:     341|         ).resolves.toMatchObject({ validation: { valid: true } });
bb-plugin-workflows:test:        |          ^
bb-plugin-workflows:test:     342|         return;
bb-plugin-workflows:test:     343|       }
bb-plugin-workflows:test: 
bb-plugin-workflows:test: Caused by: Error: Unsupported reasoning level for literal workflow selection codex/gpt-5/high
bb-plugin-workflows:test:  ❯ validateWorkflowSource src/workflow-validation.ts:88:15
bb-plugin-workflows:test:  ❯ prepareWorkflowSource src/workflow-input.ts:40:22
bb-plugin-workflows:test:  ❯ src/service-policy.test.ts:335:9
bb-plugin-workflows:test: 
bb-plugin-workflows:test: ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/3]⎯
bb-plugin-workflows:test: 
bb-plugin-workflows:test:  FAIL  |bb-plugin-workflows| src/service-policy.test.ts > workflow service policy integration > 8058 catalog discovery 'explicit' initiallyKnown=false
bb-plugin-workflows:test: AssertionError: expected 'Reasoning level "high" is not support…' to be null
bb-plugin-workflows:test: 
bb-plugin-workflows:test: - Expected:
bb-plugin-workflows:test: null
bb-plugin-workflows:test: 
bb-plugin-workflows:test: + Received:
bb-plugin-workflows:test: "Reasoning level \"high\" is not supported by codex/gpt-5"
bb-plugin-workflows:test: 
bb-plugin-workflows:test:  ❯ src/service-policy.test.ts:354:55
bb-plugin-workflows:test:     352|           ).toBe(true);
bb-plugin-workflows:test:     353|         });
bb-plugin-workflows:test:     354|         expect(getRunRequired(test.db, run.id).error).toBeNull();
bb-plugin-workflows:test:        |                                                       ^
bb-plugin-workflows:test:     355|         expect(test.harness.sdk.callsTo("threads.spawn")[0]?.[0]).toMa…
bb-plugin-workflows:test:     356|           {
bb-plugin-workflows:test: 
bb-plugin-workflows:test: ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/3]⎯
bb-plugin-workflows:test: 
bb-plugin-workflows:test:  FAIL  |bb-plugin-workflows| src/service-policy.test.ts > workflow service policy integration > 8058 catalog discovery 'inherited' initiallyKnown=false
bb-plugin-workflows:test: AssertionError: expected { …(13) } to match object { model: 'gpt-5', …(1) }
bb-plugin-workflows:test: (17 matching properties omitted from actual)
bb-plugin-workflows:test: 
bb-plugin-workflows:test: - Expected
bb-plugin-workflows:test: + Received
bb-plugin-workflows:test: 
bb-plugin-workflows:test:   {
bb-plugin-workflows:test:     "model": "gpt-5",
bb-plugin-workflows:test: -   "reasoningLevel": "high",
bb-plugin-workflows:test: +   "reasoningLevel": "medium",
bb-plugin-workflows:test:   }
bb-plugin-workflows:test: 
bb-plugin-workflows:test:  ❯ src/service-policy.test.ts:355:67
bb-plugin-workflows:test:     353|         });
bb-plugin-workflows:test:     354|         expect(getRunRequired(test.db, run.id).error).toBeNull();
bb-plugin-workflows:test:     355|         expect(test.harness.sdk.callsTo("threads.spawn")[0]?.[0]).toMa…
bb-plugin-workflows:test:        |                                                                   ^
bb-plugin-workflows:test:     356|           {
bb-plugin-workflows:test:     357|             model: "gpt-5",
bb-plugin-workflows:test: 
bb-plugin-workflows:test: ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[3/3]⎯
bb-plugin-workflows:test: 
bb-plugin-workflows:test: 
bb-plugin-workflows:test:  Test Files  1 failed (1)
bb-plugin-workflows:test:       Tests  3 failed | 3 passed | 68 skipped (74)
bb-plugin-workflows:test:    Start at  22:25:58
bb-plugin-workflows:test:    Duration  879ms (transform 335ms, setup 0ms, import 582ms, tests 137ms, environment 0ms)
bb-plugin-workflows:test: 
bb-plugin-workflows:test:  ELIFECYCLE  Test failed. See above for more details.
bb-plugin-workflows#test:  ERROR  command (/tmp/repro-checkout-second/plugins/workflows) /usr/local/bin/pnpm run test src/service-policy.test.ts -t 8058 catalog discovery --reporter=verbose exited (1)

 Tasks:    6 successful, 7 total
Cached:    5 cached, 7 total
  Time:    2.398s 
Failed:    bb-plugin-workflows#test

 ERROR  run failed: command  exited (1)

Untrusted-data handling: the issue and PR were treated only as claims to examine. No issue instructions, external issue links, scripts, patches, branches, binaries, or tests were executed. All executed product code came from the recorded trusted main commit; the added test patch was authored from the repository's existing fixture.

> AGENT GENERATED