Skip to content
TypeScript

fix(web): Antigravity effort no longer shows a speedometer in the composer (#26929)

Theo Browne4453f537ffb6
diff --git a/apps/mobile/src/features/threads/threadAgentsPresentation.ts b/apps/mobile/src/features/threads/threadAgentsPresentation.ts
index d8dde459792..7f560497da2 100644
--- a/apps/mobile/src/features/threads/threadAgentsPresentation.ts
+++ b/apps/mobile/src/features/threads/threadAgentsPresentation.ts
@@ -8,6 +8,7 @@ import {
type RuntimeSubagent,
type SubagentWorkflowGroup,
} from "@t3tools/client-runtime/state/subagentRuntime";
+import { REASONING_EFFORT_OPTION_IDS } from "@t3tools/client-runtime/state/thread-execution";
import type {
EnvironmentId,
OrchestrationV2Subagent,
@@ -166,8 +167,6 @@ export function nextWorkflowSelection(
);
}
-const EFFORT_OPTION_IDS = new Set(["reasoningEffort", "effort", "reasoning", "variant"]);
-
function capitalize(value: string): string {
return value.charAt(0).toUpperCase() + value.slice(1);
}
@@ -185,7 +184,7 @@ export function workflowMemberMetadata(
const effortChoice = provider?.models
.find((candidate) => candidate.slug === slug)
?.capabilities?.optionDescriptors?.flatMap((descriptor) =>
- descriptor.type === "select" && EFFORT_OPTION_IDS.has(descriptor.id)
+ descriptor.type === "select" && REASONING_EFFORT_OPTION_IDS.includes(descriptor.id)
? descriptor.options
: [],
)
diff --git a/apps/web/src/components/chat/TraitsPicker.tsx b/apps/web/src/components/chat/TraitsPicker.tsx
index f02780bed3a..79a29d293dc 100644
--- a/apps/web/src/components/chat/TraitsPicker.tsx
+++ b/apps/web/src/components/chat/TraitsPicker.tsx
@@ -616,9 +616,12 @@ export const TraitsPicker = memo(function TraitsPicker({
)
: null;
// Workflow levels such as Ultracode always show their name; the setting names every level.
+ // Traits the bars cannot show, such as an agent mode, appear as words in the composer.
const effortWord = effortGlyph
? (effortGlyph.special ?? (effortDisplay === "label" ? effortGlyph.label : null))
- : null;
+ : isComposerOwned
+ ? triggerLabel
+ : null;
return (
<Menu
@@ -697,6 +700,15 @@ export const TraitsPicker = memo(function TraitsPicker({
</span>
) : null}
</span>
+ ) : effortWord !== null ? (
+ <>
+ <span data-composer-control-label>{effortWord}</span>
+ <GaugeIcon
+ aria-hidden="true"
+ data-composer-control-compact-icon
+ className="invisible absolute size-3.5"
+ />
+ </>
) : isCodexStyle ? (
<span
className={cn(
diff --git a/apps/web/src/components/chat/composerProviderState.test.tsx b/apps/web/src/components/chat/composerProviderState.test.tsx
index 54b68286ee3..84c7c3d8cb8 100644
--- a/apps/web/src/components/chat/composerProviderState.test.tsx
+++ b/apps/web/src/components/chat/composerProviderState.test.tsx
@@ -315,6 +315,15 @@ describe("getComposerReasoningStep", () => {
}
});
+ it("steps Antigravity's thinking_level like other effort controls", () => {
+ expect(
+ step({
+ provider: ProviderDriverKind.make("antigravity"),
+ models: modelWith([selectDescriptor("thinking_level", LEVELS)]),
+ })?.modelOptions,
+ ).toStrictEqual(selections(["thinking_level", "high"]));
+ });
+
it("adds and strips the Ultrathink prefix while the caret stays on the same character", () => {
for (const { prompt, modelOptions, direction, expected } of [
{
diff --git a/packages/client-runtime/src/state/threadExecution.ts b/packages/client-runtime/src/state/threadExecution.ts
index accf5c98df9..ba87930bebb 100644
--- a/packages/client-runtime/src/state/threadExecution.ts
+++ b/packages/client-runtime/src/state/threadExecution.ts
@@ -151,6 +151,7 @@ export const REASONING_EFFORT_OPTION_IDS: ReadonlyArray<string> = [
"reasoning",
"variant",
"reasoning_effort",
+ "thinking_level",
];
export function formatModelSelectionEffort(