Repository navigation
feat: support codex as a worker runner - #1
Merged
Merged
Conversation
…ghten + /ship-review Phase 1 of the kypp/pillbox roadmap: opt-in, agent-driven, fail-open shared memory for parallel workers. - Add `memory` config section (enabled, project); resolve_memory_env scopes KYPP_PROJECT/KYPP_REPO_ROOT/BACCHUS_MEMORY onto the worker process - Worker prompt: kypp briefing at start, recall before work, remember before release — all guarded on $BACCHUS_MEMORY and fail-open - Replace /simplify with /tighten (per-iteration) + /ship-review (final gate) in the worker review loop, CLAUDE.md, and eval rubric/scenarios - Fix two pre-existing clippy lints (collapsible_if, unnecessary_sort_by)
The worker engine was already runner-agnostic (worker.cmd run via sh -c), but codex couldn't follow the protocol: /bacchus-worker is a Claude slash command, and there was no way to feed the protocol to a CLI that takes a prompt string. Add first-class codex support via `codex exec`. - `worker.runner` config (claude|codex) selects the default worker.cmd; `cmd` still overrides. Derivation is gated on `runner` being explicitly set, so an unconfigured worker still errors rather than silently defaulting to claude. - `bacchus worker-prompt <AGENT_ID> [TASK_ID]` emits the worker protocol as plain text for `codex exec` (Claude resolves the slash command). - `bacchus init --runner <claude|codex>` writes the matching cmd; the Runner clap enum rejects invalid values at parse time. - Bundle tighten + ship-review under skills/ (the review loop depends on them; already present as Claude and Codex skills globally). Liveness stays bacchus-owned (heartbeat loop), not a Claude hook, so codex workers stay alive identically.
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.
What
Adds first-class codex support as a bacchus worker runner, alongside the existing Claude default.
The worker engine was already runner-agnostic (
worker.cmdis run viash -cwith env-var substitution), but codex couldn't actually follow the protocol:/bacchus-workeris a Claude slash command, and there was no way to feed the protocol to a CLI that takes a prompt string. This wires codex in viacodex exec(the headless analog ofclaude -p).Changes
worker.runnerconfig (claude|codex) selects the defaultworker.cmd; an explicitcmdstill overrides. Derivation is gated onrunnerbeing explicitly set, so an unconfigured worker still errors ("worker.cmd is not configured") rather than silently defaulting to claude.bacchus worker-prompt <AGENT_ID> [TASK_ID]emits the worker protocol as plain text forcodex exec(Claude resolves the slash command; codex takes a prompt string).bacchus init --runner <claude|codex>writes the matchingworker.cmd. TheRunnerclap enum rejects invalid values at parse time (error: invalid value 'x' … [possible values: claude, codex]).tighten+ship-reviewunderskills/— the review loop depends on them; already installed as Claude and Codex skills globally.Why it works
Liveness is bacchus-owned (the
session heartbeat-loopbackground process tied to the worker PID), not the ClaudePostToolUsehook — so codex workers stay alive identically. Transport iscodex exec(one-shot per task), notcodex app-server, matching bacchus's spawn-per-task / judge-by-PID model.Review notes
This branch was run through
/tightenand/ship-review:Runnerenum so--runneris a closed set (was a free string with a silent_ => claudefallback).runnerbeing set (above), preserving the original unconfigured-worker error. Covered by newresolve_worker_configtests.sh -cwith operator/system-controlled IDs (pre-existing pattern);--dangerously-bypass-approvals-and-sandboxmirrors the existingclaude --dangerously-skip-permissionsintended-autonomy posture.Testing
cargo test -- --test-threads=1), incl. codex config round-trip + the three new gating tests.cargo clippy -- -D warningsclean,cargo fmtapplied.Not covered (needs a human)
codex exec's flag/positional syntax (--dangerously-bypass-approvals-and-sandbox, prompt as positional) is an external contract this change can't test — verify against the installed Codex CLI on a real worker run before relying on codex workers in production.