Skip to content

Commit c5a32b2

Browse files
committed
feat: codex 5.4 default and pass to model
1 parent 70f4a18 commit c5a32b2

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

apps/code/src/main/services/agent/service.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { getEffortOptions } from "@posthog/agent/adapters/claude/session/models"
1818
import { Agent } from "@posthog/agent/agent";
1919
import { getAvailableModes } from "@posthog/agent/execution-mode";
2020
import {
21+
DEFAULT_CODEX_MODEL,
2122
DEFAULT_GATEWAY_MODEL,
2223
fetchGatewayModels,
2324
formatGatewayModelName,
@@ -554,6 +555,7 @@ When creating pull requests, add the following footer at the end of the PR descr
554555
adapter,
555556
gatewayUrl: proxyUrl,
556557
codexBinaryPath: adapter === "codex" ? getCodexBinaryPath() : undefined,
558+
model,
557559
processCallbacks: {
558560
onProcessSpawned: (info) => {
559561
this.processTracking.register(
@@ -1622,7 +1624,9 @@ For git operations while detached:
16221624

16231625
const defaultModel =
16241626
adapter === "codex"
1625-
? (modelOptions[0]?.value ?? "")
1627+
? (modelOptions.find((o) => o.value === DEFAULT_CODEX_MODEL)?.value ??
1628+
modelOptions[0]?.value ??
1629+
"")
16261630
: DEFAULT_GATEWAY_MODEL;
16271631

16281632
const resolvedModelId = modelOptions.some((o) => o.value === defaultModel)

packages/agent/src/agent.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
} from "./adapters/acp-connection";
55
import {
66
BLOCKED_MODELS,
7+
DEFAULT_CODEX_MODEL,
78
DEFAULT_GATEWAY_MODEL,
89
fetchModelsList,
910
} from "./gateway-models";
@@ -104,7 +105,9 @@ export class Agent {
104105
}
105106

106107
if (!sanitizedModel || !allowedModelIds?.has(sanitizedModel)) {
107-
sanitizedModel = codexModelIds[0];
108+
sanitizedModel = codexModelIds.includes(DEFAULT_CODEX_MODEL)
109+
? DEFAULT_CODEX_MODEL
110+
: codexModelIds[0];
108111
}
109112
}
110113
if (!sanitizedModel && options.adapter !== "codex") {

packages/agent/src/gateway-models.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ export interface FetchGatewayModelsOptions {
1717

1818
export const DEFAULT_GATEWAY_MODEL = "claude-opus-4-6";
1919

20+
export const DEFAULT_CODEX_MODEL = "gpt-5.4";
21+
2022
export const BLOCKED_MODELS = new Set(["gpt-5-mini", "openai/gpt-5-mini"]);
2123

2224
type ModelsListResponse =

0 commit comments

Comments
 (0)