@devries-cameron20 / t3code-1 / commits / 53ef45feac
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

fix(clients): subagent bar stops guessing the subagent's effort (#15710)

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com> Co-authored-by: Julius Marminge <julius0216@outlook.com>

fixfon committed Oct 19, 2026 at 23:18 UTC 53ef45feac9a3b88dfb773433c3a007034f0d093
3 files changed +54 -13
packages/client-runtime/src/state/threadExecution.test.ts
+32 -9
@@ -464,20 +464,43 @@ describe("formatModelSelectionEffort", () => {
464 },
465 ];
466
467 - it("shows the model's default effort when the user never picked one", () => {
468 - expect(formatModelSelectionEffort(selection(), catalog({}))).toBe("High");
469 - });
470 -
471 - it("names a stored effort the way the catalog does", () => {
467 + it("names stored and matching reported effort, preferring the stored choice", () => {
468 expect(
469 formatModelSelectionEffort(selection([{ id: "effort", value: "xhigh" }]), catalog({})),
470 ).toBe("Extra High");
471 + const reported = selection([{ id: "effort", value: "xhigh" }]);
472 + expect(formatModelSelectionEffort(selection(), catalog({}), reported)).toBe("Extra High");
473 + expect(
474 + formatModelSelectionEffort(
475 + selection([{ id: "effort", value: "medium" }]),
476 + catalog({}),
477 + reported,
478 + ),
479 + ).toBe("Medium");
480 + expect(
481 + formatModelSelectionEffort(
482 + selection([{ id: "effort", value: "retired-effort" }]),
483 + catalog({ currentValue: "medium" }),
484 + reported,
485 + ),
486 + ).toBeNull();
487 });
488
477 - it("uses the descriptor's current value over the default", () => {
478 - expect(formatModelSelectionEffort(selection(), catalog({ currentValue: "medium" }))).toBe(
479 - "Medium",
480 - );
489 + it("shows nothing when neither the selection nor the provider states an effort", () => {
490 + expect(formatModelSelectionEffort(selection(), catalog({}))).toBeNull();
491 + expect(formatModelSelectionEffort(selection(), catalog({ currentValue: "medium" }))).toBeNull();
492 + expect(
493 + formatModelSelectionEffort(selection(), catalog({}), {
494 + ...selection([{ id: "effort", value: "xhigh" }]),
495 + model: "claude-opus-5-5",
496 + }),
497 + ).toBeNull();
498 + expect(
499 + formatModelSelectionEffort(selection(), catalog({}), {
500 + ...selection([{ id: "effort", value: "xhigh" }]),
501 + instanceId: ProviderInstanceId.make("claudeAgent-other"),
502 + }),
503 + ).toBeNull();
504 });
505
506 it("shows nothing for a model the catalog does not describe", () => {
packages/client-runtime/src/state/threadExecution.ts
+11 -4
@@ -22,7 +22,7 @@ import {
22 backgroundWorkHoldsCompletion,
23 derivePendingBackgroundWork,
24 } from "@t3tools/shared/orchestrationV2PendingBackgroundWork";
25 -import { getProviderOptionCurrentLabel, getProviderOptionDescriptors } from "@t3tools/shared/model";
25 +import { getProviderOptionCurrentLabel, getProviderOptionStatedValue } from "@t3tools/shared/model";
26 import { formatDuration } from "@t3tools/shared/orchestrationTiming";
27 import * as DateTime from "effect/DateTime";
28
@@ -160,11 +160,18 @@ export function formatModelSelectionEffort(
160 ): string | null {
161 const caps = models.find((model) => model.slug === selection.model)?.capabilities;
162 if (!caps) return null;
163 - const descriptors = getProviderOptionDescriptors({ caps, selections: selection.options });
163 for (const id of REASONING_EFFORT_OPTION_IDS) {
165 - const descriptor = descriptors.find((candidate) => candidate.id === id);
164 + const descriptor = caps.optionDescriptors?.find((candidate) => candidate.id === id);
165 if (descriptor?.type !== "select") continue;
167 - const label = getProviderOptionCurrentLabel(descriptor, selection, reportedSelection);
166 + const value = getProviderOptionStatedValue(id, selection, reportedSelection);
167 + if (value === undefined && id !== "variant") continue;
168 + if (typeof value === "boolean") continue;
169 + // Bypass picker normalization so an obsolete choice cannot become a catalog default.
170 + const label = getProviderOptionCurrentLabel(
171 + { ...descriptor, currentValue: value },
172 + selection,
173 + reportedSelection,
174 + );
175 if (label) return label;
176 }
177 return null;
packages/shared/src/model.ts
+11
@@ -213,6 +213,17 @@ function getReportedOptionValue(
213 return getRawSelectionValueById(reportedSelection.options, id);
214 }
215
216 +export function getProviderOptionStatedValue(
217 + id: string,
218 + selection?: ModelSelection | null,
219 + reportedSelection?: ModelSelection | null,
220 +) {
221 + return (
222 + getRawSelectionValueById(selection?.options, id) ??
223 + getReportedOptionValue(id, selection, reportedSelection)
224 + );
225 +}
226 +
227 export function getProviderOptionCurrentValue(
228 descriptor: ProviderOptionDescriptor | null | undefined,
229 selection?: ModelSelection | null,