Codex Fast Toggle Audit#537
Conversation
…tiers
Generalize the Codex-only fast toggle into a provider-agnostic `fastMode`
across chat, automations, review, orchestration, batch launch and the TUI,
with per-provider wiring:
- Claude: `--settings '{"fastMode":…}'` CLI flag + Agent SDK settings layer
+ live `applyFlagSettings` runtime control; new `serviceTiers:["fast"]` on
Opus models in the model registry.
- Codex: `service_tier`/`features.fast_mode` -c flags and `service_tier`
JSON-RPC arg; track the app-server's effective tier in
`AgentChatSession.codexServiceTier`.
- OpenCode: `--variant fast` launch/resume.
- Cursor: explicit standard-tier selection when fastMode is off, preserving
selected reasoning effort.
Backward compatibility preserved via `@deprecated codexFastMode` aliases read
at every input/persistence boundary (`fastMode ?? codexFastMode`). Tests
updated/added across services, shared CLI builders, terminal resume signals,
and the TUI, incl. coverage for the deprecated-alias fallback.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
📝 WalkthroughWalkthroughThis PR systematically renames the Codex-specific ChangesCross-provider fast mode unification
Estimated code review effort🎯 4 (Complex) | ⏱️ ~75 minutes Suggested labels
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
|
|
@copilot review but do not make fixes |
There was a problem hiding this comment.
Actionable comments posted: 6
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (5)
apps/ade-cli/src/tuiClient/app.tsx (3)
6614-6631:⚠️ Potential issue | 🟠 Major | ⚡ Quick winPass
fastModeinto Claude terminal launches.Both Claude launch paths compute
normalized.fastModebut never forward it tostartClaudeTerminalSession, so new Claude chats always start on the default tier. Right now the TUI toggle only affects the non-Claude create path.🔧 Suggested patch
const created = await startClaudeTerminalSession({ connection: conn, laneId, title, model: normalized.modelId ?? normalized.model, reasoningEffort: normalized.reasoningEffort, + fastMode: normalized.fastMode, permissionMode: normalized.permissionMode, initialInput: text.trim() ? text : null, cols, rows: terminalRows, });await startClaudeTerminalSession({ connection: conn, laneId, title: pendingNewChatTitleRef.current ?? "Claude Code", model: normalized.modelId ?? normalized.model, reasoningEffort: normalized.reasoningEffort, + fastMode: normalized.fastMode, permissionMode: normalized.permissionMode, initialInput: terminalPrompt.trim() ? terminalPrompt : null, cols, rows: terminalRows, });Also applies to: 8553-8563
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/ade-cli/src/tuiClient/app.tsx` around lines 6614 - 6631, The Claude launch path builds a normalized object with normalized.fastMode but never passes it into startClaudeTerminalSession, so Claude chats ignore the fastMode toggle; update the startClaudeTerminalSession calls (e.g., the call in app.tsx where title, model, reasoningEffort, permissionMode, initialInput, cols, rows are passed) to also pass fastMode: normalized.fastMode (and do the same for the other Claude launch location around lines 8553-8563) so the new Claude terminal session respects the fastMode setting.
4302-4313:⚠️ Potential issue | 🟠 Major | ⚡ Quick winPreserve the deprecated status-line field during the migration.
This payload drops
model.codexFastMode, so existing user status-line scripts will start readingundefinedeven though the migration keeps deprecated aliases elsewhere for compatibility. Emit both keys until those scripts can move tofastMode.🔧 Suggested compatibility patch
model: { id: modelState.modelId, displayName: modelState.displayName, display_name: modelState.displayName, provider: modelState.provider, fastMode: modelState.fastMode, + codexFastMode: modelState.fastMode, supportsEffort: modelReasoningEfforts(modelState, models).length > 0, },🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/ade-cli/src/tuiClient/app.tsx` around lines 4302 - 4313, The payload sent to runClaudeStatusLineCommand drops the deprecated alias model.codexFastMode, breaking existing status-line scripts; update the model object construction in app.tsx (the call to runClaudeStatusLineCommand / the model literal using modelState) to emit both keys by adding a codexFastMode property (e.g., codexFastMode: modelState.codexFastMode ?? modelState.fastMode) alongside fastMode so legacy scripts continue to see the deprecated field until fully migrated.
8674-8699:⚠️ Potential issue | 🟠 Major | 🏗️ Heavy liftClaude fast-mode changes never reach the running terminal session.
These branches only flip local
modelState.fastMode. For terminal-backed Claude sessions, the normal model commit path is skipped, and the follow-up Claude sync here only applies model/effort changes. The UI can show fast mode enabled while the live Claude session stays on the previous tier.Also applies to: 8883-8885, 9130-9137, 9902-9905, 11402-11406, 11471-11474
apps/desktop/src/renderer/components/chat/AgentChatPane.tsx (2)
7106-7113:⚠️ Potential issue | 🟠 Major | ⚡ Quick winDon't send an invisible
fastModeoverride on OpenCode handoffs.Line 7111 includes
fastModefor OpenCode, but the toggle only renders inside the Codex-specific branch here. OpenCode handoffs can therefore inherit a hidden stale value, and unsupported OpenCode targets still receive the flag.Suggested fix
- ...(handoffTargetProvider === "codex" || handoffTargetProvider === "opencode" + ...((handoffTargetProvider === "codex" || handoffTargetProvider === "opencode") + && modelSupportsFastMode(handoffTargetDescriptor) ? { fastMode: handoffFastMode } : {}),- {handoffTargetProvider === "codex" ? ( + {handoffTargetProvider === "codex" ? ( <div className="space-y-0.5"> <select value={handoffCodexSelectValue} @@ - {modelSupportsFastMode(handoffTargetDescriptor) ? ( - <button - type="button" - className={cn( - "mt-1 inline-flex h-8 items-center gap-1.5 rounded-md border px-2.5 font-sans text-[11px] font-semibold transition-colors", - handoffFastMode - ? "border-amber-300/28 bg-amber-400/12 text-amber-100" - : "border-white/[0.08] bg-white/[0.03] text-muted-fg/62 hover:bg-white/[0.06] hover:text-fg/78", - )} - aria-pressed={handoffFastMode} - aria-label="Fast mode for handoff" - onClick={() => setHandoffFastMode((current) => !current)} - > - <Lightning size={12} weight="fill" /> - Fast - </button> - ) : null} {handoffCodexPermissionPreset === "custom" ? ( <div className="text-[10px] text-amber-200/55">Session uses a custom policy; select a standard preset to apply to the new chat.</div> ) : null} </div> ) : null} + {(handoffTargetProvider === "codex" || handoffTargetProvider === "opencode") + && modelSupportsFastMode(handoffTargetDescriptor) ? ( + <button + type="button" + className={cn( + "mt-1 inline-flex h-8 items-center gap-1.5 rounded-md border px-2.5 font-sans text-[11px] font-semibold transition-colors", + handoffFastMode + ? "border-amber-300/28 bg-amber-400/12 text-amber-100" + : "border-white/[0.08] bg-white/[0.03] text-muted-fg/62 hover:bg-white/[0.06] hover:text-fg/78", + )} + aria-pressed={handoffFastMode} + aria-label="Fast mode for handoff" + onClick={() => setHandoffFastMode((current) => !current)} + > + <Lightning size={12} weight="fill" /> + Fast + </button> + ) : null}As per coding guidelines, "Keep IPC contracts, preload types, shared types, and renderer usage in sync whenever an interface changes."
Also applies to: 8417-8456
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/desktop/src/renderer/components/chat/AgentChatPane.tsx` around lines 7106 - 7113, The handoff call is incorrectly sending a fastMode override for OpenCode targets because fastMode is only rendered in the Codex UI branch; update the payload building for window.ade.agentChat.handoff so that fastMode is included only when handoffTargetProvider === "codex" (not when "opencode"), i.e., change the spread condition around fastMode to explicitly check for codex, and mirror the same change in the other affected call sites (the similar block around lines 8417-8456) so OpenCode never receives a hidden fastMode flag.Source: Coding guidelines
2245-2258:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winUse the runtime catalog when restoring draft
fastMode.
normalizeStoredComposerDraft()only checksgetModelById(modelId). Runtime-discovered models will always look unsupported here, so a saved draft can come back withfastMode: falseeven though the snapshot storedtrue.Suggested fix
- const desc = modelId ? getModelById(modelId) : null; + const desc = modelId + ? (resolveModelDescriptorWithRuntimeCatalog(modelId) ?? getModelById(modelId)) + : null;🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/desktop/src/renderer/components/chat/AgentChatPane.tsx` around lines 2245 - 2258, normalizeStoredComposerDraft currently uses getModelById(modelId) only, so runtime-discovered models appear unsupported and fastMode can be lost; change the lookup so desc is resolved from the runtime catalog when getModelById returns null (e.g., fallback to the runtime-discovered model lookup or runtimeCatalog.get/model lookup) before calling modelSupportsFastMode(desc) and readStoredFastMode(value), and add any needed import/usage of the runtime catalog helper so runtime models restore their fastMode correctly.
♻️ Duplicate comments (1)
apps/desktop/src/main/services/automations/automationPlannerService.ts (1)
864-866:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winDuplicate: Type check pattern may break fallback logic.
Same issue as lines 755-757. If
requestedExecution.session?.fastModeis present but not a boolean, the fallback torequestedExecution.session?.codexFastModewill not work.🔧 Proposed fix
-...(typeof (requestedExecution.session?.fastMode ?? requestedExecution.session?.codexFastMode) === "boolean" - ? { fastMode: Boolean(requestedExecution.session?.fastMode ?? requestedExecution.session?.codexFastMode) } - : {}), +...(() => { + const value = requestedExecution.session?.fastMode ?? requestedExecution.session?.codexFastMode; + return typeof value === "boolean" ? { fastMode: value } : {}; +})(),🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/desktop/src/main/services/automations/automationPlannerService.ts` around lines 864 - 866, The current conditional uses typeof (requestedExecution.session?.fastMode ?? requestedExecution.session?.codexFastMode) === "boolean" which prevents falling back to codexFastMode when fastMode exists but isn’t a boolean; update the logic in the spread that builds fastMode so it explicitly checks fastMode first and only if its typeof !== "boolean" then checks typeof requestedExecution.session?.codexFastMode === "boolean" and uses that, otherwise omit fastMode; locate the ternary using requestedExecution.session?.fastMode and requestedExecution.session?.codexFastMode and replace it with a two-step type-check (fastMode then codexFastMode) to preserve the intended fallback behavior.
🧹 Nitpick comments (3)
apps/desktop/src/main/services/ai/tools/orchestrationTools.ts (1)
186-194: 💤 Low valueOptional: Redundant
.partial()on already-optional fields.Both
reasoningEffortandfastModeare already marked.optional()in the schema (lines 190-191), so calling.partial({ reasoningEffort: true, fastMode: true })on line 193 is redundant. The.partial()call has no additional effect and can be removed.The same pattern appears at lines 1023-1030.
♻️ Simplify the schema
modelOverride: z .object({ provider: z.string(), modelId: z.string(), reasoningEffort: z.string().nullable().optional(), fastMode: z.boolean().optional(), }) - .partial({ reasoningEffort: true, fastMode: true }) .optional(),🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/desktop/src/main/services/ai/tools/orchestrationTools.ts` around lines 186 - 194, The schema for modelOverride currently marks reasoningEffort and fastMode as .optional() and then calls .partial({ reasoningEffort: true, fastMode: true }) unnecessarily; remove the .partial(...) call in the modelOverride z.object declaration (and the identical redundant .partial at lines later in the file) so the optional flags on reasoningEffort and fastMode are the sole indicators of optionality—look for the modelOverride object and the properties reasoningEffort and fastMode to locate and remove the redundant .partial usage.apps/desktop/src/renderer/components/chat/AgentChatComposer.test.tsx (1)
537-553: 💤 Low valueOptional: Update test description to reflect provider-agnostic field name.
The test description says "toggles Codex fast mode" but the field has been renamed to the provider-agnostic
fastMode. Consider updating the test name to "toggles fast mode for Codex sessions with supported models" or similar to better reflect thatfastModeis no longer Codex-specific, even though this particular test exercises it with a Codex session.The same applies to the test at line 555 ("hides Codex fast mode for unsupported models").
📝 Suggested test name updates
- it("toggles Codex fast mode for supported models", () => { + it("toggles fast mode for Codex sessions with supported models", () => {- it("hides Codex fast mode for unsupported models", () => { + it("hides fast mode toggle for Codex sessions with unsupported models", () => {🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/desktop/src/renderer/components/chat/AgentChatComposer.test.tsx` around lines 537 - 553, The test name "toggles Codex fast mode for supported models" is outdated; update the test description to reference the provider-agnostic field (fastMode) while keeping the intent. Rename the it(...) description to something like "toggles fast mode for Codex sessions with supported models" (similarly update the other test "hides Codex fast mode for unsupported models"), leaving the test body, props passed to renderComposer (sessionProvider, modelId, availableModelIds, fastMode, onFastModeChange), and assertions unchanged so renderComposer, fastMode, and onFastModeChange continue to be used as before.apps/desktop/src/shared/types/chat.ts (1)
1311-1313: ⚡ Quick winConsider using JSDoc
@deprecatedtags for better IDE support.The deprecation comments are helpful, but TypeScript's
@deprecatedJSDoc annotation on the legacycodexFastModefield would provide stricter tooling support (strikethroughs in IDEs, lint warnings).📝 Example with proper JSDoc deprecation
export type AgentChatCreateArgs = { // ... other fields ... fastMode?: boolean; - /** `@deprecated` Use fastMode. Accepted for older renderer/IPC callers. */ + /** + * `@deprecated` Use fastMode instead. Accepted for backward compatibility with older renderer/IPC callers. + */ codexFastMode?: boolean;Apply the same pattern to
AgentChatLaunchCliArgs,AgentChatHandoffArgs, andAgentChatUpdateSessionArgs.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/desktop/src/shared/types/chat.ts` around lines 1311 - 1313, Update the legacy boolean field declarations to use JSDoc `@deprecated` annotations so IDEs and linters pick up the deprecation: replace the inline comment on codexFastMode with a JSDoc block like /** `@deprecated` Use fastMode. Accepted for older renderer/IPC callers. */ placed immediately above the codexFastMode property, and apply the same change to the codexFastMode definitions in the AgentChatLaunchCliArgs, AgentChatHandoffArgs, and AgentChatUpdateSessionArgs interfaces so tooling shows strikethroughs/warnings while retaining fastMode as the preferred property.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/ade-cli/src/cli.ts`:
- Around line 3504-3505: The session payload currently only sets fastMode (via
fastRequested/standardRequested) which breaks older desktop socket RPCs
expecting the deprecated codexFastMode; when building outbound session objects
(e.g., where config.fastMode is set and in createConnection()’s session
serialization for the "desktop-socket" path) add codexFastMode: config.fastMode
(or codexFastMode: !!fastMode) alongside fastMode so both aliases are sent, and
update all related payload construction sites (including where
fastRequested/standardRequested toggle config.fastMode) to preserve the legacy
codexFastMode field.
In `@apps/ade-cli/src/services/sync/syncRemoteCommandService.ts`:
- Around line 755-757: The current fallback uses
asOptionalBoolean(value.fastMode ?? value.codexFastMode) which loses a legacy
boolean when fastMode exists but is non-boolean; update the parsing so you
normalize each candidate separately and apply boolean-precedence: set
parsed.fastMode = asOptionalBoolean(value.fastMode) ??
asOptionalBoolean(value.codexFastMode). Do the same fix for the other occurrence
that assigns parsed.fastMode around the code block using the same symbols
(value.fastMode, value.codexFastMode, asOptionalBoolean, parsed.fastMode) so
legacy aliasing works correctly.
In `@apps/desktop/src/main/services/automations/automationPlannerService.ts`:
- Around line 755-757: The spread logic that emits fastMode should evaluate
action?.fastMode and action?.codexFastMode independently because using typeof
(action?.fastMode ?? action?.codexFastMode) can hide a valid boolean fallback
when the first value exists but is not a boolean; update the construction that
currently uses the ternary with typeof (action?.fastMode ??
action?.codexFastMode) to instead check each field separately (e.g., test typeof
action?.fastMode === "boolean" first, else test typeof action?.codexFastMode ===
"boolean") and only include { fastMode: ... } when a boolean is found,
referencing the same action object and the properties fastMode and codexFastMode
so fallback works correctly.
In `@apps/desktop/src/main/services/chat/agentChatService.ts`:
- Around line 24087-24093: The current code unconditionally deletes
managed.session.fastMode when nextProvider === "claude", which can drop a
user-enabled fastMode even if the target Claude model supports it; remove that
unconditional delete and instead only clear fastMode when the destination model
does not support it by consulting sessionSupportsFastMode (use the same check
used later with the model identifier/descriptor.id or nextModel); this makes the
model update path consistent with session creation and preserves user fastMode
when sessionSupportsFastMode(...) returns true while still clearing it when the
new model lacks fast-mode support.
In `@apps/desktop/src/renderer/components/chat/AgentChatPane.tsx`:
- Around line 8180-8223: handleFastModeChange currently calls
window.ade.agentChat.updateSession immediately which allows concurrent toggles
to race; change it to serialize fast-mode mutations by checking
pendingFastModeUpdateRef.current for the same session and awaiting its promise
(or chaining off it) before issuing a new updateSession call, incrementing
fastModeUpdateCounterRef and computing a new updateId only when ready; retain
the existing optimistic UI via patchSessionSummary/setFastMode, ensure the
finally block clears pendingFastModeUpdateRef for that session/updateId, and
reuse updatePromise/refreshSessions/error handling logic so only one
updateSession runs at a time per session (refer to handleFastModeChange,
pendingFastModeUpdateRef, fastModeUpdateCounterRef, updatePromise,
updateSession, patchSessionSummary, refreshSessions).
In `@apps/desktop/src/renderer/components/chat/ChatModelSelectionPendingCard.tsx`:
- Around line 78-80: The fastMode state in ChatModelSelectionPendingCard can
remain true when the user selects a model that doesn't support fastMode; update
the component to reset/clear fastMode whenever the selected model (e.g., the
selected model prop or the suggested?.model entry used to initialize state)
changes to one that lacks fast capability — detect model changes (where
selected/suggested model is read, e.g., around the initialization and the
selection handlers at lines referenced) and call setFastMode(false) when that
model's supportsFast (or equivalent capability flag) is false so stale/invalid
fastMode values are never submitted downstream.
---
Outside diff comments:
In `@apps/ade-cli/src/tuiClient/app.tsx`:
- Around line 6614-6631: The Claude launch path builds a normalized object with
normalized.fastMode but never passes it into startClaudeTerminalSession, so
Claude chats ignore the fastMode toggle; update the startClaudeTerminalSession
calls (e.g., the call in app.tsx where title, model, reasoningEffort,
permissionMode, initialInput, cols, rows are passed) to also pass fastMode:
normalized.fastMode (and do the same for the other Claude launch location around
lines 8553-8563) so the new Claude terminal session respects the fastMode
setting.
- Around line 4302-4313: The payload sent to runClaudeStatusLineCommand drops
the deprecated alias model.codexFastMode, breaking existing status-line scripts;
update the model object construction in app.tsx (the call to
runClaudeStatusLineCommand / the model literal using modelState) to emit both
keys by adding a codexFastMode property (e.g., codexFastMode:
modelState.codexFastMode ?? modelState.fastMode) alongside fastMode so legacy
scripts continue to see the deprecated field until fully migrated.
In `@apps/desktop/src/renderer/components/chat/AgentChatPane.tsx`:
- Around line 7106-7113: The handoff call is incorrectly sending a fastMode
override for OpenCode targets because fastMode is only rendered in the Codex UI
branch; update the payload building for window.ade.agentChat.handoff so that
fastMode is included only when handoffTargetProvider === "codex" (not when
"opencode"), i.e., change the spread condition around fastMode to explicitly
check for codex, and mirror the same change in the other affected call sites
(the similar block around lines 8417-8456) so OpenCode never receives a hidden
fastMode flag.
- Around line 2245-2258: normalizeStoredComposerDraft currently uses
getModelById(modelId) only, so runtime-discovered models appear unsupported and
fastMode can be lost; change the lookup so desc is resolved from the runtime
catalog when getModelById returns null (e.g., fallback to the runtime-discovered
model lookup or runtimeCatalog.get/model lookup) before calling
modelSupportsFastMode(desc) and readStoredFastMode(value), and add any needed
import/usage of the runtime catalog helper so runtime models restore their
fastMode correctly.
---
Duplicate comments:
In `@apps/desktop/src/main/services/automations/automationPlannerService.ts`:
- Around line 864-866: The current conditional uses typeof
(requestedExecution.session?.fastMode ??
requestedExecution.session?.codexFastMode) === "boolean" which prevents falling
back to codexFastMode when fastMode exists but isn’t a boolean; update the logic
in the spread that builds fastMode so it explicitly checks fastMode first and
only if its typeof !== "boolean" then checks typeof
requestedExecution.session?.codexFastMode === "boolean" and uses that, otherwise
omit fastMode; locate the ternary using requestedExecution.session?.fastMode and
requestedExecution.session?.codexFastMode and replace it with a two-step
type-check (fastMode then codexFastMode) to preserve the intended fallback
behavior.
---
Nitpick comments:
In `@apps/desktop/src/main/services/ai/tools/orchestrationTools.ts`:
- Around line 186-194: The schema for modelOverride currently marks
reasoningEffort and fastMode as .optional() and then calls .partial({
reasoningEffort: true, fastMode: true }) unnecessarily; remove the .partial(...)
call in the modelOverride z.object declaration (and the identical redundant
.partial at lines later in the file) so the optional flags on reasoningEffort
and fastMode are the sole indicators of optionality—look for the modelOverride
object and the properties reasoningEffort and fastMode to locate and remove the
redundant .partial usage.
In `@apps/desktop/src/renderer/components/chat/AgentChatComposer.test.tsx`:
- Around line 537-553: The test name "toggles Codex fast mode for supported
models" is outdated; update the test description to reference the
provider-agnostic field (fastMode) while keeping the intent. Rename the it(...)
description to something like "toggles fast mode for Codex sessions with
supported models" (similarly update the other test "hides Codex fast mode for
unsupported models"), leaving the test body, props passed to renderComposer
(sessionProvider, modelId, availableModelIds, fastMode, onFastModeChange), and
assertions unchanged so renderComposer, fastMode, and onFastModeChange continue
to be used as before.
In `@apps/desktop/src/shared/types/chat.ts`:
- Around line 1311-1313: Update the legacy boolean field declarations to use
JSDoc `@deprecated` annotations so IDEs and linters pick up the deprecation:
replace the inline comment on codexFastMode with a JSDoc block like /**
`@deprecated` Use fastMode. Accepted for older renderer/IPC callers. */ placed
immediately above the codexFastMode property, and apply the same change to the
codexFastMode definitions in the AgentChatLaunchCliArgs, AgentChatHandoffArgs,
and AgentChatUpdateSessionArgs interfaces so tooling shows
strikethroughs/warnings while retaining fastMode as the preferred property.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 19f63200-b28c-444b-859a-e1660732b161
⛔ Files ignored due to path filters (1)
docs/features/chat/agent-routing.mdis excluded by!docs/**
📒 Files selected for processing (58)
apps/ade-cli/src/cli.tsapps/ade-cli/src/services/sync/syncRemoteCommandService.tsapps/ade-cli/src/tuiClient/__tests__/adeApi.test.tsapps/ade-cli/src/tuiClient/__tests__/planMode.test.tsapps/ade-cli/src/tuiClient/adeApi.tsapps/ade-cli/src/tuiClient/app.tsxapps/ade-cli/src/tuiClient/types.tsapps/desktop/src/main/services/ai/tools/orchestrationTools.test.tsapps/desktop/src/main/services/ai/tools/orchestrationTools.tsapps/desktop/src/main/services/automations/automationPlannerService.tsapps/desktop/src/main/services/automations/automationService.test.tsapps/desktop/src/main/services/automations/automationService.tsapps/desktop/src/main/services/chat/agentChatCliLaunch.test.tsapps/desktop/src/main/services/chat/agentChatCliLaunch.tsapps/desktop/src/main/services/chat/agentChatService.test.tsapps/desktop/src/main/services/chat/agentChatService.tsapps/desktop/src/main/services/chat/cursorModelsDiscovery.test.tsapps/desktop/src/main/services/chat/cursorModelsDiscovery.tsapps/desktop/src/main/services/chat/droidModelsDiscovery.test.tsapps/desktop/src/main/services/chat/droidModelsDiscovery.tsapps/desktop/src/main/services/config/projectConfigService.test.tsapps/desktop/src/main/services/config/projectConfigService.tsapps/desktop/src/main/services/ipc/registerIpc.tsapps/desktop/src/main/services/orchestration/runtimeProfile.tsapps/desktop/src/main/services/pty/ptyService.test.tsapps/desktop/src/main/services/pty/ptyService.tsapps/desktop/src/main/services/review/reviewService.test.tsapps/desktop/src/main/services/review/reviewService.tsapps/desktop/src/main/utils/terminalSessionSignals.test.tsapps/desktop/src/main/utils/terminalSessionSignals.tsapps/desktop/src/renderer/browserMock.tsapps/desktop/src/renderer/components/app/BatchLaunchModal.tsxapps/desktop/src/renderer/components/app/LinearQuickViewButton.tsxapps/desktop/src/renderer/components/automations/ActionRow.tsxapps/desktop/src/renderer/components/automations/RulesTab.tsxapps/desktop/src/renderer/components/automations/components/RuleEditorPanel.tsxapps/desktop/src/renderer/components/chat/AgentChatComposer.test.tsxapps/desktop/src/renderer/components/chat/AgentChatComposer.tsxapps/desktop/src/renderer/components/chat/AgentChatPane.test.tsxapps/desktop/src/renderer/components/chat/AgentChatPane.tsxapps/desktop/src/renderer/components/chat/ChatModelSelectionPendingCard.tsxapps/desktop/src/renderer/components/prs/shared/PrRequestAiReviewDialog.tsxapps/desktop/src/renderer/components/review/ReviewPage.test.tsxapps/desktop/src/renderer/components/review/ReviewPage.tsxapps/desktop/src/renderer/components/shared/ReviewLaunchModelControls.tsxapps/desktop/src/renderer/components/terminals/cliLaunch.test.tsapps/desktop/src/renderer/lib/draftLaunchJobs.tsapps/desktop/src/renderer/lib/linearBatchLaunch.test.tsapps/desktop/src/renderer/lib/linearBatchLaunch.tsapps/desktop/src/shared/cliLaunch.tsapps/desktop/src/shared/modelRegistry.test.tsapps/desktop/src/shared/modelRegistry.tsapps/desktop/src/shared/types/automations.tsapps/desktop/src/shared/types/chat.tsapps/desktop/src/shared/types/config.tsapps/desktop/src/shared/types/orchestration.tsapps/desktop/src/shared/types/review.tsapps/desktop/src/shared/types/sessions.ts
💤 Files with no reviewable changes (1)
- apps/desktop/src/main/services/chat/droidModelsDiscovery.ts
…deRabbit x6) Greptile: - ReviewPage display + reviewService.executeReviewerPass now read `fastMode ?? codexFastMode` so legacy persisted runs keep fast mode. - openCodeVariantForLaunch: document that fast supersedes reasoningEffort. CodeRabbit: - cli.ts: mirror fastMode to the deprecated codexFastMode on OUTBOUND launch payloads so a pre-rename desktop daemon still honors --fast. - syncRemoteCommandService + automationPlannerService: normalize each fast field independently so a non-boolean fastMode can't drop a valid codexFastMode. - agentChatService.updateSession: only clear fastMode on a Claude switch when the target model lacks fast support (Opus supports it). - AgentChatPane.handleFastModeChange: serialize rapid toggles via pendingFastModeUpdateRef so writes persist in order. - ChatModelSelectionPendingCard: clear/gate stale fastMode when the picked model doesn't support it. Tests added: agentChatService (preserve/clear Claude fast on model switch), reviewService (legacy codexFastMode-only config launches fast), automation- PlannerService (non-boolean fastMode falls back to codexFastMode). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
@copilot review but do not make fixes |
Generalizes the Codex-only fast toggle into a provider-agnostic
fastMode.What changed
codexFastMode→fastModeacross chat, automations, review, orchestration, batch launch, and the TUI.--settings '{"fastMode":…}'CLI flag + Agent SDK settings layer + liveapplyFlagSettingsruntime control. NewserviceTiers:["fast"]on Opus models.service_tier/features.fast_mode-cflags +service_tierJSON-RPC arg; track the app-server's effective tier inAgentChatSession.codexServiceTier.--variant faston launch/resume.serviceTiersmodel-descriptor field.@deprecated codexFastModealiases read at every input/persistence boundary (fastMode ?? codexFastMode).Tests: updated/added across services, shared CLI builders, terminal resume signals, and the TUI, including deprecated-alias fallback coverage. Local gate green (typecheck + lint + all 8 vitest shards + build, Node 22).
Summary by CodeRabbit
New Features
Improvements
Greptile Summary
This PR generalises the Codex-only
codexFastModetoggle into a provider-agnosticfastModefield across ~60 files, wiring it to Claude (--settings '{"fastMode":…}'+ Agent SDKapplyFlagSettings), Codex (service_tier/features.fast_mode), OpenCode (--variant fast), and Cursor (explicit standard-tier SDK param). Backward-compat aliases (fastMode ?? codexFastMode) are applied consistently at every DB-read, IPC, config-parse, and localStorage-normalisation boundary.fastMode; deprecatedcodexFastModefields are kept with@deprecatedJSDoc and resolved at every entry point.applyFlagSettingscall on toggle (with session-reset fallback); Codex carriesservice_tier+features.fast_modeCLI flags; OpenCode gainsrun --interactive --variant fast; Cursor gains explicit standard-tier param when fast is off.serviceTiersmodel-descriptor field drivesmodelSupportsFastMode, gating the toggle for Opus models and the two active GPT models.Confidence Score: 5/5
Safe to merge. The rename is thorough, every DB-read/IPC/config boundary applies the codexFastMode → fastMode fallback, and all three new provider paths degrade gracefully.
The refactor consistently applies backward-compat fallbacks at every persistence and IPC boundary. The only notable inconsistency is that initialFastMode defaults to true for unknown Claude descriptors, but sessionEffectiveFastMode guards the runtime call so no incorrect API request is made.
agentChatService.ts initialFastMode fallback for unknown Claude descriptors; terminalSessionSignals.ts openCode variant duplication.
Important Files Changed
Sequence Diagram
sequenceDiagram participant UI as AgentChatPane participant IPC as agentChatService participant RT as Runtime Note over UI,RT: Fast-mode toggle (Claude) UI->>IPC: "updateSession({ fastMode: true })" IPC->>IPC: "managed.session.fastMode = true" IPC->>IPC: sessionEffectiveFastMode() check IPC->>RT: "applyFlagSettings({ fastMode: true })" alt applyFlagSettings available RT-->>IPC: ok else not available or error IPC->>RT: resetClaudeQuerySession() end IPC-->>UI: updated session (fastMode: true) Note over UI,RT: Fast-mode toggle (Codex) UI->>IPC: "updateSession({ fastMode: true })" IPC->>IPC: "managed.session.fastMode = true" IPC->>IPC: "managed.runtime.threadResumed = false" IPC-->>UI: updated session (fastMode: true) Note over IPC,RT: service_tier=fast embedded in next CLI command Note over UI,RT: Fast-mode toggle (OpenCode) UI->>IPC: "updateSession({ fastMode: true })" IPC->>IPC: "managed.session.fastMode = true" IPC-->>UI: updated session (fastMode: true) Note over IPC,RT: --variant fast embedded in per-turn commandPrompt To Fix All With AI
Reviews (2): Last reviewed commit: "ship: iter 1 — fastMode backward-compat ..." | Re-trigger Greptile