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
14 changes: 13 additions & 1 deletion .github/workflows/codex-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,18 @@ 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 Action (placeholder prompt)
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'
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.'

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

- name: Generate GitHub App token
Expand All @@ -78,5 +90,5 @@ jobs:
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 "[What's new](https://github.com/openai/codex/releases/tag/rust-v${{ env.VERSION }})<br/><br/>${{ steps.codex-finalize.outputs.final-message }}" \
--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
3 changes: 3 additions & 0 deletions src/CodexEventHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ export class CodexEventHandler {
case "item/reasoning/summaryTextDelta": //TODO streaming reasoning?
case "item/reasoning/summaryPartAdded":
//skipped events
case "command/exec/outputDelta":
case "hook/started":
case "hook/completed":
case "item/reasoning/textDelta": //for raw output
case "turn/diff/updated":
case "item/commandExecution/terminalInteraction":
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,22 @@ describe('ACP server test', { timeout: 40_000 }, () => {
await expect(transportDump).toMatchFileSnapshot("data/start-conversation.json");
});

it('should throw error without authentication', async () => {
it('should allow unauthenticated session when auth is not required', 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");
const authStatus = await codexAcpAgent.extMethod("authentication/status", {});
expect(authStatus["type"]).not.toEqual("api-key");
expect(authStatus["type"]).not.toEqual("chat-gpt");

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

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

it('should authenticate with key', async () => {
Expand All @@ -92,7 +95,10 @@ describe('ACP server test', { timeout: 40_000 }, () => {
const newSessionResponse = await codexAcpAgent.newSession({cwd: "", mcpServers: []});
expect(newSessionResponse.sessionId).toBeDefined()

const transportDump = keyFixture.getCodexConnectionDump([...ignoredFields, "upgrade"]);
const transportDump = keyFixture.getCodexConnectionDump(
[...ignoredFields, "upgrade"],
{placeholderResponseMethods: ["model/list"]}
);
await expect(transportDump).toMatchFileSnapshot("data/auth-with-key.json");

const authenticatedResponse = await keyFixture.getCodexAcpAgent().extMethod("authentication/status", {});
Expand Down
12 changes: 0 additions & 12 deletions src/__tests__/CodexACPAgent/data/auth-failed.json

This file was deleted.

Loading
Loading