diff --git a/codex/SKILL.md b/codex/SKILL.md index 3cbb7850..df8f69ce 100644 --- a/codex/SKILL.md +++ b/codex/SKILL.md @@ -424,8 +424,8 @@ If token count is not available, display: `Tokens: unknown` ## Error Handling - **Binary not found:** Detected in Step 0. Stop with install instructions. -- **API key missing:** Codex prints an auth error to stderr. Surface the error: - "Codex authentication failed. Set OPENAI_API_KEY in your environment." +- **Auth error:** Codex prints an auth error to stderr. Surface the error: + "Codex authentication failed. Run `codex login` in your terminal to authenticate via ChatGPT." - **Timeout:** If the Bash call times out (5 min), tell the user: "Codex timed out after 5 minutes. The diff may be too large or the API may be slow. Try again or use a smaller scope." - **Empty response:** If `$TMPRESP` is empty or doesn't exist, tell the user: diff --git a/codex/SKILL.md.tmpl b/codex/SKILL.md.tmpl index ffa0f684..ea02612c 100644 --- a/codex/SKILL.md.tmpl +++ b/codex/SKILL.md.tmpl @@ -278,8 +278,8 @@ If token count is not available, display: `Tokens: unknown` ## Error Handling - **Binary not found:** Detected in Step 0. Stop with install instructions. -- **API key missing:** Codex prints an auth error to stderr. Surface the error: - "Codex authentication failed. Set OPENAI_API_KEY in your environment." +- **Auth error:** Codex prints an auth error to stderr. Surface the error: + "Codex authentication failed. Run `codex login` in your terminal to authenticate via ChatGPT." - **Timeout:** If the Bash call times out (5 min), tell the user: "Codex timed out after 5 minutes. The diff may be too large or the API may be slow. Try again or use a smaller scope." - **Empty response:** If `$TMPRESP` is empty or doesn't exist, tell the user: diff --git a/test/skill-validation.test.ts b/test/skill-validation.test.ts index 422e4932..118158d6 100644 --- a/test/skill-validation.test.ts +++ b/test/skill-validation.test.ts @@ -1176,10 +1176,10 @@ describe('Codex skill', () => { expect(content).not.toContain('/opt/homebrew/bin/codex'); }); - test('codex/SKILL.md contains error handling for missing binary and API key', () => { + test('codex/SKILL.md contains error handling for missing binary and auth', () => { const content = fs.readFileSync(path.join(ROOT, 'codex', 'SKILL.md'), 'utf-8'); expect(content).toContain('NOT_FOUND'); - expect(content).toContain('OPENAI_API_KEY'); + expect(content).toContain('codex login'); }); test('codex/SKILL.md uses mktemp for temp files', () => {