Skip to content

feature: add Codex Fast Mode support#2115

Draft
cvolzer3 wants to merge 3 commits into
mainfrom
codex/fast-mode-support
Draft

feature: add Codex Fast Mode support#2115
cvolzer3 wants to merge 3 commits into
mainfrom
codex/fast-mode-support

Conversation

@cvolzer3

@cvolzer3 cvolzer3 commented May 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add Codex service_tier support and persist the selected tier through local session creation/reconnects
  • add a lightning Fast Mode toggle beside the reasoning selector when Codex exposes a fast tier
  • defer Fast Mode process refreshes while prompts are running so changes apply to the next prompt

@cvolzer3 cvolzer3 changed the title Add Codex Fast Mode support feature: add Codex Fast Mode support May 8, 2026
@cvolzer3

cvolzer3 commented May 8, 2026

Copy link
Copy Markdown
Contributor Author

depends on: PostHog/posthog#58205

@charlesvien

Copy link
Copy Markdown
Member

Thread here, do we wanna make the mentioned changes? https://posthog.slack.com/archives/C09G8Q32R6F/p1778278633237439

@charlesvien charlesvien closed this Jun 4, 2026
@cvolzer3 cvolzer3 reopened this Jun 15, 2026
@greptile-apps

greptile-apps Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor
Prompt To Fix All With AI
Fix the following 2 code review issues. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 2
packages/agent/src/adapters/codex/codex-agent.ts:899-909
**Duplicate "priority" alias in two normalizers**

`toCodexServiceTier` here and `normalizeServiceTier` in `spawn.ts` both independently map `"priority"``"fast"`. If a new alias or tier is added, both functions must be updated in sync. The canonical mapping belongs in one place — the `spawn.ts` normalizer that actually writes the flag to the process args is the logical owner; `toCodexServiceTier` could delegate to it (or to a shared helper) rather than re-implementing the same switch.

### Issue 2 of 2
apps/code/src/main/services/agent/service.ts:1780-1804
**Service tier options defined in two places**

The full three-item options array (standard / fast / flex with their names and descriptions) is duplicated here and in `CODEX_SERVICE_TIER_OPTIONS` in `packages/agent/src/adapters/codex/codex-agent.ts`. If a description or new tier is added in one location, the other must be updated manually. A single exported constant shared by both modules would eliminate the duplication.

Reviews (1): Last reviewed commit: "Send Codex service tier to cloud runs" | Re-trigger Greptile

Comment on lines +899 to +909
this.codexProcessOptions.serviceTier = previousConfigValue;
this.sessionState.serviceTier = previousTier;
this.sessionState.configOptions = this.withCodexServiceTierOption(
this.sessionState.configOptions,
);
throw error;
}

this.sessionState.serviceTier = nextTier;
this.sessionState.configOptions = this.withCodexServiceTierOption(
this.sessionState.configOptions,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Duplicate "priority" alias in two normalizers

toCodexServiceTier here and normalizeServiceTier in spawn.ts both independently map "priority""fast". If a new alias or tier is added, both functions must be updated in sync. The canonical mapping belongs in one place — the spawn.ts normalizer that actually writes the flag to the process args is the logical owner; toCodexServiceTier could delegate to it (or to a shared helper) rather than re-implementing the same switch.

Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/agent/src/adapters/codex/codex-agent.ts
Line: 899-909

Comment:
**Duplicate "priority" alias in two normalizers**

`toCodexServiceTier` here and `normalizeServiceTier` in `spawn.ts` both independently map `"priority"``"fast"`. If a new alias or tier is added, both functions must be updated in sync. The canonical mapping belongs in one place — the `spawn.ts` normalizer that actually writes the flag to the process args is the logical owner; `toCodexServiceTier` could delegate to it (or to a shared helper) rather than re-implementing the same switch.

How can I resolve this? If you propose a fix, please make it concise.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment on lines +1780 to +1804
configOptions.push({
id: "service_tier",
name: "Speed",
type: "select",
currentValue: "standard",
options: [
{
value: "standard",
name: "Standard",
description: "Default Codex service tier",
},
{
value: "fast",
name: "Fast",
description: "Request Codex fast mode for lower latency",
},
{
value: "flex",
name: "Flex",
description: "Request Codex flex mode",
},
],
category: "service_tier",
description: "Choose the Codex service tier for new turns",
});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Service tier options defined in two places

The full three-item options array (standard / fast / flex with their names and descriptions) is duplicated here and in CODEX_SERVICE_TIER_OPTIONS in packages/agent/src/adapters/codex/codex-agent.ts. If a description or new tier is added in one location, the other must be updated manually. A single exported constant shared by both modules would eliminate the duplication.

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/code/src/main/services/agent/service.ts
Line: 1780-1804

Comment:
**Service tier options defined in two places**

The full three-item options array (standard / fast / flex with their names and descriptions) is duplicated here and in `CODEX_SERVICE_TIER_OPTIONS` in `packages/agent/src/adapters/codex/codex-agent.ts`. If a description or new tier is added in one location, the other must be updated manually. A single exported constant shared by both modules would eliminate the duplication.

How can I resolve this? If you propose a fix, please make it concise.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@cvolzer3 cvolzer3 force-pushed the codex/fast-mode-support branch from e84f91f to 147d793 Compare June 15, 2026 19:13
@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit bd3949d.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants