Skip to content
This repository was archived by the owner on Aug 6, 2026. It is now read-only.

feat(codex): normalize config options and update binary version - #1953

Merged
jonathanlab merged 1 commit into
mainfrom
posthog-code/bump-codex-adapter-to-latest-version
Apr 30, 2026
Merged

jonathanlab merged 1 commit into
mainfrom
posthog-code/bump-codex-adapter-to-latest-version

Conversation

@jonathanlab

Copy link
Copy Markdown
Contributor

Problem

The Codex agent needs to format model names consistently across configuration options, and the codex-acp binary should be updated to the latest version (0.12.0).

Changes

  • Updated codex-acp binary version from 0.11.1 to 0.12.0 in the download script
  • Added config option normalization to ensure model names are formatted consistently:

Created with PostHog Code

Generated-By: PostHog Code
Task-Id: cb22f81b-7734-43fa-9c85-46aa40b66d40
@greptile-apps

greptile-apps Bot commented Apr 30, 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/models.ts:45-50
**Server-provided `name` is always discarded**

`formatOption` unconditionally replaces `opt.name` with a value derived from `opt.value`, so any human-readable display name the server already sends (e.g. `"GPT-4.1 mini"`) is silently dropped. If the intent is to use the server name when present and only fall back to the computed one, the assignment should be conditional:

```typescript
const formatOption = (
  opt: SessionConfigSelectOption,
): SessionConfigSelectOption => ({
  ...opt,
  name: opt.name ?? formatCodexModelName(opt.value),
});
```

If the intent is always to override, a brief comment explaining why would prevent future readers from treating this as a bug.

### Issue 2 of 2
packages/agent/src/adapters/codex/models.ts:28-65
**Missing tests for normalization logic**

`formatCodexModelName` and `normalizeCodexConfigOptions` contain non-trivial transformation logic (regex digit-to-dot conversion, acronym lookup, capitalize-and-rejoin), but there are no tests for either function. Per the team's preference for parameterised tests, a test table with representative model name inputs (e.g. `gpt-4o`, `gpt-4-1`, `o4-mini`, `codex-mini-latest`) and their expected formatted output would be the right fit here.

Reviews (1): Last reviewed commit: "feat(codex): upgrade to codex-acp 0.12.0..." | Re-trigger Greptile

Comment thread packages/agent/src/adapters/codex/models.ts
Comment thread packages/agent/src/adapters/codex/models.ts
@jonathanlab
jonathanlab enabled auto-merge (squash) April 30, 2026 12:12
@jonathanlab
jonathanlab merged commit ebe9bef into main Apr 30, 2026
15 checks passed
@jonathanlab
jonathanlab deleted the posthog-code/bump-codex-adapter-to-latest-version branch April 30, 2026 13:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants