feat(orchestrator): Surface Grok reasoning effort options #5160
Closedmwolson(GitHub profile, opens in a new tab)wants to merge 7 commits into
t3code/codex-turn-mapping fromrefs/pull/5160/headopened View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
- apps/web/src/components/ChatView.logic.ts line 487OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -437,3 +437,21 @@437437 };438438 }439439440+/**441+ * Providers that cannot change models mid-thread bind their option values the442+ * same way: Grok reasoning effort is only honored as an agent spawn flag at443+ * session start (grok 0.2.117 keeps a loaded session's original effort even444+ * when respawned with a different flag), so a started thread cannot apply a445+ * new value; clicking a traits option then warns instead of applying.446+ */447+export function isStartedThreadOptionChangeBlocked(input: {448+ providers: ReadonlyArray<449+ Pick<ServerProvider, "driver" | "instanceId" | "requiresNewThreadForModelChange">450+ >;451+ lockedProvider: ProviderDriverKind | null;452+ instanceId: ModelSelection["instanceId"];453+}): boolean {454+ if (input.lockedProvider === null) {455+ return false;456+ }457+ const provider = input.providers.find((snapshot) => snapshot.instanceId === input.instanceId);
github-actions[bot](GitHub profile, opens in a new tab) removed labelssize:L
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XL
github-actions[bot](GitHub profile, opens in a new tab) removed labelssize:XL
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XXL
- apps/server/src/orchestration-v2/ProviderSelectionTransition.ts line 53OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -33,3 +47,7 @@3347 reason: "The active ACP session does not expose a model-switch capability.",3448 };3549 }50+51+ const spawnOptionIds = input.spawnOptionIds ?? [];52+ const resolveSpawnOptionValue = input.resolveSpawnOptionValue ?? getModelSelectionOptionValue;53+ if (input.current.model === input.target.model) {
- apps/server/src/provider/Layers/GrokProvider.ts lines 211 to 213OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -101,0 +178,21 @@178+ * }179+ * ```180+ *181+ * Returns `undefined` when `_meta` carries no effort information at all (the182+ * fallback catalog may apply), and `null` when the agent explicitly reports no183+ * usable menu (`supportsReasoningEffort: false`, or an advertised menu with no184+ * valid entries), which suppresses the fallback.185+ */186+export function grokReasoningEffortMenuFromAcpMeta(187+ meta: unknown,188+): GrokReasoningEffortMenu | null | undefined {189+ if (!isRecord(meta)) {190+ return undefined;191+ }192+ if (meta["supportsReasoningEffort"] === false) {193+ return null;194+ }195+ const rawEfforts = meta["reasoningEfforts"];196+ if (!Array.isArray(rawEfforts)) {197+ return undefined;198+ }apps/server/src/provider/acp/GrokAcpSupport.ts line 131OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -22,0 +59,21 @@59+ * Malformed stored values are dropped so the spawn keeps the model default.60+ */61+export function resolveGrokReasoningEffortForSpawn(62+ modelSelection: ModelSelection | null | undefined,63+): string | undefined {64+ const effort = getModelSelectionStringOptionValue(65+ modelSelection,66+ GROK_REASONING_EFFORT_OPTION_ID,67+ )?.trim();68+ return effort && isValidGrokReasoningEffortToken(effort) ? effort : undefined;69+}70+71+/** Semantic spawn value used when comparing and tracking active Grok sessions. */72+export function resolveGrokSpawnOptionValue(73+ modelSelection: ModelSelection,74+ optionId: string,75+): string | boolean | undefined {76+ if (optionId !== GROK_REASONING_EFFORT_OPTION_ID) {77+ return getModelSelectionOptionValue(modelSelection, optionId);78+ }79+ return (
- apps/server/src/orchestration-v2/Adapters/AcpAdapterV2.ts lines 1320 to 1322OutdatedResolvedby mwolson(GitHub profile, opens in a new tab)@@ -1277,0 +1302,21 @@1302+ * is available for the same model (same-session reconfigure, or1303+ * activation/resume after a runtime restart that reuses the process's1304+ * spawn-time selection), keep prior values for those ids while accepting the1305+ * rest of the request. A model change owns its own spawn-option semantics.1306+ * Pass `priorSelection: null` only on a fresh openSession configuration.1307+ */1308+export function resolveEffectiveAcpSelection(input: {1309+ readonly requested: ModelSelection;1310+ readonly priorSelection: ModelSelection | null;1311+ readonly spawnOptionIds: ReadonlyArray<string>;1312+ readonly resolveSpawnOptionValue?: SpawnOptionValueResolver;1313+}): ModelSelection {1314+ const spawnOptionIds = new Set(input.spawnOptionIds);1315+ if (spawnOptionIds.size === 0) {1316+ return input.requested;1317+ }1318+1319+ const requestedOptions = input.requested.options ?? [];1320+ const spawnSelection =1321+ input.priorSelection?.model === input.requested.model ? input.priorSelection : input.requested;1322+ const resolveSpawnOptionValue = input.resolveSpawnOptionValue ?? getModelSelectionOptionValue;
- apps/server/src/provider/Layers/GrokProvider.ts lines 206 to 209OutdatedResolvedby mwolson(GitHub profile, opens in a new tab)@@ -101,0 +189,21 @@189+ if (!isRecord(meta)) {190+ return undefined;191+ }192+ if (meta["supportsReasoningEffort"] === false) {193+ return null;194+ }195+ const rawEfforts = meta["reasoningEfforts"];196+ if (!Array.isArray(rawEfforts)) {197+ return rawEfforts === undefined ? undefined : null;198+ }199+ const seen = new Set<string>();200+ const entries: Array<GrokReasoningEffortMenuEntry> = [];201+ for (const rawEntry of rawEfforts) {202+ if (!isRecord(rawEntry)) continue;203+ // The flag value is what the spawn consumes; prefer it over the menu id.204+ // Reject tokens the spawn guard would later drop so discovery and spawn205+ // stay aligned without a fixed known-level catalog.206+ const rawValue = typeof rawEntry["value"] === "string" ? rawEntry["value"].trim() : "";207+ const rawId = typeof rawEntry["id"] === "string" ? rawEntry["id"].trim() : "";208+ const id = rawValue || rawId;209+ if (!id || !isValidGrokReasoningEffortToken(id) || seen.has(id)) continue;
- apps/server/src/orchestration-v2/Adapters/GrokAdapterV2.ts lines 178 to 188OutdatedResolvedby mwolson(GitHub profile, opens in a new tab)@@ -156,0 +168,21 @@168+ ReturnType<typeof grokReasoningEffortConstraintsFromCapabilities>169+ >();170+ const refreshReasoningEffortConstraints = (171+ selection: Parameters<typeof resolveGrokReasoningEffortForSpawn>[0],172+ ) => {173+ if (options.getModelCapabilities === undefined || selection == null) {174+ return Effect.void;175+ }176+ const modelId = resolveGrokAcpBaseModelId(selection.model);177+ return options.getModelCapabilities(modelId).pipe(178+ Effect.tap((capabilities) =>179+ capabilities === undefined180+ ? Effect.void181+ : Effect.sync(() => {182+ reasoningEffortConstraintsByModel.set(183+ modelId,184+ grokReasoningEffortConstraintsFromCapabilities(capabilities),185+ );186+ }),187+ ),188+ Effect.asVoid,
- apps/web/src/components/ChatView.tsx line 5124OutdatedResolvedby mwolson(GitHub profile, opens in a new tab)@@ -5042,3 +5049,13 @@50425049 },50435050 ]50445051 : sendContextPreviewAnnotations;5052+ if (isServerThread) {5053+ const modelChangeBlockReason = getStartedThreadModelChangeBlockReason({5054+ providers: providerStatuses,5055+ hasStartedSession: hasStartedModelSession,5056+ supportsProviderSwitchingViaHandoff,5057+ currentModelSelection: activeThread.modelSelection,5058+ currentProviderInstanceId: modelChangeRuntime?.providerInstanceId ?? null,5059+ nextModelSelection: ctxSelectedModelSelection,5060+ });5061+ if (modelChangeBlockReason) {
- apps/server/src/provider/Layers/GrokProvider.ts line 44OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -32,8 +32,13 @@32-import { makeGrokAcpRuntime, resolveGrokAcpBaseModelId } from "../acp/GrokAcpSupport.ts";33-34-const GROK_PRESENTATION = {35- displayName: "Grok",36- badgeLabel: "Early Access",37- showInteractionModeToggle: false,38- requiresNewThreadForModelChange: true,39-} as const;32+import {33+ GROK_FALLBACK_REASONING_EFFORTS_BY_MODEL,34+ GROK_REASONING_EFFORT_OPTION_ID,35+ isValidGrokReasoningEffortToken,36+ makeGrokAcpRuntime,37+ resolveGrokAcpBaseModelId,38+} from "../acp/GrokAcpSupport.ts";39+40+const MINIMUM_GROK_VERSION = "1.0.0";41+42+export function parseGrokCliVersion(output: string): string | null {43+ const match = output.match(44+ /\bv?(\d+\.\d+\.\d+(?:-[0-9A-Za-z]+(?:\.[0-9A-Za-z]+)*)?(?:\+[0-9A-Za-z]+(?:\.[0-9A-Za-z]+)*)?)\b/,apps/server/src/orchestration-v2/Adapters/AcpAdapterV2.ts line 4765OutdatedResolvedby mwolson(GitHub profile, opens in a new tab)@@ -0,0 +4745,21 @@4745+ }4746+ return yield* new ProviderAdapterProtocolError({4747+ driver,4748+ detail: `ACP driver cannot load or resume session ${sessionId}`,4749+ });4750+ });4751+4752+ const configureSession = Effect.fnUntraced(function* (4753+ startResult: AcpSessionRuntimeStartResult,4754+ modelSelection: ModelSelection,4755+ runtimePolicy: ProviderAdapterV2RuntimePolicy,4756+ priorSelection: ModelSelection | null,4757+ ) {4758+ const requestedModel = flavor.resolveModelId?.(modelSelection) ?? modelSelection.model;4759+ const sessionModelMeta =4760+ flavor.resolveSessionModelMeta === undefined4761+ ? undefined4762+ : yield* flavor.resolveSessionModelMeta(modelSelection);4763+ const currentModel = yield* Ref.get(activeSessionModelId);4764+ const currentSessionModelMeta = yield* Ref.get(activeSessionModelMeta);4765+ const sessionModelMetaChanged =apps/server/src/provider/acp/AcpSessionRuntime.ts line 2067OutdatedResolvedby mwolson(GitHub profile, opens in a new tab)@@ -716,3 +2064,4 @@7162064 }),7172065 getModeState: Ref.get(modeStateRef),7182066 getConfigOptions: Ref.get(configOptionsRef),2067+ loadSession: (sessionId, activationOptions) =>
- apps/server/src/orchestration-v2/Adapters/AcpAdapterV2.ts line 3629OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +3609,21 @@3609+ // Some ACP implementations deliver the injected assistant3610+ // report before the synthetic monitor end notice. Correlation3611+ // arrives with that notice, so remember the unmatched report3612+ // and consume its task id when the notice follows.3613+ context.earlyInjectedReportObserved = true;3614+ }3615+ yield* appendText(context, "assistant", update.content.text);3616+ }3617+ break;3618+ case "agent_thought_chunk":3619+ if (update.content.type === "text") {3620+ yield* appendText(context, "reasoning", update.content.text);3621+ }3622+ break;3623+ case "user_message_chunk":3624+ if (update.content.type === "text" && flavor.extractBackgroundToolMutation) {3625+ const mutations = flavor.extractBackgroundToolMutation(update.content.text);3626+ const terminalTaskIds = mutations3627+ .filter((mutation) => mutation.status !== "running")3628+ .map((mutation) => mutation.taskId);3629+ const reportArrivedBeforeNotice =apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.testkit.ts line 1942OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +1922,21 @@1922+ cwd: input.cwd,1923+ ...(input.enableTools === true1924+ ? {1925+ tools: input.tools ?? { type: "preset", preset: "claude_code" },1926+ permissionMode: input.permissionMode ?? "default",1927+ ...(input.allowedTools === undefined ? {} : { allowedTools: input.allowedTools }),1928+ ...(input.disallowedTools === undefined1929+ ? {}1930+ : { disallowedTools: input.disallowedTools }),1931+ ...(input.allowDangerouslySkipPermissions === true1932+ ? { allowDangerouslySkipPermissions: true }1933+ : {}),1934+ }1935+ : {}),1936+ });1937+ input.entries.push({1938+ type: "expect_outbound",1939+ label: `query.open:fork${labelSuffix}`,1940+ frame: makeClaudeQueryOpenFrame({ options: targetOptions }),1941+ });1942+ const targetRuntime = query({apps/server/scripts/record-claude-agent-sdk-replay-fixture.ts line 350OutdatedResolvedby mwolson(GitHub profile, opens in a new tab)@@ -0,0 +330,21 @@330+function runtimePolicyForRecording(input: {331+ readonly cwd: string;332+ readonly override?: RuntimePolicyV2Override;333+}): ProviderAdapterV2RuntimePolicyType {334+ return ProviderAdapterV2RuntimePolicy.make({335+ runtimeMode: "full-access",336+ interactionMode: "default",337+ cwd: input.override?.cwd ?? input.cwd,338+ ...(input.override?.approvalPolicy === undefined339+ ? {}340+ : { approvalPolicy: input.override.approvalPolicy }),341+ ...(input.override?.sandboxPolicy === undefined342+ ? {}343+ : { sandboxPolicy: input.override.sandboxPolicy }),344+ ...(input.override?.reasoningEffort === undefined345+ ? {}346+ : { reasoningEffort: input.override.reasoningEffort }),347+ });348+}349+350+async function makeToolCallReadOnlyRecordingWorkspace(): Promise<string> {apps/mobile/src/features/threads/ThreadRelationshipsBanner.tsx lines 130 to 131OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +108,21 @@108+ const primaryParent = rows.find(({ edge }) => edge.targetThreadId === props.threadId) ?? rows[0];109+ const primaryNode = primaryParent ? graph.nodes.get(primaryParent.threadId) : null;110+ const summary = primaryParent111+ ? `${relationshipLabel(primaryParent.edge, props.threadId)}: ${primaryNode?.thread?.title ?? "related thread"}`112+ : "Agent session connected";113+114+ const openThread = (threadId: ThreadId, archivedThread: boolean) => {115+ setVisible(false);116+ void Haptics.selectionAsync();117+ if (archivedThread) {118+ navigation.navigate("SettingsSheet", { screen: "SettingsArchive" });119+ return;120+ }121+ navigation.navigate("Thread", {122+ environmentId: props.environmentId,123+ threadId,124+ });125+ };126+127+ const merge = async () => {128+ if (!canMerge || mergeTargetThreadId === null || latestMergeBackRun === null) return;apps/server/scripts/probe-claude-fork-local-rollback-replay.ts line 80OutdatedResolvedby mwolson(GitHub profile, opens in a new tab)@@ -0,0 +60,21 @@60+ waiter({ done: true, value: undefined });61+ }62+ }63+64+ [Symbol.asyncIterator](): AsyncIterator<ReturnType<typeof makeClaudeUserMessage>> {65+ return {66+ next: () => {67+ const value = this.#items.shift();68+ if (value !== undefined) {69+ return Promise.resolve({ done: false, value });70+ }71+ if (this.#closed) {72+ return Promise.resolve({ done: true, value: undefined });73+ }74+ return new Promise((resolve) => this.#waiters.push(resolve));75+ },76+ };77+ }78+}79+80+function readArgValue(name: string): string | undefined {apps/server/src/mcp/WorktreeMcpService.ts line 254OutdatedResolvedby mwolson(GitHub profile, opens in a new tab)@@ -0,0 +234,21 @@234+235+ const ids = yield* handoffIds(scope);236+237+ // uninterruptibleMask: only the potentially slow worktree creation itself238+ // stays interruptible (restore). From the moment it succeeds, through the239+ // binding, continuation queue, setup script launch, and result240+ // construction, there is no interruptible gap: a client cancel can241+ // therefore neither orphan the created worktree before the rollback is242+ // armed, nor skip setting up a worktree the thread was just bound to243+ // (once the binding commits, the scheduled session detach can sever this244+ // request's connection and interrupt the fiber).245+ return yield* Effect.uninterruptibleMask((restore) =>246+ Effect.gen(function* () {247+ const worktree = yield* restore(248+ gitWorkflow249+ .createWorktree({250+ cwd: projectCwd,251+ refName: worktreeBaseRef,252+ newRefName: input.branch,253+ baseRefName: baseRef,254+ path: input.path ?? null,apps/server/src/mcp/OrchestratorMcpService.ts lines 1538 to 1548OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +1528,21 @@1528+ const sourceThreadIds = [1529+ ...new Set(1530+ page1531+ .filter(1532+ (row) => row.item.type === "user_message" || row.item.type === "assistant_message",1533+ )1534+ .map((row) => row.sourceThreadId)1535+ .filter((threadId) => threadId !== target.thread.id),1536+ ),1537+ ];1538+ const sourceProjections = yield* Effect.forEach(1539+ sourceThreadIds,1540+ (sourceThreadId) => loadProjectThread(target.thread.projectId, sourceThreadId),1541+ { concurrency: 8 },1542+ );1543+ const messagesByThreadId = new Map<ThreadId, OrchestrationV2ThreadProjection["messages"]>([1544+ [target.thread.id, target.messages],1545+ ...sourceProjections.map(1546+ (projection) => [projection.thread.id, projection.messages] as const,1547+ ),1548+ ]);apps/mobile/src/test-fixtures.ts lines 60 to 70OutdatedResolvedby mwolson(GitHub profile, opens in a new tab)@@ -0,0 +50,21 @@50+ settledAt: null,51+ deletedAt: null,52+ ...input,53+ };54+}55+56+export function makeThreadShellFixture(57+ overrides: Partial<EnvironmentThreadShell> = {},58+): EnvironmentThreadShell {59+ const environmentId = overrides.environmentId ?? EnvironmentId.make("environment-test");60+ const raw = makeRawThreadShell({61+ id: overrides.id,62+ projectId: overrides.projectId,63+ title: overrides.title,64+ providerInstanceId: overrides.providerInstanceId,65+ modelSelection: overrides.modelSelection,66+ runtimeMode: overrides.runtimeMode,67+ interactionMode: overrides.interactionMode,68+ branch: overrides.branch,69+ worktreePath: overrides.worktreePath,70+ });apps/server/src/mcp/WorktreeMcpService.ts line 247OutdatedResolvedby mwolson(GitHub profile, opens in a new tab)@@ -0,0 +227,21 @@227+ cwd: projectCwd,228+ refName: baseRef,229+ fallbackRemoteName: "origin",230+ })231+ .pipe(asOperationFailed(`Unable to resolve the remote-tracking commit of '${baseRef}'`));232+ worktreeBaseRef = resolvedRemoteBase.commitSha;233+ }234+235+ const ids = yield* handoffIds(scope);236+237+ // uninterruptibleMask: only the potentially slow worktree creation itself238+ // stays interruptible (restore). From the moment it succeeds, through the239+ // binding, continuation queue, setup script launch, and result240+ // construction, there is no interruptible gap: a client cancel can241+ // therefore neither orphan the created worktree before the rollback is242+ // armed, nor skip setting up a worktree the thread was just bound to243+ // (once the binding commits, the scheduled session detach can sever this244+ // request's connection and interrupt the fiber).245+ return yield* Effect.uninterruptibleMask((restore) =>246+ Effect.gen(function* () {247+ const worktree = yield* restore(apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.testkit.ts line 895OutdatedResolvedby mwolson(GitHub profile, opens in a new tab)@@ -0,0 +875,21 @@875+ ).pipe(Layer.provide(NodeServices.layer));876+ return makeProviderAdapterRegistryDriverLayer({877+ drivers: [ClaudeAdapterV2Driver],878+ configMap: {879+ [CLAUDE_DEFAULT_INSTANCE_ID]: {880+ driver: CLAUDE_DRIVER_KIND,881+ },882+ },883+ }).pipe(884+ Layer.provide(885+ Layer.mergeAll(886+ makeClaudeAgentSdkReplayLayer(transcript, options),887+ idAllocatorLayer,888+ NodeServices.layer,889+ serverConfigLayer,890+ ),891+ ),892+ );893+}894+895+export async function replayClaudeAgentSdkTranscript(input: {apps/server/scripts/record-cursor-agent-sdk-replay-fixture.ts line 163OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +143,21 @@143+ );144+ }),145+ );146+}147+148+const scenario = (readArgValue("--scenario") ?? process.env.T3_CURSOR_REPLAY_SCENARIO) as149+ | RecordingName150+ | undefined;151+if (scenario === undefined || RECORDINGS[scenario] === undefined) {152+ throw new Error(`Pass --scenario with one of: ${Object.keys(RECORDINGS).join(", ")}`);153+}154+155+const apiKey = process.env.CURSOR_API_KEY?.trim();156+if (!apiKey) {157+ throw new Error("CURSOR_API_KEY is required to record Cursor SDK replay fixtures.");158+}159+160+const recording = RECORDINGS[scenario];161+const workspace = await prepareWorkspace(scenario);162+const transcriptCwd = cursorReplayTranscriptCwd(scenario);163+const outputPath = readArgValue("--out") ?? new URL(recording.output, import.meta.url).pathname;@@ -12,3 +12,4 @@1212 `10-unify-process-session-abstraction.md`1313 `19-version-control-phase-1-vcs-driver-foundation.md`1414 `20-version-control-phase-2-source-control-provider-foundation.md`15+`21-orchestration-v2-application-integration.md`apps/server/src/mcp/OrchestratorMcpService.ts lines 745 to 751OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +731,21 @@731+ const candidates = input.providers.filter(732+ (provider) =>733+ provider.driver === requestedDriver &&734+ isBuiltInProviderAdapterDriverV2(provider.driver),735+ );736+ if (candidates.length === 0) {737+ return yield* failure(738+ "provider_unavailable",739+ `No V2 provider adapter is registered for driver ${requestedDriver}.`,740+ );741+ }742+ const inheritedCandidate = candidates.find(743+ (candidate) => candidate.instanceId === input.parent.thread.modelSelection.instanceId,744+ );745+ const availableCandidate = candidates.find((candidate) => {746+ return (747+ providerConstraints(candidate, isBuiltInProviderAdapterDriverV2(candidate.driver))748+ .length === 0749+ );750+ });751+ instanceId = inheritedCandidate?.instanceId ?? availableCandidate?.instanceId;apps/server/scripts/acp-replay-agent.ts lines 92 to 99OutdatedResolvedby mwolson(GitHub profile, opens in a new tab)@@ -0,0 +79,21 @@79+ }80+ return JSON.stringify(value);81+}82+83+function expandExpectedString(value: string): string {84+ return value.replaceAll("<workspace>", replayWorkspace);85+}86+87+function matchesExpected(expected: unknown, actual: unknown): boolean {88+ if (expected === "<any>") return true;89+ if (typeof expected === "string" && typeof actual === "string") {90+ const expanded = expandExpectedString(expected);91+ if (!expanded.includes("<any>")) return expanded === actual;92+ const parts = expanded.split("<any>");93+ let offset = 0;94+ for (const part of parts) {95+ const index = actual.indexOf(part, offset);96+ if (index === -1) return false;97+ offset = index + part.length;98+ }99+ return true;apps/server/scripts/record-claude-agent-sdk-replay-fixture.ts lines 274 to 278OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +258,21 @@258+ `Unsupported Claude replay query mode '${raw}'. Use 'streaming', 'restart', 'resume_at_cursor', 'fork_session', 'fork_session_prior_turn', 'fork_session_continue', 'fork_session_siblings', 'fork_session_merge_back', 'fork_session_merge_back_siblings', 'active_steering', 'interrupt', or 'interrupt_restart'.`,259+ );260+}261+262+const scenario = readArgValue("--scenario") ?? process.env.T3_CLAUDE_REPLAY_SCENARIO ?? "simple";263+const recording = CLAUDE_RECORDINGS[scenario as keyof typeof CLAUDE_RECORDINGS];264+const encodeUnknownJsonString = Schema.encodeSync(Schema.fromJsonString(Schema.Unknown));265+266+if (recording === undefined) {267+ throw new Error(268+ `Claude replay fixture '${scenario}' is not configured. ` +269+ "TODO: approval fixtures need permission callback recording before they can be generated.",270+ );271+}272+273+const positionalOutputPath = process.argv[2]?.startsWith("--") ? undefined : process.argv[2];274+const outputPath =275+ readArgValue("--out") ??276+ positionalOutputPath ??277+ new URL(`../src/orchestration-v2/testkit/${recording.defaultTranscriptFile}`, import.meta.url)278+ .pathname;
- apps/web/src/components/chat/TraitsPicker.tsx lines 333 to 338Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -268,3 +330,9 @@268330 updateModelOptions(buildProviderOptionSelectionsFromDescriptors(nextDescriptors));269331 };270332333+ const showLockedOptionWarning = (toast: typeof LOCKED_PROVIDER_OPTION_TOAST) => {334+ if (lockedOptionWarningToastIdRef.current !== null) {335+ toastManager.close(lockedOptionWarningToastIdRef.current);336+ }337+ lockedOptionWarningToastIdRef.current = toastManager.add(toast);338+ };apps/web/src/components/ChatView.logic.ts lines 468 to 471OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -455,3 +464,8 @@455464 };456465 }457466467+/**468+ * Providers that cannot change models mid-thread also bind their option values469+ * to the active session. Locked provider-option rows render disabled and the470+ * committed selection stays in force; there is no toast or click-to-apply471+ * path.
- apps/web/src/components/ChatView.logic.ts line 501Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -457,0 +481,21 @@481+ if (input.lockedInstanceId === null) {482+ return false;483+ }484+ if (input.instanceId !== input.lockedInstanceId) {485+ return false;486+ }487+ const provider = input.providers.find((snapshot) => snapshot.instanceId === input.instanceId);488+ return provider?.requiresNewThreadForModelChange === true;489+}490+491+/**492+ * ChatComposer keys session-bound option locks to the active provider493+ * instance, not the draft/handoff selection and not merely the driver kind.494+ * Shell history keeps the lock active while a detailed projection is loading.495+ */496+export function resolveSessionLockedInstanceId(input: {497+ hasStartedThread: boolean;498+ runtimeProviderInstanceId: ModelSelection["instanceId"] | null | undefined;499+ committedModelSelectionInstanceId: ModelSelection["instanceId"] | null | undefined;500+}): ModelSelection["instanceId"] | null {501+ if (!input.hasStartedThread) {
t3dotgg(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.



Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID:
72a67341-bf75-4496-ac58-dd45f02f89efYou can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share