fix: #6 — feat(codex): Codex adapter (Mode A + Mode B + skill)#16
Merged
Conversation
Mode A: scripture-lookup skill at adapters/codex/skills/scripture-lookup/ with agents/openai.yaml pinning allow_implicit_invocation: false (Codex equivalent of Claude's disable-model-invocation). Marker syntax for the existing UserPromptSubmit hook is the inline [[bible:John 3:16]] form already recognized by lookup-from-prompt. Mode B: cdx shell wrappers (POSIX bash + PowerShell) wrap codex and run scripture-mcp recap --terminal after exit, preserving the wrapped exit code. Codex has no Stop-equivalent hook, so the recap fires from the wrapping shell — physically outside any model_call input. README and init --target=codex --recap=on now print the alias-setup steps and the honest limitation: launching codex directly bypasses the recap. Embed assets via embed.FS and add structural tests asserting the skill contains no scripture text and the wrappers capture exit, recap, then exit with the captured code. Closes #6
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.
Summary
Closes #6.
Adds the Codex adapter assets — Mode A skill + per-agent invocation pin, and a shell wrapper for Mode B recap (since Codex has no Stop-equivalent hook).
Mode A
adapters/codex/skills/scripture-lookup/SKILL.md— manual fallback skill, contains no scripture text (verse content is fetched from the bundled MCP at runtime).adapters/codex/skills/scripture-lookup/agents/openai.yaml— pinsallow_implicit_invocation: falsefor the OpenAI/Codex model (Codex equivalent of Claude'sdisable-model-invocation: true).[features] codex_hooks = trueand theUserPromptSubmithook live in theconfig.tomlsnippetinit --target=codexalready writes (issue feat(core): stdio MCP server + CLI subcommands #4); the inline[[bible:John 3:16]]marker is recognized bylookup-from-prompt.Mode B
adapters/codex/wrapper/cdx(POSIX bash) andadapters/codex/wrapper/cdx.ps1(PowerShell) wrapcodex, capture its exit code, then runscripture-mcp recap --terminaland exit with the captured code. Recap fires on success and on non-zero exit.scripture-mcp init --target=codex --recap=onnow prints the alias-setup instructions for the wrapper. (We do not auto-edit the user's shell rc files.)codexdirectly bypasses the recap. This is a deliberate physical-isolation trade-off — it guarantees the recap text can never enter a future Codexmodel_callinput.Codex skill path
README explicitly notes the official-docs / OSS-repo disagreement on
~/.codex/skillsvs$CODEX_HOME/skillsvs~/.agents/skills. We use~/.codex/skillsto match the same~/.codex/config.tomllocationinitwrites to.Tests
adapters/adapters_test.go: structural assertions on the skill, theagents/openai.yamlpin, and both wrappers (capture exit → recap → exit with captured code).internal/cli/init_test.go:--target=codex --recap=onprints the cdx alias hint;--recap=offdoes not.Test plan
go build ./...go test ./...go vet ./...cdx --help→ recap fires aftercodex --helpexits (requires a realcodexinstall; not exercised in CI)Generated by Claude Code