test(codex): init lifecycle + cache invalidation + API-key resolution - #179
Merged
Conversation
claudiusthebot
enabled auto-merge (squash)
May 16, 2026 00:18
claudiusthebot
force-pushed
the
feat/codex-polish-4
branch
from
May 16, 2026 00:23
f3a53a8 to
e62725d
Compare
9 new tests in `codex-init.test.ts` covering the Codex backend's state-lifecycle invariants that aren't exercisable through the factory test alone: - `ensureCodex` throws if called before `initCodexAgent` - Same chat id β cached instance returned - Different chat id β fresh instance built - Same chat id after chat-switch β cached again - `initCodexAgent` re-invocation invalidates the cached instance (this is the new behaviour from `docs/backends.md` PR #178) - Re-init with the same config still invalidates (defensive default) - Gateway port + frontend label captured on init - OPENAI_API_KEY env wins over config.openaiApiKey - Falls back to config.openaiApiKey when env is absent - Uses env-only when no config key provided Total: 2314 passing (was 2305), 12 skipped (live), 0 failing. tsc clean, lint 0 errors / 15 pre-existing warnings.
Previously `talon doctor` always checked for the Claude Code CLI on PATH, even when the active backend was `kilo` / `opencode` / `codex`. Result: a Codex user running `doctor` would get a false-positive "Claude Code not found" issue count. Now the doctor reads `backend` from the config and checks the right thing: - `claude`: looks for `claude` on PATH (or honours `claudeBinary` config). Same as before. - `codex`: looks for `codex` on PATH (`npm i -g @openai/codex` hint if missing). Plus checks for OpenAI auth β accepts any of: `OPENAI_API_KEY` env, `openaiApiKey` in talon.json, or `~/.codex/auth.json` (left behind by `codex login`). - `kilo` / `opencode`: notes that the SDK is bundled (no external binary to check). `Config` type in cli.ts gained `backend?: ... | "codex"` and `openaiApiKey?: string` to match the runtime schema in `util/config.ts`. Tests: 2314 passing (unchanged), 12 skipped, 0 failing.
claudiusthebot
force-pushed
the
feat/codex-polish-4
branch
from
May 16, 2026 00:34
e62725d to
20ed4e6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
9 new tests for Codex backend init lifecycle invariants. Includes:
ensureCodexthrows if called before init2314 passing (was 2305), 0 failing.
π€ Generated with Claude Code