Commit 164a6be
feat: agent-agnostic codex support + bats test framework (#52)
## Summary
- **Agent abstraction layer**: Crabcode now natively supports codex
alongside claude. Projects configure `agent: codex` (or `agent: claude`,
the default) in their YAML config
- **~180 LOC helper functions** centralize all agent-specific CLI
differences (command building, session resume, system prompts,
non-interactive mode)
- **All callsites updated**: workspace open/continue, WIP
save/restore/list, session start/resume, review, handoff — all use the
new helpers
- **Bats-core test framework** vendored as git submodules with 36 unit
tests for the agent layer
- **CI workflow** runs unit tests + shellcheck on every PR
## Agent CLI mapping
| Operation | Claude | Codex |
|---|---|---|
| Base command | `claude --dangerously-skip-permissions` | `codex
--full-auto` |
| Continue session | `--continue` | `codex resume --last` |
| Resume specific | `--resume <id>` | `codex resume <id>` |
| Non-interactive | `claude --print` | `codex exec` |
| System prompt | `.claude/CLAUDE.md` | `AGENTS.md` |
## Out of scope
- Court review (hardcoded Claude judge + Codex reviewer B) — separate PR
## Test plan
- [x] 36 bats unit tests pass locally (`make test-unit`)
- [x] Bash syntax check passes (`bash -n src/crabcode`)
- [ ] CI runs on this PR (first run — watch it)
- [x] Backward compat: existing projects without `agent:` field default
to claude
- [x] Source guard enables testing without executing main
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 9a3421e commit 164a6be
8 files changed
Lines changed: 900 additions & 125 deletions
File tree
- .github/workflows
- src
- tests
- test_helper
- unit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
15 | 23 | | |
16 | 24 | | |
17 | 25 | | |
| |||
0 commit comments