Skip to content

feat(codex-fleet): token-discipline worker + plan-meta + tiered panes#17

Merged
NagyVikt merged 2 commits into
mainfrom
agent/codex-fleet-token-discipline-tiered-2026-05-14
May 14, 2026
Merged

feat(codex-fleet): token-discipline worker + plan-meta + tiered panes#17
NagyVikt merged 2 commits into
mainfrom
agent/codex-fleet-token-discipline-tiered-2026-05-14

Conversation

@NagyVikt
Copy link
Copy Markdown
Contributor

Summary

  • Sandbox: --add-dir flags now built from plan.json's metadata.writable_roots (new schema at scripts/codex-fleet/lib/plan-meta.md), with hard fallback to recodee+codex-fleet. Bringup pre-validates each root exists + is writable. Fixes the wedge where panes spun on outside writable roots because the active plan targeted a sibling repo the sandbox couldn't see.
  • Tiered panes + specialty routing: accounts.yml gains tier (low/medium/high) + specialty fields. full-bringup.sh looks them up by email and passes CODEX_FLEET_TIER, CODEX_FLEET_SPECIALTY, FLEET_REASONING_EFFORT into the pane env + the fleet-config.toml.tmpl substitution. Worker prompt enforces a tier+specialty gate before claiming work.
  • Worker prompt rewrite: tighter token-discipline section (no narration, no rescue calls — supervisor owns that), preflight gates for unreachable paths, pending-merge handoff replacing blocking --wait-for-merge.
  • Token meter: new scripts/codex-fleet/token-meter.sh — per-pane 5h% / wk% / ctx% table, --watch / --json / --no-color flags. Flags low headroom in red.
  • Caching: cap-probe + plan-publish caches with 5-min TTL; --no-cap-cache to force fresh.
  • Design doc: openspec/plans/codex-fleet-orchestration-v2-2026-05-14/design.md — concrete proposals for event-driven worker pulls, consolidated Rust orchestrator, send-keys-free dispatch. Deferred from this PR because they need Colony-side work or a larger Rust port.

Test plan

  • bash -n clean on full-bringup.sh, up.sh, token-meter.sh, lib/mcp-preflight.sh
  • bash scripts/codex-fleet/full-bringup.sh --no-attach --n 8 brings up an 8-pane fleet; each pane's spawn command shows CODEX_FLEET_TIER + CODEX_FLEET_SPECIALTY + --add-dir flags
  • Cap-probe cache hit logged on second bringup within 5 min (cap-probe cache hit (age=Ns))
  • Plan-publish cache hit logged on second bringup within 5 min (plan publish: cache hit, skipping)
  • bash scripts/codex-fleet/token-meter.sh --no-color renders against live fleet
  • python3 -m json.tool < <(bash scripts/codex-fleet/token-meter.sh --json) validates
  • End-to-end: pane with tier=low only claims difficulty=trivial subtasks (needs an actively running plan with mixed-difficulty subtasks to observe)

🤖 Generated with Claude Code

NagyVikt and others added 2 commits May 14, 2026 19:30
- sandbox: --add-dir built from plan metadata.writable_roots
  (schema: scripts/codex-fleet/lib/plan-meta.md)
- bringup: writable-root preflight; cap-probe + plan-publish 5-min caches
- accounts: tier (low/medium/high) + specialty fields, looked up by email
- spawn: CODEX_FLEET_TIER, CODEX_FLEET_SPECIALTY, FLEET_REASONING_EFFORT
  wired through to fleet_render_config and the worker pane env
- worker-prompt: token-discipline rewrite, preflight gates (writable-root
  + stale-dep), tier+specialty gate, pending-merge handoff in place of
  blocking --wait-for-merge
- token-meter: standalone per-pane 5h%/wk%/ctx% spend-watch script
- design doc: openspec plan for event-driven pulls, consolidated Rust
  orchestrator, send-keys-free dispatch (deferred from this PR)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
# Conflicts:
#	openspec/plans/codex-fleet-overlays-phase5-2026-05-14/plan.json
#	scripts/codex-fleet/full-bringup.sh
#	scripts/codex-fleet/up.sh
@NagyVikt NagyVikt merged commit 9a40d1d into main May 14, 2026
@NagyVikt NagyVikt deleted the agent/codex-fleet-token-discipline-tiered-2026-05-14 branch May 14, 2026 17:35
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.

1 participant