Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion .github/workflows/codex-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,22 @@ jobs:
npm run generate-types
git add package.json package-lock.json src/app-server
git commit -m "Update codex to ${{ env.VERSION }}"

- name: Finalize update with Codex
id: codex-finalize
uses: openai/codex-action@v1
with:
openai-api-key: ${{ secrets.OPENAI_API_KEY }}
codex-version: ${{ env.VERSION }}
codex-args: '-c shell_environment_policy.inherit=none'
output-file: pr-body.md
prompt: >
Finalize the update using codex-update-compat skill.
Commit the changes, the message should mention that types or/and tests after the update were fixed.
Do not include validation run details to the final message.

- name: Push branch updates
run: |
git push origin "${{ env.BRANCH }}"

- name: Generate GitHub App token
Expand All @@ -75,8 +91,10 @@ jobs:
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
echo -e "[What's new](https://github.com/openai/codex/releases/tag/rust-v${{ env.VERSION }})\n\n$(cat pr-body.md 2>/dev/null || true)" > pr-body.md

gh pr create \
--base main \
--title "Update codex to ${{ env.VERSION }}" \
--body "[What's new](https://github.com/openai/codex/releases/tag/rust-v${{ env.VERSION }})" \
--body-file pr-body.md \
--label "codex-update"
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
- Tests live under `src/__tests__/` and use Vitest.
- Favor event-driven assertions (see `src/__tests__/CodexACPAgent/*`).
- Prefer snapshot-based tests using `toMatchFileSnapshot()` over inline assertions.
- When snapshot response data drifts, prefer replacing that response payload with a stable placeholder over asserting fragile fields.
- When snapshot response data drifts, prefer replacing that response payload with a stable placeholder over asserting fragile fields (except for 'model/list').
- Focus on behavior and outputs rather than implementation details.
- Use `/run-codex` skill (`.claude/skills/run-codex/`) to test with real Codex and observe actual events.

Expand Down
65 changes: 30 additions & 35 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"license": "ISC",
"type": "module",
"devDependencies": {
"@openai/codex": "^0.111.0",
"@openai/codex": "^0.114.0",
"@types/node": "^24.10.1",
"mcp-hello-world": "^1.1.2",
"tsx": "^4.20.6",
Expand Down
4 changes: 4 additions & 0 deletions src/CodexEventHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ export class CodexEventHandler {
case "turn/completed":
this.sessionState.currentTurnId = null;
return null;
case "hook/started":
case "hook/completed":
return null;
case "thread/tokenUsage/updated":
this.handleTokenUsageUpdated(notification.params);
return null;
Expand All @@ -92,6 +95,7 @@ export class CodexEventHandler {
case "item/reasoning/summaryPartAdded":
//skipped events
case "item/reasoning/textDelta": //for raw output
case "command/exec/outputDelta":
case "turn/diff/updated":
case "item/commandExecution/terminalInteraction":
case "item/fileChange/outputDelta":
Expand Down
18 changes: 12 additions & 6 deletions src/__tests__/CodexACPAgent/CodexAcpClient.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,25 @@
await expect(transportDump).toMatchFileSnapshot("data/start-conversation.json");
});

it('should throw error without authentication', async () => {
it('should handle new session without authentication based on server policy', async () => {
const codexAcpAgent = fixture.getCodexAcpAgent();

await codexAcpAgent.initialize({protocolVersion: 1});
await fixture.getCodexAcpClient().logout();
fixture.clearCodexConnectionDump();

await expect(
codexAcpAgent.newSession({cwd: "", mcpServers: []})
).rejects.toThrow("Authentication required");
if (await fixture.getCodexAcpClient().authRequired()) {
await expect(
codexAcpAgent.newSession({cwd: "", mcpServers: []})
).rejects.toThrow("Authentication required");

const transportDump = fixture.getCodexConnectionDump(ignoredFields);
await expect(transportDump).toMatchFileSnapshot("data/auth-failed.json");
const transportDump = fixture.getCodexConnectionDump(ignoredFields);
await expect(transportDump).toMatchFileSnapshot("data/auth-failed.json");

Check failure on line 73 in src/__tests__/CodexACPAgent/CodexAcpClient.test.ts

View workflow job for this annotation

GitHub Actions / test

src/__tests__/CodexACPAgent/CodexAcpClient.test.ts > ACP server test > should handle new session without authentication based on server policy

Error: Snapshot `ACP server test > should handle new session without authentication based on server policy 1` mismatched - Expected + Received @@ -8,5 +8,17 @@ { "eventType": "response", "account": null, "requiresOpenaiAuth": true } + { + "eventType": "request", + "method": "account/read", + "params": { + "refreshToken": false + } + } + { + "eventType": "response", + "account": null, + "requiresOpenaiAuth": true + } ❯ src/__tests__/CodexACPAgent/CodexAcpClient.test.ts:73:13
return;
}

const newSessionResponse = await codexAcpAgent.newSession({cwd: "", mcpServers: []});
expect(newSessionResponse.sessionId).toBeDefined();
});

it('should authenticate with key', async () => {
Expand Down
33 changes: 28 additions & 5 deletions src/__tests__/CodexACPAgent/data/auth-with-key.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,12 @@
"id": "id",
"model": "model",
"upgrade": "upgrade",
"upgradeInfo": null,
"upgradeInfo": {
"model": "model",
"upgradeCopy": null,
"modelLink": null,
"migrationMarkdown": "Introducing GPT-5.4\n\nCodex just got an upgrade with GPT-5.4, our most capable model for professional work. It outperforms prior models while being more token efficient, with notable improvements on long-running tasks, tool calling, computer use, and frontend development.\n\nLearn more: https://openai.com/index/introducing-gpt-5-4\n\nYou can always keep using GPT-5.3-Codex if you prefer.\n"
},
"availabilityNux": null,
"displayName": "gpt-5.3-codex",
"description": "Latest frontier agentic coding model.",
Expand All @@ -96,6 +101,24 @@
"supportsPersonality": true,
"isDefault": true
},
{
"id": "id",
"model": "model",
"upgrade": "upgrade",
"upgradeInfo": null,
"availabilityNux": null,
"displayName": "gpt-5.4",
"description": "Latest frontier agentic coding model.",
"hidden": false,
"supportedReasoningEfforts": "supportedReasoningEfforts",
"defaultReasoningEffort": "medium",
"inputModalities": [
"text",
"image"
],
"supportsPersonality": true,
"isDefault": false
},
{
"id": "id",
"model": "model",
Expand All @@ -104,7 +127,7 @@
"model": "model",
"upgradeCopy": null,
"modelLink": null,
"migrationMarkdown": "**Codex just got an upgrade. Introducing {model_to}.**\n\nCodex is now powered by {model_to}, our most capable agentic coding model yet. It's built for long-running, project-scale work, with mid-turn steering + frequent progress updates so you can collaborate while it runs (and it's faster too).\n\nLearn more: https://openai.com/index/introducing-gpt-5-3-codex/\n\nYou can keep using {model_from} if you prefer.\n"
"migrationMarkdown": "Introducing GPT-5.4\n\nCodex just got an upgrade with GPT-5.4, our most capable model for professional work. It outperforms prior models while being more token efficient, with notable improvements on long-running tasks, tool calling, computer use, and frontend development.\n\nLearn more: https://openai.com/index/introducing-gpt-5-4\n\nYou can always keep using GPT-5.3-Codex if you prefer.\n"
},
"availabilityNux": null,
"displayName": "gpt-5.2-codex",
Expand All @@ -127,7 +150,7 @@
"model": "model",
"upgradeCopy": null,
"modelLink": null,
"migrationMarkdown": "**Codex just got an upgrade. Introducing {model_to}.**\n\nCodex is now powered by {model_to}, our most capable agentic coding model yet. It's built for long-running, project-scale work, with mid-turn steering + frequent progress updates so you can collaborate while it runs (and it's faster too).\n\nLearn more: https://openai.com/index/introducing-gpt-5-3-codex/\n\nYou can keep using {model_from} if you prefer.\n"
"migrationMarkdown": "Introducing GPT-5.4\n\nCodex just got an upgrade with GPT-5.4, our most capable model for professional work. It outperforms prior models while being more token efficient, with notable improvements on long-running tasks, tool calling, computer use, and frontend development.\n\nLearn more: https://openai.com/index/introducing-gpt-5-4\n\nYou can always keep using GPT-5.3-Codex if you prefer.\n"
},
"availabilityNux": null,
"displayName": "gpt-5.1-codex-max",
Expand All @@ -150,7 +173,7 @@
"model": "model",
"upgradeCopy": null,
"modelLink": null,
"migrationMarkdown": "**Codex just got an upgrade. Introducing {model_to}.**\n\nCodex is now powered by {model_to}, our most capable agentic coding model yet. It's built for long-running, project-scale work, with mid-turn steering + frequent progress updates so you can collaborate while it runs (and it's faster too).\n\nLearn more: https://openai.com/index/introducing-gpt-5-3-codex/\n\nYou can keep using {model_from} if you prefer.\n"
"migrationMarkdown": "Introducing GPT-5.4\n\nCodex just got an upgrade with GPT-5.4, our most capable model for professional work. It outperforms prior models while being more token efficient, with notable improvements on long-running tasks, tool calling, computer use, and frontend development.\n\nLearn more: https://openai.com/index/introducing-gpt-5-4\n\nYou can always keep using GPT-5.3-Codex if you prefer.\n"
},
"availabilityNux": null,
"displayName": "gpt-5.2",
Expand All @@ -173,7 +196,7 @@
"model": "model",
"upgradeCopy": null,
"modelLink": null,
"migrationMarkdown": "**Codex just got an upgrade. Introducing {model_to}.**\n\nCodex is now powered by {model_to}, our most capable agentic coding model yet. It's built for long-running, project-scale work, with mid-turn steering + frequent progress updates so you can collaborate while it runs (and it's faster too).\n\nLearn more: https://openai.com/index/introducing-gpt-5-3-codex/\n\nYou can keep using {model_from} if you prefer.\n"
"migrationMarkdown": "Introducing GPT-5.4\n\nCodex just got an upgrade with GPT-5.4, our most capable model for professional work. It outperforms prior models while being more token efficient, with notable improvements on long-running tasks, tool calling, computer use, and frontend development.\n\nLearn more: https://openai.com/index/introducing-gpt-5-4\n\nYou can always keep using GPT-5.3-Codex if you prefer.\n"
},
"availabilityNux": null,
"displayName": "gpt-5.1-codex-mini",
Expand Down
Loading
Loading