Skip to content

feat: add Codex workers to the shift orchestrator - #713

Merged
Jammy2211 merged 2 commits into
mainfrom
feature/codex-orchestrator
Nov 22, 2026
Merged

Jammy2211 merged 2 commits into
mainfrom
feature/codex-orchestrator

Conversation

@Jammy2211

@Jammy2211 Jammy2211 commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A brief can explicitly select Codex execution workers while existing briefs retain Claude. The adapter preserves queue selection, Mind's single writer, proof/questions, recovery, shift expiry and merge gates. Independent pre-ship review and close-outs remain Opus; review-helper usage is included in the Codex worker's accounting.

Fixes #712. Companion schema PR: PyAutoLabs/PyAutoMind#599.

API Changes

Adds worker-backend: codex, required codex-model and optional codex-effort to shift briefs. Codex supports auto and dontAsk worker modes with workspace-write sandboxing. Existing Claude defaults are unchanged. Adds a read-only prerequisite check and explicitly invoked no-op smoke command. See full details below.

Test Plan

  • Brain full suite: 2,426 passed, 78 skipped on Python 3.12.
  • Mind companion suite: 1,056 passed.
  • 27 Codex adapter tests: real fake-CLI subprocess lifecycle, cancellation/descendants, prelaunch reservation, restart accounting, missing/corrupt state, PID identity, fast exit, usage and independent-review accounting, no-model default check.
  • Project discovery, skill line-count budget and tenant firewall checks.
  • Sphinx documentation build with warnings treated as errors. The initial CI navigation warning was fixed by adding the guide to the toctree.
  • Independent Codex implementation review: CLEAN after fixes. This is not a claim that a live Opus shift-adversary ran.
  • Published vitals --scope PyAutoBrain,PyAutoMind --json: GREEN; source generated 2026-11-22T18:27:36Z. The fresh local checkout has no Heart snapshot; published evidence was used explicitly.
  • Laptop no-op smoke and one named, no-merge development pilot. This cloud environment passes the Codex checks but lacks the Claude login required for Opus reviews. No model/shift/timer was launched.

Token-load aggregate check cannot assess missing workspace/Cortex/Memory instruction files in this partial checkout; the CI-required skill budget and discovery checks pass.

Full API Changes (for automation & release notes)

Added

  • Brief keys: worker-backend (default claude), codex-model (required for Codex), codex-effort (default medium).
  • Internal CodexSpawner, durable codex:<uuid> identities and Linux/WSL supervisor.
  • _codex_review.py --task ... --repo ...: synchronous fresh Opus pre-ship review with structured verdict and accounted usage.
  • bin/codex_orchestrator_check.py: read-only CLI/login check; --smoke --model ... explicitly runs one disposable no-op session.

Changed behaviour

  • Codex lease identity is persisted before process launch; attempt accounting is adopted idempotently after watcher failure. Ambiguous state holds rather than duplicating work.
  • Stop requests use the verified supervisor and clean its child process group.
  • Codex completed-turn usage excludes cache reads from the existing uncached-token budget and includes Opus review attempts. Missing usage retains the existing reservation.
  • Both CLI logins are required for Codex development shifts, including merge-cap: 0.

Migration and limits

No migration for existing briefs. Codex is opt-in and currently Linux/WSL only. Review hook trust with /hooks; no trust or approval/sandbox bypass is enabled. No OpenAI API fallback. See docs/codex_orchestrator.md for the local check and pilot.

Consequence: judge; merge mode: human /prm. Implementation plan approved in the initiating conversation. No merge or live-run authority is added.

Generated by the PyAutoLabs agent workflow.

@Jammy2211
Jammy2211 marked this pull request as ready for review November 22, 2026 20:07
@Jammy2211
Jammy2211 merged commit 237459f into main Nov 22, 2026
3 checks passed
@Jammy2211
Jammy2211 deleted the feature/codex-orchestrator branch November 22, 2026 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add Codex execution backend to shift orchestrator

1 participant