Skip to content

Commit 057a34e

Browse files
committed
build: Finish update using codex
1 parent ada7daf commit 057a34e

4 files changed

Lines changed: 33 additions & 11 deletions

File tree

.agents/skills/codex-update-compat/references/codex-update-playbook.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ Approach:
6666
2. Run focused tests for touched event/file.
6767
3. Update snapshots only after confirming expected behavior.
6868
4. Run full suite at end.
69+
5. Do not change the logic of authentication tests.
6970

7071
## Known Env-Dependent Failures
7172

.github/workflows/codex-update.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,22 @@ jobs:
6262
npm run generate-types
6363
git add package.json package-lock.json src/app-server
6464
git commit -m "Update codex to ${{ env.VERSION }}"
65+
66+
- name: Finalize update with Codex
67+
id: codex-finalize
68+
uses: openai/codex-action@v1
69+
with:
70+
openai-api-key: ${{ secrets.OPENAI_API_KEY }}
71+
codex-version: ${{ env.VERSION }}
72+
codex-args: '-c shell_environment_policy.inherit=none'
73+
output-file: pr-body.md
74+
prompt: >
75+
Finalize the update using codex-update-compat skill.
76+
Commit the changes, the message should mention that types or/and tests after the update were fixed.
77+
Do not include validation run details, list of commits or any hyperlinks to the final message, mention only what you changed and why.
78+
79+
- name: Push branch updates
80+
run: |
6581
git push origin "${{ env.BRANCH }}"
6682
6783
- name: Generate GitHub App token
@@ -75,8 +91,10 @@ jobs:
7591
env:
7692
GH_TOKEN: ${{ steps.app-token.outputs.token }}
7793
run: |
94+
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
95+
7896
gh pr create \
7997
--base main \
8098
--title "Update codex to ${{ env.VERSION }}" \
81-
--body "[What's new](https://github.com/openai/codex/releases/tag/rust-v${{ env.VERSION }})" \
99+
--body-file pr-body.md \
82100
--label "codex-update"

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
- Tests live under `src/__tests__/` and use Vitest.
2121
- Favor event-driven assertions (see `src/__tests__/CodexACPAgent/*`).
2222
- Prefer snapshot-based tests using `toMatchFileSnapshot()` over inline assertions.
23-
- When snapshot response data drifts, prefer replacing that response payload with a stable placeholder over asserting fragile fields.
23+
- When snapshot response data drifts, prefer replacing that response payload with a stable placeholder over asserting fragile fields (except for 'model/list').
2424
- Focus on behavior and outputs rather than implementation details.
2525
- Use `/run-codex` skill (`.claude/skills/run-codex/`) to test with real Codex and observe actual events.
2626

src/__tests__/CodexACPAgent/CodexAcpClient.test.ts

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,18 +58,21 @@ describe('ACP server test', { timeout: 40_000 }, () => {
5858
});
5959

6060
it('should throw error without authentication', async () => {
61-
const codexAcpAgent = fixture.getCodexAcpAgent();
61+
await overrideCodexHome('cli_auth_credentials_store = "file"', async () => {
62+
const authFixture = createTestFixture();
63+
const codexAcpAgent = authFixture.getCodexAcpAgent();
6264

63-
await codexAcpAgent.initialize({protocolVersion: 1});
64-
await fixture.getCodexAcpClient().logout();
65-
fixture.clearCodexConnectionDump();
65+
await codexAcpAgent.initialize({protocolVersion: 1});
66+
await authFixture.getCodexAcpClient().logout();
67+
authFixture.clearCodexConnectionDump();
6668

67-
await expect(
68-
codexAcpAgent.newSession({cwd: "", mcpServers: []})
69-
).rejects.toThrow("Authentication required");
69+
await expect(
70+
codexAcpAgent.newSession({cwd: "", mcpServers: []})
71+
).rejects.toThrow("Authentication required");
7072

71-
const transportDump = fixture.getCodexConnectionDump(ignoredFields);
72-
await expect(transportDump).toMatchFileSnapshot("data/auth-failed.json");
73+
const transportDump = authFixture.getCodexConnectionDump(ignoredFields);
74+
await expect(transportDump).toMatchFileSnapshot("data/auth-failed.json");
75+
});
7376
});
7477

7578
it('should authenticate with key', async () => {

0 commit comments

Comments
 (0)