herdr-orchestra 6.7.2 → 6.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,26 @@
2
2
 
3
3
  All notable changes. Versions follow [semantic versioning](https://semver.org).
4
4
 
5
+ ## [6.8.0] - 2026-11-24
6
+
7
+ An all-Codex team (Codex as the lead, the coders and the reviewer) now runs without getting stuck and without an approval check on every orch command.
8
+
9
+ Example: before, a Codex lead typing `orch start` got "cannot create branch" (Codex's sandbox makes `.git` read-only), and `orch team up` or waking the lead failed (the sandbox blocks herdr's socket). Codex then asked its auto-review before running each one again. Now every Codex pane orch opens starts with two settings that open just those two things, so the commands work the first time.
10
+
11
+ ### Fixed
12
+ - **Codex panes can reach herdr and the repo's `.git`.** The Codex launch command is now `codex --approve-for-me -c sandbox_workspace_write.network_access=true -c 'sandbox_workspace_write.writable_roots=["<repo>/.git"]'`. The first setting lets herdr's socket through (it also allows the internet); the second lets git make branches, worktrees and commits. Checked with the real codex-cli 0.172 (`codex sandbox`): without them git and the socket are refused, with them both work. `orch team up`, the "start it yourself" hints after a restart and `orch agents launch codex` all use it; a launch command may say `{git_dir}` and orch fills in the repo's `.git` folder.
13
+ - **A blocked lead is told how to fix it.** `orch lead plan`, `orch lead run` and `orch lead check` warn when the pane they run in can't reach herdr (Codex's sandbox with the network off) or can't write `.git`, and print the Codex command to restart with.
14
+ - **The Codex models were out of date.** orch knew only `gpt-6-luna` and `gpt-6-sol`, which Codex now calls legacy, and had no high Codex model, so every Codex plan warned.
15
+
16
+ ### Added
17
+ - **Thinking levels in a model id.** `gpt-6.2-sol@low` means gpt-6.2-sol on low thinking (`-c model_reasoning_effort=low`). New registry key `effort_flag`. The Codex levels: small = `gpt-6-luna@high`, medium = `gpt-6.2-sol@low`, high = `gpt-6.2-sol@medium` (the lead and the reviewer). Astra stays blocked.
18
+ - **orch asks Codex for its models.** When `codex` is installed, `orch models` runs `codex debug models` (at most every 6 hours, cached; `ORCH_MODELS_TTL_S`, `ORCH_MODELS_DISCOVER=0` turns it off) and puts the newest Luna and Sol into the levels above, skipping models Codex hides or calls legacy. When Codex adds a new Sol, the next plan uses it without anyone editing a file. The family and thinking level of each tier are in `[discover.codex]` in `models.default.toml`, and your own `models.toml` can change them. If Codex can't be asked, the shipped entries are used.
19
+ - `orch team <kind>` prints the command to start your own lead pane on the strongest level.
20
+ - `orch doctor` says when your own launch command drops a part orch needs (new registry key `launch_needs`).
21
+
22
+ ### Not yet tried
23
+ - A full run with real Codex windows. The sandbox settings and model names were checked against the real Codex 0.172; the run itself was tested with simulated agents.
24
+
5
25
  ## [6.7.2] - 2026-11-23
6
26
 
7
27
  The website docs now have a Pi page: [Pi: setup and use](https://herdr-orchestra.vercel.app/docs/pi/). It walks through every step in order: install Pi, add the package (`pi install git:github.com/arunnarangali/herdr-orchestra`), type `/orch-setup` once, check with `orch version`, pick `panes` or `subagent` with `/orch-mode`, then `/skill:orch-plan <feature>` and say go. It also shows the config file for the subagents' models and `max_turns`, a table of the Pi commands, and what to do when something is off. No change to how orch works.
package/README.md CHANGED
@@ -137,12 +137,14 @@ Version choice, first match wins: `--version` flag › `ORCH_VERSION` env › `.
137
137
  ```
138
138
  you (1 Codex pane) ──► $orch-plan add a login page
139
139
  lead: only me here → orch team codex
140
- Workers: codex-1 (codex: gpt-6-luna), codex-2 (codex: gpt-6-sol)
141
- Reviewer: reviewer (codex: gpt-6-sol)
140
+ Workers: codex-1 (codex: gpt-6-luna@high), codex-2 (codex: gpt-6.2-sol@medium)
141
+ Reviewer: reviewer (codex: gpt-6.2-sol@medium)
142
142
  you ──► go
143
143
  orch start → orch team up → 3 more Codex panes open → the run as usual
144
144
  ```
145
145
 
146
+ **An all-Codex team.** Codex runs every command in its sandbox, which blocks two things orch needs: talking to herdr, and writing the repo's `.git` (branches, worktrees). So orch starts every Codex pane with two settings that open just those (`-c sandbox_workspace_write.network_access=true`, which also allows the internet, and the repo's `.git` as a writable folder). Start your own Codex lead the same way: `orch agents launch codex --role lead --model gpt-6.2-sol@medium` prints the command; `orch lead plan` warns when the pane you run it in is still blocked. A Codex model id can end in a thinking level: `gpt-6.2-sol@low` is Sol on low thinking. The Codex levels are small = `gpt-6-luna@high`, medium = `gpt-6.2-sol@low`, high = `gpt-6.2-sol@medium` (Astra stays blocked), and `orch models` asks Codex itself (`codex debug models`) for its current models, so a newer Sol or Luna is used without anyone editing a file.
147
+
146
148
  2. **Orchestration plan:** start the plan playbook in the lead's pane (see [Choose your lead](#choose-your-lead)). The lead researches, writes `.orchestrate/plan.md` and shows you the milestones, which coder and model each one goes to, and why. Edit the plan if you like: dependencies, tier, review yes/no, your answers to open questions.
147
149
  3. **Orchestration run:** tell the lead **go** (`/orch-run`). It dispatches the milestones (`orch dispatch M1 M2`), which starts the event manager, and pauses. From here the run looks after itself:
148
150
  - a milestone finishes → the event manager checks and merges it, then wakes the lead, which dispatches what that unlocked;
@@ -164,9 +166,9 @@ The lead does not pick a model by its name. It reads the catalog (`orch models`)
164
166
 
165
167
  | Tier | For | Examples from the default catalog |
166
168
  |---|---|---|
167
- | **small** | classification, renames, docs, config, mechanical edits | `haiku`, `gpt-6-luna`, `qwen3.6-35b-a3b` |
168
- | **medium** | normal implementation, tests, debugging inside one module | `sonnet`, `gpt-6-sol`, `qwen3.8-27b` |
169
- | **high** | the lead itself, contracts and architecture, cross-module refactors, auth / payments / schema, escalations | `opus`, `deepseek-v4-pro`, `glm-5.3` |
169
+ | **small** | classification, renames, docs, config, mechanical edits | `haiku`, `gpt-6-luna@high`, `qwen3.6-35b-a3b` |
170
+ | **medium** | normal implementation, tests, debugging inside one module | `sonnet`, `gpt-6.2-sol@low`, `qwen3.8-27b` |
171
+ | **high** | the lead itself, contracts and architecture, cross-module refactors, auth / payments / schema, escalations | `opus`, `gpt-6.2-sol@medium`, `deepseek-v4-pro`, `glm-5.3` |
170
172
 
171
173
  In the plan, each coder carries the model its pane runs, and each milestone says what it needs:
172
174
 
package/VERSION CHANGED
@@ -1 +1 @@
1
- 6.7.2
1
+ 6.8.0
@@ -8,6 +8,10 @@
8
8
  # `orch agents launch <kind> --role reviewer` prints it. Left out: the reviewer starts like a coder
9
9
  # model_flag the launch option that picks the model (`orch agents launch <kind> --model <id>`); leave it
10
10
  # out when the tool has none or it is unverified, and choose the model inside the tool
11
+ # effort_flag the launch option that sets how hard the model thinks, with {effort} where the level goes. A model
12
+ # id written `<model>@<level>` (e.g. gpt-6.2-sol@low) starts on <model> with this option
13
+ # launch_needs parts the launch command must keep for orch to work in that tool; `orch doctor` says when your
14
+ # own launch drops one. In `launch`, {git_dir} is the repo's .git folder (filled in by orch)
11
15
  # herdr_detect herdr can tell idle / working / blocked for it (false: orch relies on the done file only)
12
16
  # interrupt_keys the keys that stop its current step, as `herdr agent send-keys` names them (default ["esc"]).
13
17
  # orch presses them when a milestone is paused or moved while the coder still works, before the
@@ -49,8 +53,14 @@ notes = "Claude Code 2.1: --permission-mode acceptEdits in --help; ~/.claude/ski
49
53
 
50
54
  [codex]
51
55
  binary = "codex"
52
- launch = "codex --approve-for-me"
56
+ # Codex runs every command in its sandbox, which blocks two things orch needs: talking to herdr (a local socket,
57
+ # blocked with the network) and writing the repo's .git (branches, worktrees, commits). These two settings open
58
+ # exactly that, so `orch start`, `orch team up` and every herdr call work the first time instead of each one
59
+ # waiting for an approval review.
60
+ launch = "codex --approve-for-me -c sandbox_workspace_write.network_access=true -c 'sandbox_workspace_write.writable_roots=[\"{git_dir}\"]'"
61
+ launch_needs = ["sandbox_workspace_write.network_access=true", "sandbox_workspace_write.writable_roots"]
53
62
  model_flag = "--model"
63
+ effort_flag = "-c model_reasoning_effort={effort}"
54
64
  herdr_detect = true
55
65
  interrupt_keys = ["esc"]
56
66
  roles = ["lead", "coder", "reviewer"]
@@ -58,7 +68,7 @@ skills_dirs = ["~/.agents/skills", "~/.codex/skills"]
58
68
  skills_reads = ["~/.agents/skills", "~/.codex/skills"]
59
69
  invoke = "$orch-plan <feature> (or: use the orch-plan skill: <feature>)"
60
70
  verified = true
61
- notes = "codex-cli 0.167: --full-auto is gone; --approve-for-me routes approvals to automatic review in the workspace-write sandbox. Reads ~/.codex/skills and ~/.agents/skills (its docs name ~/.agents/skills as the user folder, and say two skills with the same name both show up, so orch keeps one copy)."
71
+ notes = "codex-cli 0.167: --full-auto is gone; --approve-for-me routes approvals to automatic review in the workspace-write sandbox. Reads ~/.codex/skills and ~/.agents/skills (its docs name ~/.agents/skills as the user folder, and say two skills with the same name both show up, so orch keeps one copy). codex-cli 0.172 (checked with `codex sandbox`): in workspace-write, .git is read-only and connecting to a local socket is refused; sandbox_workspace_write.network_access=true lets the herdr socket through (it also allows the internet) and writable_roots with the repo's .git lets git work. Thinking level: -c model_reasoning_effort=low|medium|high|xhigh|max. `codex debug models` lists the models this Codex has (see [discover.codex] in models.default.toml)."
62
72
 
63
73
  [amp]
64
74
  binary = "amp"
Binary file
package/bin/orch CHANGED
@@ -756,31 +756,140 @@ def user_models_file():
756
756
  return Path(os.environ.get("ORCH_MODELS_FILE") or Path.home() / ".config/herdr-orchestra/models.toml")
757
757
 
758
758
 
759
+ _CATALOG = {}
760
+
761
+
759
762
  def models_catalog(required=False):
760
- """models.default.toml merged with the user's models.toml (key by key per model; policy and tiers per key).
761
- None when tomllib is missing and the catalog isn't required: plans then run without tiers, as before 4.7."""
763
+ """models.default.toml, then the models each installed tool reports itself ([discover.<kind>]), then the user's
764
+ models.toml, merged key by key per model (policy, tiers and discover per key). None when tomllib is missing and
765
+ the catalog isn't required: plans then run without tiers, as before 4.7."""
762
766
  try:
763
767
  import tomllib
764
768
  except ImportError:
765
769
  if required:
766
770
  die(f"the model catalog needs Python >= 3.11 (tomllib); this is Python {sys.version.split()[0]}")
767
771
  return None
768
- cat = {"policy": {}, "tiers": {}, "models": {}}
772
+ if "cat" in _CATALOG:
773
+ return _CATALOG["cat"]
774
+ cat = {"policy": {}, "tiers": {}, "models": {}, "discover": {}, "found": {}}
769
775
  try:
770
- for src in (asset("models.default.toml"), user_models_file()):
771
- if not src or not src.exists():
772
- continue
773
- data = tomllib.loads(src.read_text())
774
- for sec in ("policy", "tiers"):
775
- cat[sec].update(data.get(sec) or {})
776
- for mid, vals in (data.get("models") or {}).items():
777
- if isinstance(vals, dict):
778
- cat["models"].setdefault(mid.lower(), {}).update(vals)
776
+ datas = [(tomllib.loads(src.read_text()), user) for src, user in
777
+ ((asset("models.default.toml"), False), (user_models_file(), True)) if src and src.exists()]
779
778
  except tomllib.TOMLDecodeError as e:
780
779
  die(f"model catalog: {e}")
780
+ for data, _ in datas:
781
+ for sec in ("policy", "tiers"):
782
+ cat[sec].update(data.get(sec) or {})
783
+ for kind, d in (data.get("discover") or {}).items():
784
+ if isinstance(d, dict):
785
+ cat["discover"].setdefault(kind, {}).update(d)
786
+ for phase in (False, True): # the shipped models, then what the tools report, then the user's own
787
+ if phase:
788
+ discover_models(cat)
789
+ for data, user in datas:
790
+ if user == phase:
791
+ for mid, vals in (data.get("models") or {}).items():
792
+ if isinstance(vals, dict):
793
+ cat["models"].setdefault(mid.lower(), {}).update(vals)
794
+ _CATALOG["cat"] = cat
781
795
  return cat
782
796
 
783
797
 
798
+ # ---------------------------------------------------------------- model discovery: ask the tool for its models
799
+ DISCOVER_TTL_S = float(os.environ.get("ORCH_MODELS_TTL_S", str(6 * 3600)))
800
+ LEGACY_RE = re.compile(r"(?i)\blegacy\b|previous generation|deprecated")
801
+
802
+
803
+ def split_effort(mid):
804
+ """`gpt-6.2-sol@low` -> ("gpt-6.2-sol", "low"); an id without a thinking level -> (id, None)."""
805
+ if mid and "@" in mid:
806
+ base, eff = mid.rsplit("@", 1)
807
+ if base and re.fullmatch(r"[A-Za-z]+", eff):
808
+ return base, eff.lower()
809
+ return mid, None
810
+
811
+
812
+ def _tool_models(kind, cmd):
813
+ """The models `cmd` lists ([{slug, description, visibility, upgrade, priority}]), or None. The answer is kept
814
+ for DISCOVER_TTL_S in the share folder; an older answer is used when the command fails now."""
815
+ cache = share_dir() / f"models-{kind}.json"
816
+ try:
817
+ old = json.loads(cache.read_text())
818
+ except (OSError, ValueError):
819
+ old = None
820
+ if isinstance(old, dict) and old.get("cmd") == cmd and time.time() - old.get("ts", 0) < DISCOVER_TTL_S:
821
+ return old.get("models")
822
+ models = None
823
+ try:
824
+ r = subprocess.run(shlex.split(cmd), text=True, capture_output=True, timeout=20, stdin=subprocess.DEVNULL)
825
+ out = r.stdout
826
+ data = json.loads(out[out.index("{"):]) if r.returncode == 0 and "{" in out else None
827
+ rows = data.get("models") if isinstance(data, dict) else data
828
+ if isinstance(rows, list):
829
+ models = [{k: m.get(k) for k in ("slug", "description", "visibility", "upgrade", "priority")}
830
+ for m in rows if isinstance(m, dict) and isinstance(m.get("slug"), str)]
831
+ except (OSError, ValueError, subprocess.TimeoutExpired):
832
+ models = None
833
+ if not models:
834
+ return old.get("models") if isinstance(old, dict) and old.get("cmd") == cmd else None
835
+ with contextlib.suppress(OSError):
836
+ cache.parent.mkdir(parents=True, exist_ok=True)
837
+ cache.write_text(json.dumps({"ts": time.time(), "cmd": cmd, "models": models}))
838
+ return models
839
+
840
+
841
+ def newest_of(models, family):
842
+ """The tool's preferred current model of a family (a word in its id): not hidden, not legacy, lowest priority."""
843
+ cands = [m for m in models if family.lower() in re.split(r"[-_.@/]", m["slug"].lower())
844
+ and m.get("visibility") != "hide" and not m.get("upgrade")
845
+ and not LEGACY_RE.search(m.get("description") or "")]
846
+ prio = lambda m: m["priority"] if isinstance(m.get("priority"), (int, float)) else 1e9
847
+ return min(cands, key=lambda m: (prio(m), m["slug"]), default=None)
848
+
849
+
850
+ def discover_models(cat):
851
+ """For each [discover.<kind>] whose tool is installed: ask it for its models and put the newest model of each
852
+ family into the levels it names (small / medium / high, each a family and a thinking level). The shipped
853
+ entries of that kind are the fallback: they are replaced only when the tool answered."""
854
+ if os.environ.get("ORCH_MODELS_DISCOVER", "1").lower() in ("0", "off", "false", "no"):
855
+ return
856
+ for kind, cfg in cat["discover"].items():
857
+ cmd = cfg.get("cmd")
858
+ try:
859
+ exe = shlex.split(cmd)[0] if cmd else None
860
+ except ValueError:
861
+ exe = None
862
+ if not exe or not shutil.which(exe):
863
+ continue
864
+ models = _tool_models(kind, cmd)
865
+ if not models:
866
+ continue
867
+ shipped = {mid: m for mid, m in cat["models"].items() if m.get("kinds") == [kind]}
868
+ made, used = {}, set()
869
+ for level in TIERS:
870
+ want = cfg.get(level)
871
+ if not isinstance(want, dict) or not want.get("family"):
872
+ continue
873
+ m = newest_of(models, want["family"])
874
+ if not m:
875
+ continue
876
+ mid = m["slug"].lower() + (f"@{want['effort']}" if want.get("effort") else "")
877
+ like = next((x for x in shipped.values() if str(x.get("tier", "")).lower() == level), None) or {}
878
+ made[mid] = dict(like, kinds=[kind], tier=level, found=True, evidence=(
879
+ f"found by `{cmd}`: \"{(m.get('description') or '').strip()}\". {level} level = the newest "
880
+ f"{want['family']} model" + (f" on {want['effort']} thinking" if want.get("effort") else "")
881
+ + f" ([discover.{kind}]). Ratings copied from the shipped {level} entry; not benchmarked here."))
882
+ used.add(m["slug"])
883
+ if not made:
884
+ continue
885
+ for mid in shipped:
886
+ cat["models"].pop(mid, None)
887
+ cat["models"].update(made)
888
+ cat["found"][kind] = {"cmd": cmd, "used": sorted(used),
889
+ "skipped": sorted(x["slug"] for x in models if x["slug"] not in used
890
+ and (x.get("upgrade") or LEGACY_RE.search(x.get("description") or "")))}
891
+
892
+
784
893
  def model_denied(cat, mid):
785
894
  """The policy pattern that forbids this model, or None."""
786
895
  if not cat or not mid:
@@ -851,15 +960,19 @@ def cmd_models(args):
851
960
  return
852
961
  if sub:
853
962
  die("usage: orch models [check <id> | show <id>]")
854
- print(f"{'model':<18} {'tier':<7} {'kinds':<17} {'reas':>4} {'code':>4} {'arch':>4} {'inst':>4} {'tool':>4} "
963
+ print(f"{'model':<20} {'tier':<7} {'kinds':<17} {'reas':>4} {'code':>4} {'arch':>4} {'inst':>4} {'tool':>4} "
855
964
  f"{'plan':>4} {'speed':>5} {'ctx k':>6} open")
856
965
  for tier in reversed(TIERS):
857
966
  for mid, m in cat["models"].items():
858
967
  if model_tier(cat, mid) != tier or model_denied(cat, mid):
859
968
  continue
860
- print(f"{mid:<18} {tier:<7} {','.join(m.get('kinds', [])):<17} "
969
+ print(f"{mid:<20} {tier:<7} {','.join(m.get('kinds', [])):<17} "
861
970
  + " ".join(f"{m.get(k, '-'):>4}" for k in RATINGS[:-1])
862
971
  + f" {m.get('speed', '-'):>5} {m.get('context_k') or '-':>6} {'yes' if m.get('open_weights') else 'no'}")
972
+ for kind, f in cat.get("found", {}).items():
973
+ print(f"\n{kind} models found by `{f['cmd']}`: {', '.join(f['used'])}"
974
+ + (f" (not used, the tool calls them legacy: {', '.join(f['skipped'])})" if f["skipped"] else ""))
975
+ print(f" an id ending in @<level> (e.g. @low) is that model on that thinking level")
863
976
  print("\nTiers (a model needs this reasoning rating to serve the tier):")
864
977
  for tier in TIERS:
865
978
  tv = cat["tiers"].get(tier) or {}
@@ -951,7 +1064,8 @@ def has_open_questions(t):
951
1064
  return bool(vals) and vals != ["none"]
952
1065
 
953
1066
 
954
- AGENT_RE = re.compile(r"([\w.-]+)\s*\(\s*([\w.-]+)(?:\s*:\s*([^\s@)]+))?(?:\s+@pane:([^\s)]+))?\s*\)")
1067
+ # a model may carry a thinking level after @ (`codex: gpt-6.2-sol@low`); a pane id follows a space (` @pane:w1:p3`)
1068
+ AGENT_RE = re.compile(r"([\w.-]+)\s*\(\s*([\w.-]+)(?:\s*:\s*([^\s)]+?))?(?:\s+@pane:([^\s)]+))?\s*\)")
955
1069
 
956
1070
 
957
1071
  def parse_agents(s):
@@ -6134,11 +6248,42 @@ def cmd_report(args):
6134
6248
  print(f" rule broken {n}x: {r}")
6135
6249
 
6136
6250
 
6137
- def launch_cmd(kind, v, model=None, strict=True, role=None):
6251
+ def git_common_dir(cwd=None):
6252
+ """The absolute .git folder of the repo `cwd` is in (a worktree's main repo .git), or None outside a repo."""
6253
+ try:
6254
+ r = subprocess.run(["git", "rev-parse", "--path-format=absolute", "--git-common-dir"], text=True,
6255
+ capture_output=True, timeout=10, cwd=str(cwd or ROOT or Path.cwd()))
6256
+ except (OSError, subprocess.TimeoutExpired):
6257
+ return None
6258
+ return r.stdout.strip() if r.returncode == 0 and r.stdout.strip() else None
6259
+
6260
+
6261
+ def fill_launch(cmd, cwd=None):
6262
+ """Put the repo's .git folder where a launch command says {git_dir}. Outside a repo the option that needs it is
6263
+ left out (with the `-c` before it), so the command still starts."""
6264
+ if "{git_dir}" not in cmd:
6265
+ return cmd
6266
+ gd = git_common_dir(cwd)
6267
+ out = []
6268
+ for tok in shlex.split(cmd):
6269
+ if "{git_dir}" in tok:
6270
+ if gd:
6271
+ out.append(tok.replace("{git_dir}", gd))
6272
+ elif out and out[-1] in ("-c", "--config"):
6273
+ out.pop()
6274
+ continue
6275
+ out.append(tok)
6276
+ return shlex.join(out)
6277
+
6278
+
6279
+ def launch_cmd(kind, v, model=None, strict=True, role=None, cwd=None):
6138
6280
  """The shell command that starts agent `kind` in a pane, on `model` when given. With strict=False a kind
6139
6281
  without a model_flag starts on its default model instead of failing (the caller says so). role="reviewer"
6140
- uses the kind's `review_launch` when it has one: the same tool with its code-editing tools turned off."""
6141
- cmd = (v.get("review_launch") if role == "reviewer" else None) or v.get("launch") or v.get("binary", kind)
6282
+ uses the kind's `review_launch` when it has one: the same tool with its code-editing tools turned off.
6283
+ A model `<id>@<level>` on a kind with an `effort_flag` starts <id> with that thinking level. `cwd` is the
6284
+ folder the agent will run in ({git_dir} is filled in from it)."""
6285
+ cmd = fill_launch((v.get("review_launch") if role == "reviewer" else None) or v.get("launch")
6286
+ or v.get("binary", kind), cwd)
6142
6287
  if model:
6143
6288
  cat = models_catalog()
6144
6289
  why = model_denied(cat, model)
@@ -6152,7 +6297,10 @@ def launch_cmd(kind, v, model=None, strict=True, role=None):
6152
6297
  kinds = ((cat or {}).get("models", {}).get(model.lower()) or {}).get("kinds")
6153
6298
  if kinds and kind not in kinds:
6154
6299
  print(f"WARN: the catalog lists {model} for {', '.join(kinds)}, not {kind}", file=sys.stderr)
6155
- cmd += f" {v['model_flag']} {shlex.quote(model)}"
6300
+ base, effort = split_effort(model) if v.get("effort_flag") else (model, None)
6301
+ cmd += f" {v['model_flag']} {shlex.quote(base)}"
6302
+ if effort:
6303
+ cmd += " " + v["effort_flag"].replace("{effort}", shlex.quote(effort))
6156
6304
  return cmd
6157
6305
 
6158
6306
 
@@ -6238,6 +6386,9 @@ def cmd_team(args):
6238
6386
  if top and tier.get(top) != "high":
6239
6387
  print(f"\nNOTE: the strongest allowed {kind} model is {top} ({tier.get(top)} tier): high-tier milestones go to "
6240
6388
  f"it, and `orch sync` will say so")
6389
+ if top and v.get("model_flag") and "lead" in roles:
6390
+ print(f"\nYour own lead pane on the strongest level (start it like this, then write `Lead: lead ({kind}: {top})`):"
6391
+ f"\n {launch_cmd(kind, v, top, strict=False)}")
6241
6392
  print(f"\nCheck these are models your {kind} really reaches (`--models a,b` to choose others).")
6242
6393
  print("\nThese panes don't exist yet. After `orch sync` and `orch start`, `orch team up` opens each one in its "
6243
6394
  "own folder, on its model, and names it.")
@@ -6305,7 +6456,7 @@ def team_up(args):
6305
6456
  print(f"SKIP {name}: kind {kind!r} is not in the agent registry — start it yourself in {d}")
6306
6457
  failed += 1
6307
6458
  continue
6308
- cmd = launch_cmd(kind, v, model, strict=False, role="reviewer" if name == st.get("reviewer") else None)
6459
+ cmd = launch_cmd(kind, v, model, strict=False, role="reviewer" if name == st.get("reviewer") else None, cwd=d)
6309
6460
  split = [HERDR, "pane", "split"] + ([last] if last else []) + \
6310
6461
  ["--direction", "down" if last else "right", "--cwd", d, "--no-focus"]
6311
6462
  if dry:
@@ -6478,7 +6629,7 @@ def rename_lost(st, hints=True, keep_out=()):
6478
6629
  still[n] = pick if own else None
6479
6630
  v = reg.get(w.get("kind"))
6480
6631
  cmd = (launch_cmd(w.get("kind"), v, w.get("model"), strict=False,
6481
- role="reviewer" if n == st.get("reviewer") else None)
6632
+ role="reviewer" if n == st.get("reviewer") else None, cwd=d)
6482
6633
  if v else (w.get("kind") or "<its agent>"))
6483
6634
  say(f"LOST {n}: pane {pick} is in its folder ({short(d)}), but herdr sees no agent running in it. "
6484
6635
  + (f"`orch team up` starts it there; or start it yourself (`{cmd}`)" if own else
@@ -6693,8 +6844,34 @@ While `orch autopilot` runs it holds the driver lease: other commands that chang
6693
6844
  HERDR_PANE_ENV = ("HERDR_ENV", "HERDR_PANE_ID", "HERDR_SOCKET_PATH", "HERDR_BIN_PATH")
6694
6845
 
6695
6846
 
6847
+ def sandbox_warnings():
6848
+ """Lines warning that this agent's own sandbox blocks what the lead needs: herdr's socket (Codex sets
6849
+ CODEX_SANDBOX_NETWORK_DISABLED=1 when its sandbox has no network) or writing the repo's .git. [] when fine."""
6850
+ out, codex = [], any(k.startswith("CODEX_") for k in os.environ)
6851
+ if os.environ.get("CODEX_SANDBOX_NETWORK_DISABLED") == "1":
6852
+ out.append("WARN this pane runs in Codex's sandbox with the network off, so orch's herdr calls from here "
6853
+ "(team up, sending work, waking you) are refused or wait for an approval each time.")
6854
+ gd = git_common_dir(Path.cwd())
6855
+ if gd:
6856
+ try:
6857
+ fd, probe = tempfile.mkstemp(dir=gd, prefix=".orch-probe-")
6858
+ os.close(fd)
6859
+ os.unlink(probe)
6860
+ except OSError:
6861
+ out.append(f"WARN the repo's .git folder ({short(gd)}) can't be written from this pane, so `orch start` "
6862
+ f"(the branch and the coders' folders) fails here.")
6863
+ if out and codex:
6864
+ v = (registry(required=False) or {}).get("codex") or {}
6865
+ out.append(" Fix: quit this Codex and start it again with orch's command (it opens just those two):\n "
6866
+ + launch_cmd("codex", v, None, strict=False, cwd=Path.cwd()) + "\n (`orch agents launch codex "
6867
+ "--role lead --model <id>` adds a model; `orch models` lists them)")
6868
+ return out
6869
+
6870
+
6696
6871
  def lead_check():
6697
6872
  """Preflight: is this agent driving Herdr? HERDR_ENV=1 is the fast path; otherwise ask the herdr server."""
6873
+ for line in sandbox_warnings():
6874
+ print(line)
6698
6875
  if os.environ.get("HERDR_ENV") == "1":
6699
6876
  print(f"OK inside a Herdr pane (HERDR_ENV=1, pane {os.environ.get('HERDR_PANE_ID') or '?'})")
6700
6877
  return
@@ -6912,6 +7089,9 @@ def cmd_lead(args):
6912
7089
  pb = asset("playbooks/subagent.md") or die("playbooks/subagent.md not found next to orch or in the install")
6913
7090
  label = "run (subagent mode)"
6914
7091
  print(f"herdr-orchestra {installed_version()} — lead playbook: {label}\n")
7092
+ if not subagent:
7093
+ for line in sandbox_warnings():
7094
+ print(line)
6915
7095
  if not part and not subagent:
6916
7096
  lead_self_name()
6917
7097
  if subagent and sub == "plan":
@@ -7299,7 +7479,14 @@ def doctor_kind(kind, v, full=True):
7299
7479
  launch = shlex.split(v.get(key) or binary)
7300
7480
  except ValueError:
7301
7481
  launch = [binary]
7302
- flags += [f for f in (tok.split("=")[0] for tok in launch[1:] if tok.startswith("-")) if f not in flags]
7482
+ for f in (tok.split("=")[0] for tok in launch[1:] if tok.startswith("-")):
7483
+ if f not in flags: # one line per flag, even when a command repeats it (codex -c ... -c ...)
7484
+ flags.append(f)
7485
+ for key in ("launch", "review_launch"):
7486
+ for part in v.get("launch_needs") or [] if v.get(key) else []:
7487
+ if part not in v[key]:
7488
+ out.append((False, f"{key} has no `{part}`: without it orch's commands fail inside {kind} (its sandbox "
7489
+ f"blocks them) — keep it in your own launch in {short(user_agents_file())}"))
7303
7490
  for fl in flags:
7304
7491
  if code is None:
7305
7492
  out.append((False, f"launch flag {fl}: `{hcmd}` did not run ({help_.strip()[:80]})"))
@@ -75,7 +75,11 @@ open_weights = false
75
75
  evidence = "Claude Code alias for the current Opus (code.claude.com/docs/en/model-config, 2026-11). Ratings: maintainer estimate; not benchmarked here."
76
76
 
77
77
  # ---------------------------------------------------------------- Codex CLI (`codex --model <id>`)
78
- [models.gpt-6-luna]
78
+ # A Codex id may end in @<thinking level>: `gpt-6.2-sol@low` starts gpt-6.2-sol with
79
+ # `-c model_reasoning_effort=low`. The same model thinking harder is another entry with its own tier.
80
+ # These three are the fallback: when the codex command is installed, orch asks it for its current models
81
+ # ([discover.codex] below) and puts the newest of each family in these levels instead.
82
+ [models."gpt-6-luna@high"]
79
83
  kinds = ["codex"]
80
84
  tier = "small"
81
85
  reasoning = 2
@@ -85,23 +89,46 @@ instructions = 4
85
89
  tools = 4
86
90
  planning = 2
87
91
  speed = 5
88
- context_k = 0
92
+ context_k = 272
89
93
  open_weights = false
90
- evidence = "Lowest-cost tier in the Codex model picker per a third-party guide (codex.danielvaughan.com, 2026-09-25). Id and ratings unverified here: check `codex` on your machine."
94
+ evidence = "`codex debug models` (codex-cli 0.172, 2026-11): \"Fast and affordable model for easier tasks\", thinking levels low..max. Small level chosen by the maintainer (2026-11-24): Luna on high thinking. Ratings: maintainer estimate; not benchmarked here."
91
95
 
92
- [models.gpt-6-sol]
96
+ [models."gpt-6.2-sol@low"]
93
97
  kinds = ["codex"]
94
98
  tier = "medium"
95
- reasoning = 4
99
+ reasoning = 3
96
100
  coding = 4
97
101
  architecture = 3
98
102
  instructions = 4
99
103
  tools = 4
104
+ planning = 3
105
+ speed = 4
106
+ context_k = 500
107
+ open_weights = false
108
+ evidence = "`codex debug models` (codex-cli 0.172, 2026-11): \"Fast, go-to model for coding and everyday work\" (Codex's first model). Medium level chosen by the maintainer (2026-11-24): Sol on low thinking. Ratings: maintainer estimate; not benchmarked here."
109
+
110
+ [models."gpt-6.2-sol@medium"]
111
+ kinds = ["codex"]
112
+ tier = "high"
113
+ reasoning = 4
114
+ coding = 4
115
+ architecture = 4
116
+ instructions = 4
117
+ tools = 4
100
118
  planning = 4
101
119
  speed = 3
102
- context_k = 0
120
+ context_k = 500
103
121
  open_weights = false
104
- evidence = "Baseline tier for standard agentic work per a third-party guide (codex.danielvaughan.com, 2026-09-25). Id and ratings unverified here: check `codex` on your machine."
122
+ evidence = "`codex debug models` (codex-cli 0.172, 2026-11): \"Fast, go-to model for coding and everyday work\". High level chosen by the maintainer (2026-11-24): Sol on medium thinking, so a Codex team has a high level without Astra. Ratings: maintainer estimate; not benchmarked here."
123
+
124
+ [discover.codex]
125
+ # How orch finds Codex's current models: it runs `cmd` (at most every few hours, the answer is cached), skips
126
+ # models Codex hides or calls legacy / previous generation, and takes the newest model of each family (a word in
127
+ # its id). Each level is that model on a thinking level. If the command fails, the entries above are used.
128
+ cmd = "codex debug models"
129
+ small = { family = "luna", effort = "high" }
130
+ medium = { family = "sol", effort = "low" }
131
+ high = { family = "sol", effort = "medium" }
105
132
 
106
133
  # ---------------------------------------------------------------- open-weight models (optional)
107
134
  # These need somewhere to run: a local server (Ollama, LM Studio, vLLM) or a hosted provider. The id is what
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "herdr-orchestra",
3
- "version": "6.7.2",
3
+ "version": "6.8.0",
4
4
  "description": "Orchestrate AI coding agents (Claude Code, Codex, OpenCode, Amp, Pi) as one team: a lead plans, coders build, a reviewer checks, you get one PR. Runs in Herdr panes, or in one Pi window with subagents.",
5
5
  "license": "MIT",
6
6
  "bin": {
package/playbooks/plan.md CHANGED
@@ -113,7 +113,7 @@ Then the run is the same as any run (`orch lead run`): the coder builds it, the
113
113
  - You are never a coder or the reviewer in your own run. Another pane of the same kind as you is fine.
114
114
  - A pane herdr doesn't recognise as an agent (it isn't in `herdr agent list`) can still work: write it as `name (kind @pane:<pane id>)` in `Workers:`. `orch` then types prompts into that pane and relies only on its done file.
115
115
  - If it's unclear which pane should play which role, ask.
116
- - **Models.** Run `orch models`: the catalog of models with a tier (small / medium / high) and ratings for reasoning, coding, architecture, instruction following, tool use, planning, speed and context size, and the models policy keeps out of runs. Find out which model each pane runs (ask the developer if herdr or the pane doesn't show it) and write it in the plan as `name (kind: model)`. Use the models the installed agents already reach; nobody has to set up anything new. A pane on a model the policy denies cannot be used: ask the developer to restart it on another model (`orch agents launch <kind> --model <id>` prints the command). A model that is not in the catalog is allowed but has no tier; say so, and suggest adding it to `~/.config/herdr-orchestra/models.toml`.
116
+ - **Models.** Run `orch models`: the catalog of models with a tier (small / medium / high) and ratings for reasoning, coding, architecture, instruction following, tool use, planning, speed and context size, and the models policy keeps out of runs. Find out which model each pane runs (ask the developer if herdr or the pane doesn't show it) and write it in the plan as `name (kind: model)`. Write ids exactly as `orch models` lists them: a Codex id can end in a thinking level (`gpt-6.2-sol@low` is Sol on low thinking; Codex's high tier is `gpt-6.2-sol@medium`). Use the models the installed agents already reach; nobody has to set up anything new. A pane on a model the policy denies cannot be used: ask the developer to restart it on another model (`orch agents launch <kind> --model <id>` prints the command). A model that is not in the catalog is allowed but has no tier; say so, and suggest adding it to `~/.config/herdr-orchestra/models.toml`.
117
117
  - **The team should cover the work.** If the plan will have high-tier milestones and no coder runs a high-tier model, say so and propose the pane to start (kind, model, launch command). Don't ask for more panes than the milestones need. You, the lead, should run a high-tier model; the reviewer should be at least as strong as the work it reviews.
118
118
 
119
119
  ## 4. Milestones: as many as the feature needs, and no more
@@ -212,7 +212,7 @@ Scope: warn | strict
212
212
  Budget: <e.g. 3h — optional>
213
213
  Estimate: <how long the whole feature should take, e.g. 1h30m>
214
214
  Lead: lead (<your kind>: <your model>)
215
- Workers: claude-1 (claude: sonnet), claude-2 (claude: haiku), codex-1 (codex: gpt-6-sol)
215
+ Workers: claude-1 (claude: sonnet), claude-2 (claude: haiku), codex-1 (codex: gpt-6.2-sol@low)
216
216
  Reviewer: reviewer (claude: opus) | none
217
217
 
218
218
  ## Global instructions