herdr-orchestra 6.28.0 → 6.30.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 +40 -0
- package/VERSION +1 -1
- package/bin/__pycache__/orchcpython-314.pyc +0 -0
- package/bin/orch +211 -10
- package/install.sh +2 -0
- package/package.json +1 -1
- package/playbooks/plan.md +3 -3
- package/view/herdr-plugin/board.sh +28 -5
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,46 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes. Versions follow [semantic versioning](https://semver.org).
|
|
4
4
|
|
|
5
|
+
## [6.30.0] - 2026-11-27
|
|
6
|
+
|
|
7
|
+
The board key (`prefix+a`) now always runs the board popup of the version you have installed, and the popup never vanishes without saying why.
|
|
8
|
+
|
|
9
|
+
Example: you linked the board plugin on 6.11.0 and later updated to 6.27.0. Pressing `prefix+a` still said "This folder is not a git repo with an orch run", because herdr kept running the 6.11.0 popup, from before the 6.22.0 fix. Now the next install or `orch update` moves the link by itself, and the popup opens in your repo.
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
- **The board plugin link no longer sticks to an old version.** `orch view plugin link` gave herdr the folder of the version running at that moment (`~/.local/share/herdr-orchestra/6.11.0/view/herdr-plugin`). Every update installs into a new folder, so herdr never saw newer popups. orch now links the stable `current/view/herdr-plugin` folder, and unlinks first so an old link is replaced instead of refused.
|
|
13
|
+
- **Installs and updates refresh an existing link.** The installer runs the new `orch view plugin refresh`: if the board plugin is linked (orch now remembers it, and asks `herdr plugin list` for links made by older versions) it is re-linked to `current`. Nothing happens when it was never linked, and a failure never stops the install.
|
|
14
|
+
|
|
15
|
+
- **The board popup no longer disappears silently.** Herdr closes a popup the moment its program ends, so any error in `orch board` made the popup flash and close before you could read it. Now:
|
|
16
|
+
- if drawing the run fails, the board stays open, shows the error in one line and tries again when the run changes; the full traceback is saved in `~/.local/share/herdr-orchestra/board-error.log`;
|
|
17
|
+
- if `orch board` ends by itself (a crash, or orch missing, or the folder is not a repo), the popup stays open with the error and where it is saved, until you press a key;
|
|
18
|
+
- keys a terminal sends while the popup opens (focus or size replies) are ignored for the first half second, and Esc only closes the board when it is the Esc key, not the start of an escape sequence;
|
|
19
|
+
- every close is noted in `~/.local/share/herdr-orchestra/board-last-close.log` (which key, after how long), so "it closed by itself" can be checked.
|
|
20
|
+
- `orch board` draws once only when it has no terminal for input or output (before, only output was checked, and a popup without a keyboard crashed).
|
|
21
|
+
|
|
22
|
+
### If you linked the plugin before 6.30.0
|
|
23
|
+
Run `orch view plugin unlink` and then `orch view plugin link` once (or just update to 6.30.0). Restart herdr if the popup still shows the old text.
|
|
24
|
+
|
|
25
|
+
### Not yet tried
|
|
26
|
+
- On real herdr: tested with the simulated herdr and in a real terminal (pty) only, including the popup cases above. The output of `herdr plugin list` is assumed to contain the plugin id; if it does not, the one-time unlink and link above still fixes it.
|
|
27
|
+
## [6.29.0] - 2026-11-27
|
|
28
|
+
|
|
29
|
+
The lead now knows its own question picker by name, so /orch-plan's questions open as a click list in every agent that has one. Before, the playbook only said "Antigravity's own picker" and showed a plain-text example, so an Antigravity lead asked its questions (and "Keep this team?") as numbered text you had to answer by typing.
|
|
30
|
+
|
|
31
|
+
Example: you start `/orch-plan` in Antigravity. `orch lead plan` now begins with `QUESTION PICKER you are Antigravity: ask ... with your built-in ask_question tool`, and the questions (where Goals live, storage, team) open as a numbered list you pick with the arrow keys, its suggestion first, with "Write-in..." for your own answer. The same goes for "Keep this team?", "Which step?" and "Which model?" after the plan.
|
|
32
|
+
|
|
33
|
+
### Fixed
|
|
34
|
+
- **`orch lead plan` names the lead's picker.** It finds which agent leads (its shell marks, or the kind herdr reports for the pane, which is how it finds Antigravity) and prints one `QUESTION PICKER` line: `AskUserQuestion` (Claude Code), `ask_question` (Antigravity), `request_user_input` (Codex), `orch_ask` (Pi), `question` (OpenCode), with each tool's limits. An agent with no known picker is told to ask in chat. When orch can't tell the agent, the line lists every name.
|
|
35
|
+
- **Codex: orch checks whether the picker is on.** Codex refuses `request_user_input` outside Plan mode ("request_user_input is unavailable in Default mode") unless `default_mode_request_user_input` is on. orch already turns it on for a lead it opens. Now `orch lead plan` reads `~/.codex/config.toml` and, where Codex's sandbox shows it, the command that started this Codex. On: use the picker. Off (a Codex you opened yourself): ask in chat, and tell you how to get the picker (`orch team codex`, or `default_mode_request_user_input = true` under `[features]` in `~/.codex/config.toml`). Can't tell (Codex's Linux sandbox hides its own process): try the tool once, and fall back to chat if it is refused.
|
|
36
|
+
- **Pi without orch's package** is told to ask in chat and to suggest `pi install npm:herdr-orchestra`.
|
|
37
|
+
- The plan playbook points to the `QUESTION PICKER` line, names `ask_question` for Antigravity, says never to write the choices as plain text when a picker exists, and counts Codex's "unavailable in Default mode" as "no picker". "Keep this team?" uses the same picker.
|
|
38
|
+
|
|
39
|
+
### Checked
|
|
40
|
+
- Claude Code 2.1.332, Codex 0.172.0 and Pi 1.7.0 were started for real, with a fake model that calls each picker tool. Claude Code (in the lead's `acceptEdits` mode): the picker opened and the answer came back. Codex with orch's lead flag: the picker opened and the answer came back. Codex opened without it: the tool is listed but answers "unavailable in Default mode". Pi with orch's extension: `orch_ask` opened and saved `.orchestrate/questions.md`.
|
|
41
|
+
|
|
42
|
+
### Not yet tried
|
|
43
|
+
- **Antigravity was not run** (its download is blocked where this was built). The tool name `ask_question` comes from Antigravity's `/grill-me` docs and from other projects that show its questions (agy 1.5.x). Please try one `/orch-plan` with a question in Antigravity.
|
|
44
|
+
|
|
5
45
|
## [6.28.0] - 2026-11-27
|
|
6
46
|
|
|
7
47
|
### Changed
|
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
6.
|
|
1
|
+
6.30.0
|
|
Binary file
|
package/bin/orch
CHANGED
|
@@ -7937,9 +7937,52 @@ description = "orch run board"
|
|
|
7937
7937
|
"""
|
|
7938
7938
|
|
|
7939
7939
|
|
|
7940
|
+
def board_plugin_dir():
|
|
7941
|
+
"""The board plugin folder to give herdr. For an install it is the stable `current/view/herdr-plugin` path, not
|
|
7942
|
+
the folder of the version running now: every update installs into a new folder and moves `current`, so a link to
|
|
7943
|
+
the version folder would keep herdr on that version's popup forever. For a checkout it is the checkout's folder."""
|
|
7944
|
+
cur = share_dir() / "current" / "view" / "herdr-plugin"
|
|
7945
|
+
try:
|
|
7946
|
+
installed = Path(__file__).resolve().parent.parent.parent == share_dir().resolve()
|
|
7947
|
+
except OSError:
|
|
7948
|
+
installed = False
|
|
7949
|
+
return cur if installed and cur.is_dir() else asset("view/herdr-plugin")
|
|
7950
|
+
|
|
7951
|
+
|
|
7952
|
+
def board_plugin_linked():
|
|
7953
|
+
"""True when the board plugin was linked: by this version (remembered in settings) or by an older one, which
|
|
7954
|
+
left no note, so herdr's own plugin list is asked too."""
|
|
7955
|
+
if settings_load().get("board_plugin_linked"):
|
|
7956
|
+
return True
|
|
7957
|
+
try:
|
|
7958
|
+
r = subprocess.run([HERDR, "plugin", "list"], text=True, capture_output=True, timeout=HERDR_TIMEOUT_S,
|
|
7959
|
+
stdin=subprocess.DEVNULL)
|
|
7960
|
+
except (OSError, subprocess.TimeoutExpired):
|
|
7961
|
+
return False
|
|
7962
|
+
return r.returncode == 0 and VIEW_PLUGIN_ID in r.stdout
|
|
7963
|
+
|
|
7964
|
+
|
|
7965
|
+
def board_plugin_link(d):
|
|
7966
|
+
"""Link the board plugin folder `d` in herdr. Unlinks first, so a link to another folder (an older version's)
|
|
7967
|
+
is replaced instead of refused as a duplicate id."""
|
|
7968
|
+
with contextlib.suppress(OSError, subprocess.TimeoutExpired):
|
|
7969
|
+
subprocess.run([HERDR, "plugin", "unlink", VIEW_PLUGIN_ID], text=True, capture_output=True,
|
|
7970
|
+
timeout=HERDR_TIMEOUT_S, stdin=subprocess.DEVNULL)
|
|
7971
|
+
try:
|
|
7972
|
+
r = subprocess.run([HERDR, "plugin", "link", str(d)], text=True, capture_output=True,
|
|
7973
|
+
timeout=HERDR_TIMEOUT_S, stdin=subprocess.DEVNULL)
|
|
7974
|
+
except (OSError, subprocess.TimeoutExpired) as e:
|
|
7975
|
+
return subprocess.CompletedProcess([HERDR], 1, "", f"herdr did not answer ({e})")
|
|
7976
|
+
if r.returncode == 0:
|
|
7977
|
+
st = settings_load()
|
|
7978
|
+
st["board_plugin_linked"] = True
|
|
7979
|
+
settings_save(st)
|
|
7980
|
+
return r
|
|
7981
|
+
|
|
7982
|
+
|
|
7940
7983
|
def cmd_view(args):
|
|
7941
7984
|
"""orch view [--lan] [--port N] [--no-open] [--bg] -> the run as a live picture in your browser (view only).
|
|
7942
|
-
orch view stop | status | herdr-config | plugin link|unlink"""
|
|
7985
|
+
orch view stop | status | herdr-config | plugin link|unlink|refresh"""
|
|
7943
7986
|
sub = args[0] if args and not args[0].startswith("-") else None
|
|
7944
7987
|
if sub == "status":
|
|
7945
7988
|
v = view_info()
|
|
@@ -7963,11 +8006,20 @@ def cmd_view(args):
|
|
|
7963
8006
|
return
|
|
7964
8007
|
if sub == "plugin":
|
|
7965
8008
|
act = args[1] if len(args) > 1 else ""
|
|
7966
|
-
d =
|
|
8009
|
+
d = board_plugin_dir()
|
|
8010
|
+
if act == "refresh":
|
|
8011
|
+
# run by install.sh after every install or update: a link made by an older version points at that
|
|
8012
|
+
# version's own folder, so herdr kept running the old popup. Quiet and never fails the install.
|
|
8013
|
+
if d and board_plugin_linked():
|
|
8014
|
+
r = board_plugin_link(d)
|
|
8015
|
+
print(f"board popup plugin re-linked to {d}" if r.returncode == 0
|
|
8016
|
+
else f"WARN could not re-link the board popup plugin: {(r.stdout + r.stderr).strip()} "
|
|
8017
|
+
f"(run `orch view plugin link`)")
|
|
8018
|
+
return
|
|
7967
8019
|
if act == "link":
|
|
7968
8020
|
if not d:
|
|
7969
8021
|
die("view/herdr-plugin not found next to orch or in the install")
|
|
7970
|
-
r =
|
|
8022
|
+
r = board_plugin_link(d)
|
|
7971
8023
|
print((r.stdout + r.stderr).strip() or f"linked {d}")
|
|
7972
8024
|
if r.returncode == 0:
|
|
7973
8025
|
print("To open the board with a key, add this to herdr's config.toml and restart herdr "
|
|
@@ -7980,11 +8032,14 @@ def cmd_view(args):
|
|
|
7980
8032
|
if act == "unlink":
|
|
7981
8033
|
r = subprocess.run([HERDR, "plugin", "unlink", VIEW_PLUGIN_ID], text=True, capture_output=True)
|
|
7982
8034
|
print((r.stdout + r.stderr).strip() or f"unlinked {VIEW_PLUGIN_ID}")
|
|
8035
|
+
st = settings_load()
|
|
8036
|
+
if st.pop("board_plugin_linked", None) is not None:
|
|
8037
|
+
settings_save(st)
|
|
7983
8038
|
sys.exit(r.returncode)
|
|
7984
|
-
die("usage: orch view plugin link|unlink (herdr 0.7.4 or newer)")
|
|
8039
|
+
die("usage: orch view plugin link|unlink|refresh (herdr 0.7.4 or newer)")
|
|
7985
8040
|
if sub:
|
|
7986
8041
|
die(f"unknown `orch view {sub}` — use: orch view [--lan] [--port N] [--no-open] [--bg] | stop | status | "
|
|
7987
|
-
f"herdr-config | plugin link|unlink")
|
|
8042
|
+
f"herdr-config | plugin link|unlink|refresh")
|
|
7988
8043
|
lan = "--lan" in args
|
|
7989
8044
|
port = 0
|
|
7990
8045
|
if "--port" in args:
|
|
@@ -8294,9 +8349,24 @@ def render_board(vm, width=100, color=True, sel=None, note=""):
|
|
|
8294
8349
|
return out
|
|
8295
8350
|
|
|
8296
8351
|
|
|
8352
|
+
def board_error_lines(e):
|
|
8353
|
+
"""What the live board shows when drawing the run failed, instead of ending (herdr would close the popup and the
|
|
8354
|
+
error with it). The full traceback is saved for a bug report; the board tries again when the run changes."""
|
|
8355
|
+
import traceback
|
|
8356
|
+
tb = traceback.format_exc()
|
|
8357
|
+
saved = share_dir() / "board-error.log"
|
|
8358
|
+
with contextlib.suppress(OSError):
|
|
8359
|
+
share_dir().mkdir(parents=True, exist_ok=True)
|
|
8360
|
+
saved.write_text(f"{time.strftime('%Y-%m-%d %H:%M:%S')} orch {installed_version()} in {ROOT}\n{tb}")
|
|
8361
|
+
return ["orch board", "", f"The board could not draw this run: {type(e).__name__}: {e}",
|
|
8362
|
+
f"The full error is saved in {saved}: please send it with a bug report.",
|
|
8363
|
+
"It tries again when the run changes. [q] close"]
|
|
8364
|
+
|
|
8365
|
+
|
|
8297
8366
|
def cmd_board(args):
|
|
8298
8367
|
"""orch board [--once] [--no-color] -> the run as text, redrawn when it changes (for a herdr pane or popup)."""
|
|
8299
|
-
|
|
8368
|
+
# live needs a keyboard and a screen: with stdin or stdout not a terminal, draw once (termios would fail)
|
|
8369
|
+
once = "--once" in args or not (sys.stdout.isatty() and sys.stdin.isatty())
|
|
8300
8370
|
color = "--no-color" not in args and sys.stdout.isatty() and not os.environ.get("NO_COLOR")
|
|
8301
8371
|
if once:
|
|
8302
8372
|
print("\n".join(render_board(view_model(), shutil.get_terminal_size((100, 40)).columns, color)))
|
|
@@ -8307,6 +8377,7 @@ def cmd_board(args):
|
|
|
8307
8377
|
fd = sys.stdin.fileno()
|
|
8308
8378
|
old = termios.tcgetattr(fd)
|
|
8309
8379
|
sel, note, last, drawn = None, "", None, 0.0
|
|
8380
|
+
opened, closed_by = time.time(), "an interrupt"
|
|
8310
8381
|
try:
|
|
8311
8382
|
tty.setcbreak(fd)
|
|
8312
8383
|
sys.stdout.write("\x1b[?1049h\x1b[?25l")
|
|
@@ -8314,17 +8385,26 @@ def cmd_board(args):
|
|
|
8314
8385
|
k = _view_snapshot_key()
|
|
8315
8386
|
if k != last or time.time() - drawn > 30:
|
|
8316
8387
|
last, drawn = k, time.time()
|
|
8317
|
-
vm = view_model()
|
|
8318
8388
|
size = shutil.get_terminal_size((100, 40))
|
|
8319
|
-
|
|
8320
|
-
|
|
8389
|
+
try:
|
|
8390
|
+
vm = view_model()
|
|
8391
|
+
lines = render_board(vm, size.columns, color, sel, note)
|
|
8392
|
+
except Exception as e: # noqa: BLE001 - a popup closes when its program ends: show it, keep going
|
|
8393
|
+
vm = {}
|
|
8394
|
+
lines = board_error_lines(e)
|
|
8395
|
+
sys.stdout.write("\x1b[H\x1b[2J" + "\n".join(lines[:size.lines]))
|
|
8321
8396
|
sys.stdout.flush()
|
|
8322
8397
|
r, _, _ = select.select([sys.stdin], [], [], 0.5)
|
|
8323
8398
|
if not r:
|
|
8324
8399
|
continue
|
|
8325
8400
|
ch = os.read(fd, 8).decode(errors="ignore")
|
|
8401
|
+
if ch == "\x1b" and select.select([sys.stdin], [], [], 0.05)[0]:
|
|
8402
|
+
ch += os.read(fd, 8).decode(errors="ignore") # the rest of an escape sequence, not the Esc key
|
|
8403
|
+
if time.time() - opened < 0.5:
|
|
8404
|
+
continue # what a terminal sends as a pane opens (focus or size replies) is not a key press
|
|
8326
8405
|
n = len(vm.get("agents", []))
|
|
8327
8406
|
if ch in ("q", "Q", "\x1b"):
|
|
8407
|
+
closed_by = repr(ch)
|
|
8328
8408
|
break
|
|
8329
8409
|
if ch in ("\x1b[A", "k"):
|
|
8330
8410
|
sel = (n - 1 if sel is None else max(0, sel - 1)) if n else None
|
|
@@ -8345,6 +8425,11 @@ def cmd_board(args):
|
|
|
8345
8425
|
termios.tcsetattr(fd, termios.TCSADRAIN, old)
|
|
8346
8426
|
sys.stdout.write("\x1b[?25h\x1b[?1049l")
|
|
8347
8427
|
sys.stdout.flush()
|
|
8428
|
+
with contextlib.suppress(OSError): # why the last board closed, for a "the popup vanished" report
|
|
8429
|
+
share_dir().mkdir(parents=True, exist_ok=True)
|
|
8430
|
+
(share_dir() / "board-last-close.log").write_text(
|
|
8431
|
+
f"{time.strftime('%Y-%m-%d %H:%M:%S')} orch board in {ROOT} closed by {closed_by} "
|
|
8432
|
+
f"after {time.time() - opened:.1f}s\n")
|
|
8348
8433
|
|
|
8349
8434
|
|
|
8350
8435
|
COMMANDS = {
|
|
@@ -8427,7 +8512,7 @@ USAGE = """usage: orch <command> [args]
|
|
|
8427
8512
|
view [--lan] [--port N] [--no-open] [--bg]
|
|
8428
8513
|
the run as a live picture in your browser (view only): milestone graph, agents, details,
|
|
8429
8514
|
"needs you" alert, time and cost, replay. --lan: also from your phone, with a secret link
|
|
8430
|
-
view stop|status|herdr-config|plugin link|unlink
|
|
8515
|
+
view stop|status|herdr-config|plugin link|unlink|refresh
|
|
8431
8516
|
stop it / show its link / sidebar lines for herdr's config / the optional herdr plugin
|
|
8432
8517
|
board [--once] the run as text, redrawn when it changes: for a herdr pane or popup (any terminal)
|
|
8433
8518
|
report [--json] estimate vs actual time (why longer, who), rounds, first-pass rate, wasted work, tokens/cost
|
|
@@ -8731,6 +8816,8 @@ def cmd_lead(args):
|
|
|
8731
8816
|
if not part and not subagent:
|
|
8732
8817
|
lead_self_name()
|
|
8733
8818
|
guard_ensure(say_changes=False) # no agent pushes to main: the repo refuses it from the start
|
|
8819
|
+
if sub == "plan" and not part:
|
|
8820
|
+
print(picker_note(lead_kind()), end="")
|
|
8734
8821
|
if subagent and sub == "plan":
|
|
8735
8822
|
print(SUBAGENT_PLAN_NOTE, end="")
|
|
8736
8823
|
print(plan_playbook_part(pb.read_text(), part) if sub == "plan" else pb.read_text(), end="")
|
|
@@ -9717,6 +9804,120 @@ def asked_before_plan():
|
|
|
9717
9804
|
return False
|
|
9718
9805
|
|
|
9719
9806
|
|
|
9807
|
+
CODEX_PICKER_FEATURE = "default_mode_request_user_input"
|
|
9808
|
+
|
|
9809
|
+
|
|
9810
|
+
def lead_kind():
|
|
9811
|
+
"""The lead's agent kind for `orch lead plan`: `--agent` / ORCH_AGENT / the agent's own shell marks first
|
|
9812
|
+
(calling_agent), else the kind herdr reports for this pane (Antigravity leaves no mark orch knows in its shell,
|
|
9813
|
+
but herdr detects it). None when neither can tell."""
|
|
9814
|
+
kind = calling_agent()
|
|
9815
|
+
if not kind and os.environ.get("HERDR_PANE_ID"):
|
|
9816
|
+
with contextlib.suppress(Exception):
|
|
9817
|
+
kind = ((herdr_panes() or {}).get(os.environ["HERDR_PANE_ID"]) or {}).get("kind")
|
|
9818
|
+
names = {"antigravity": "agy", "gemini": "agy", "claude-code": "claude", "claude_code": "claude"}
|
|
9819
|
+
return names.get(kind, kind) if kind else None
|
|
9820
|
+
|
|
9821
|
+
|
|
9822
|
+
def _ancestor_args():
|
|
9823
|
+
"""The command lines of the processes above this one (parent first, at most 12), from `ps` (Linux and macOS).
|
|
9824
|
+
[] when ps is missing or fails."""
|
|
9825
|
+
out, pid = [], os.getppid()
|
|
9826
|
+
for _ in range(12):
|
|
9827
|
+
if pid <= 1:
|
|
9828
|
+
break
|
|
9829
|
+
try:
|
|
9830
|
+
r = subprocess.run(["ps", "-o", "ppid=,command=", "-p", str(pid)], text=True, capture_output=True,
|
|
9831
|
+
timeout=5)
|
|
9832
|
+
except (OSError, subprocess.TimeoutExpired):
|
|
9833
|
+
break
|
|
9834
|
+
line = r.stdout.strip()
|
|
9835
|
+
if r.returncode != 0 or not line:
|
|
9836
|
+
break
|
|
9837
|
+
ppid, _, cmd = line.partition(" ")
|
|
9838
|
+
out.append(cmd.strip())
|
|
9839
|
+
try:
|
|
9840
|
+
pid = int(ppid)
|
|
9841
|
+
except ValueError:
|
|
9842
|
+
break
|
|
9843
|
+
return out
|
|
9844
|
+
|
|
9845
|
+
|
|
9846
|
+
def codex_picker_state():
|
|
9847
|
+
"""(state, where) for Codex's question picker (request_user_input): state is "on", "off" or "unknown". Codex
|
|
9848
|
+
refuses the tool outside Plan mode ("request_user_input is unavailable in Default mode", checked with codex-cli
|
|
9849
|
+
0.172) unless the feature default_mode_request_user_input is on: in ~/.codex/config.toml ([features] <f> = true)
|
|
9850
|
+
or in the command that started this Codex (`-c features.<f>=true` or `--enable <f>`, which orch adds to a lead
|
|
9851
|
+
it opens). That command is only visible when Codex's sandbox shows its own process (macOS, or no sandbox); in
|
|
9852
|
+
the Linux sandbox it is hidden, so the answer is "unknown" and the lead tries the tool once."""
|
|
9853
|
+
feat = re.escape(CODEX_PICKER_FEATURE)
|
|
9854
|
+
cfg = Path(os.environ.get("CODEX_HOME") or Path.home() / ".codex") / "config.toml"
|
|
9855
|
+
with contextlib.suppress(Exception):
|
|
9856
|
+
import tomllib
|
|
9857
|
+
if (tomllib.loads(cfg.read_text()).get("features") or {}).get(CODEX_PICKER_FEATURE) is True:
|
|
9858
|
+
return "on", f"turned on in {str(cfg).replace(str(Path.home()), '~', 1)}"
|
|
9859
|
+
for cmd in _ancestor_args():
|
|
9860
|
+
try:
|
|
9861
|
+
toks = shlex.split(cmd)
|
|
9862
|
+
except ValueError:
|
|
9863
|
+
toks = cmd.split()
|
|
9864
|
+
if not any(os.path.basename(t) in ("codex", "codex.js") for t in toks[:3]):
|
|
9865
|
+
continue
|
|
9866
|
+
if re.search(rf"--enable[= ]{feat}\b|features\.{feat}\s*=\s*true", cmd) \
|
|
9867
|
+
and not re.search(rf"--disable[= ]{feat}\b|features\.{feat}\s*=\s*false", cmd):
|
|
9868
|
+
return "on", "turned on in the command that started this Codex"
|
|
9869
|
+
return "off", "this Codex was started without it, and ~/.codex/config.toml does not turn it on"
|
|
9870
|
+
return "unknown", "orch can't see how this Codex was started"
|
|
9871
|
+
|
|
9872
|
+
|
|
9873
|
+
def picker_note(kind):
|
|
9874
|
+
"""The first lines of `orch lead plan`: this lead's own question picker by its exact tool name (step 2a), or
|
|
9875
|
+
that it has none and asks in chat. Each name and limit was checked against the tool itself (see CHANGELOG
|
|
9876
|
+
6.29.0); a lead orch can't identify gets the list of all of them."""
|
|
9877
|
+
head = "QUESTION PICKER "
|
|
9878
|
+
tail = ("Use it for every question while you plan: step 2a, `grill:`, and \"Keep this team?\" / \"Which step?\" "
|
|
9879
|
+
"/ \"Which model?\" after the plan. If the tool is missing or refuses (an error such as \"unavailable\", \"not found\" or \"no_ui\"), ask "
|
|
9880
|
+
"in chat instead (step 2a, point 3) and say why in one line.\n\n")
|
|
9881
|
+
if kind == "claude":
|
|
9882
|
+
return (f"{head}you are Claude Code: ask step 2a's questions with your `AskUserQuestion` tool (1 to 4 "
|
|
9883
|
+
f"questions per call, 2 to 4 choices each, your suggestion first with \"(Recommended)\" in its "
|
|
9884
|
+
f"label; Claude Code adds the typed answer itself). " + tail)
|
|
9885
|
+
if kind == "codex":
|
|
9886
|
+
state, where = codex_picker_state()
|
|
9887
|
+
how = (f"\"For a click picker next time, let orch open the lead (`orch team codex`), or put "
|
|
9888
|
+
f"`{CODEX_PICKER_FEATURE} = true` under `[features]` in ~/.codex/config.toml and restart Codex.\"")
|
|
9889
|
+
use = (f"`request_user_input` tool (1 to 3 questions per call, 2 or 3 choices each, your suggestion first "
|
|
9890
|
+
f"with \"(Recommended)\" in its label, no \"Other\" choice: Codex adds one)")
|
|
9891
|
+
if state == "on":
|
|
9892
|
+
return f"{head}you are Codex and its picker is on ({where}): ask with your {use}. " + tail
|
|
9893
|
+
if state == "off":
|
|
9894
|
+
return (f"{head}OFF: you are Codex and its picker is off ({where}), so `request_user_input` would only "
|
|
9895
|
+
f"answer \"unavailable in Default mode\". Ask your planning questions in chat (step 2a, point 3), "
|
|
9896
|
+
f"and add one line for the developer: {how}\n\n")
|
|
9897
|
+
return (f"{head}you are Codex ({where}): try your {use} once. If it answers \"unavailable in Default "
|
|
9898
|
+
f"mode\", the picker is off: ask in chat (step 2a, point 3), don't try it again this plan, and add one "
|
|
9899
|
+
f"line for the developer: {how} " + tail)
|
|
9900
|
+
if kind == "agy":
|
|
9901
|
+
return (f"{head}you are Antigravity: ask step 2a's questions with your built-in `ask_question` tool (the one "
|
|
9902
|
+
f"/grill-me uses: a numbered list of choices in the terminal, your suggestion first, plus "
|
|
9903
|
+
f"\"Write-in...\" for a typed answer). Do not write the choices as plain text when you have this "
|
|
9904
|
+
f"tool. " + tail)
|
|
9905
|
+
if kind == "pi":
|
|
9906
|
+
return (f"{head}you are Pi: ask step 2a's questions with the `orch_ask` tool (from orch's Pi package; it "
|
|
9907
|
+
f"saves .orchestrate/questions.md itself). No `orch_ask` tool: the package is missing, so ask in "
|
|
9908
|
+
f"chat and add one line for the developer: \"For a click picker, run `pi install "
|
|
9909
|
+
f"npm:herdr-orchestra` and restart Pi.\" " + tail)
|
|
9910
|
+
if kind == "opencode":
|
|
9911
|
+
return f"{head}you are OpenCode: ask step 2a's questions with your `question` tool. " + tail
|
|
9912
|
+
if kind:
|
|
9913
|
+
return (f"{head}you are {kind}, and orch knows no question picker for it: ask your planning questions in "
|
|
9914
|
+
f"chat (step 2a, point 3). If you do have a tool that shows the developer clickable choices, use it "
|
|
9915
|
+
f"instead.\n\n")
|
|
9916
|
+
return (f"{head}orch can't tell which agent you are. Use your own picker "
|
|
9917
|
+
f"tool if you have one: `AskUserQuestion` (Claude Code), `request_user_input` (Codex), `ask_question` "
|
|
9918
|
+
f"(Antigravity), `orch_ask` (Pi), `question` (OpenCode). " + tail)
|
|
9919
|
+
|
|
9920
|
+
|
|
9720
9921
|
def _repo_state_path():
|
|
9721
9922
|
""".orchestrate/state.json of the repo this shell is in, or None (outside a repo, or no run yet)."""
|
|
9722
9923
|
r = git("rev-parse", "--path-format=absolute", "--git-common-dir", check=False)
|
package/install.sh
CHANGED
|
@@ -196,6 +196,8 @@ if ! "$CUR/bin/orch" agents sync; then
|
|
|
196
196
|
install_commands "${OC_CMDS[0]}" opencode-commands # one folder only: OpenCode reads both, two = listed twice
|
|
197
197
|
rm -f "${OC_CMDS[1]}/orch-plan.md" "${OC_CMDS[1]}/orch-run.md" "${OC_CMDS[1]}/orch-explain.md"
|
|
198
198
|
fi
|
|
199
|
+
# the board popup plugin: a link made by an older version points at that version's folder; move it to `current`
|
|
200
|
+
ORCH_SHARE="$SHARE" "$CUR/bin/orch" view plugin refresh 2>/dev/null || true
|
|
199
201
|
|
|
200
202
|
# clean up files from pre-repo kit versions
|
|
201
203
|
rm -f "$HOME/.opencode/commands/orchestrate.md" "$HOME/.config/opencode/orch/orch-wait.sh" "$BIN/orch-wait.sh" 2>/dev/null || true
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "herdr-orchestra",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.30.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
|
@@ -39,9 +39,9 @@ A wrong guess in the plan is the most expensive mistake in a run: every coder bu
|
|
|
39
39
|
- From your research, list what the code, the docs and the request do NOT settle: business rules ("can a discount bring the total to zero?"), data shapes nobody has defined, auth or security trade-offs, which of two existing patterns to follow, a change to a decision record. Not questions the code answers: look those up yourself.
|
|
40
40
|
- **Nothing to ask?** Go straight on to step 2b. Don't invent questions.
|
|
41
41
|
- **Something to ask?** Use the **native question rule**: put all the questions in front of the developer at once, each with 2 or 3 concrete choices and your own suggestion and why (from what you found).
|
|
42
|
-
1. **You have a question picker: use it.**
|
|
42
|
+
1. **You have a question picker: use it.** The `QUESTION PICKER` line at the top of this playbook names yours: `AskUserQuestion` in Claude Code, `request_user_input` in Codex (only when its picker is turned on; orch turns it on for a Codex lead it opens), `ask_question` in Antigravity (the tool `/grill-me` uses), `orch_ask` in Pi (from orch's Pi package), `question` in OpenCode. Never write the choices as plain text when you have a picker: the developer then has to type `1 a, 2 b` instead of clicking. Choices `(a)`, `(b)`, `(c)`, your suggestion marked recommended (or labelled `(recommended)`), a custom answer allowed. A picker that takes fewer questions than you have (Claude Code takes 4 at a time): ask in two rounds. When the answers come back, write the questions with their choices and the answers under `## Answers` in `.orchestrate/questions.md` (`orch_ask` saves the file itself), then go straight on: no extra message, no waiting.
|
|
43
43
|
2. **The developer closed the picker without answering** (Escape, `cancelled`): don't guess and don't plan. Say "Planning is paused until you answer these. Say when you are ready, or answer in chat." and **STOP**.
|
|
44
|
-
3. **No picker, or it can't show here** (headless, `no_ui`, the tool is refused): write the questions to `.orchestrate/questions.md` and show the developer the same text, **all in one message**: one line each, numbered. End with: "Answer by number (for example `1 a, 2 both, 3 no`). I write the plan after your answers; nothing runs until you say go." Then **STOP** and wait.
|
|
44
|
+
3. **No picker, or it can't show here** (the `QUESTION PICKER` line says OFF, headless, `no_ui`, the tool is missing or refused, e.g. Codex's "unavailable in Default mode"): write the questions to `.orchestrate/questions.md` and show the developer the same text, **all in one message**: one line each, numbered. End with: "Answer by number (for example `1 a, 2 both, 3 no`). I write the plan after your answers; nothing runs until you say go." Then **STOP** and wait.
|
|
45
45
|
Example (the chat form; a picker shows the same question and choices, one at a time):
|
|
46
46
|
```
|
|
47
47
|
Before I plan, 3 questions:
|
|
@@ -328,7 +328,7 @@ Rules for every milestone:
|
|
|
328
328
|
<!-- quick: Let the developer choose the models (from step 10) -->
|
|
329
329
|
**Let the developer choose the models.** Only now, after the developer has seen the whole plan in your chat; never while you are still researching or planning.
|
|
330
330
|
1. Run `orch plan team` and show its table as it is: each milestone and the reviewer, its coder, model and thinking level, and whether the developer chose it. When it prints `SUBAGENT MODE`, skip this block.
|
|
331
|
-
2. Ask one question, in your question picker when you have one (
|
|
331
|
+
2. Ask one question, in your question picker when you have one (the tool the `QUESTION PICKER` line at the top of `orch lead plan` named, e.g. `ask_question` in Antigravity): "Keep this team?" with (a) Keep it (recommended), (b) Change a step, (c) Change the reviewer. No picker, or it can't show here: after the table write "Type **ok** to keep it, or what to change, for example `M3 sol low` or `reviewer luna high`." and **STOP** until they answer.
|
|
332
332
|
3. Change a step: ask one question at a time, each in the picker: "Which step?" (the milestones), then "Which model?" (the models on the table's `You can pick` line), then "Which thinking?" (its thinking levels). Change the reviewer: the same, without "Which step?". Never offer a model the `Never allowed` line names. Then run `orch plan model <Mn> <model>@<thinking>` (or `orch plan model reviewer <model>@<thinking>`). A typed answer means the same: in `M3 sol low`, `sol` is the model on the `You can pick` line whose name has that word (`gpt-6.2-sol`), so run `orch plan model M3 gpt-6.2-sol@low`. When a word fits two models or none, ask which one.
|
|
333
333
|
4. Tell the developer in one line what the command said (the step is locked to that model; a new coder joins when no coder ran it, and `orch team up` opens its panel when the run starts), then run `orch plan team` again, show the table and ask "Keep this team?" again, until they keep it.
|
|
334
334
|
The developer's choice is a lock: orch gives that step only to a coder on that model, and you never change it yourself (no `--to` a coder on another model, no `--tier`, no `orch escalate` for it: orch refuses them). Only the developer changes it, now or later in the run (`orch lead run` says how).
|
|
@@ -1,8 +1,31 @@
|
|
|
1
1
|
#!/bin/sh
|
|
2
2
|
# The popup's program: `orch board` in the run's repo. Closes with q.
|
|
3
|
+
# Herdr closes a popup the moment its program ends, so anything that ends it early (a missing orch, no repo, an
|
|
4
|
+
# error) must stay on screen until a key is pressed, and the reason is saved where a bug report can find it.
|
|
5
|
+
log="${ORCH_SHARE:-$HOME/.local/share/herdr-orchestra}/board-error.log"
|
|
6
|
+
hold() { # hold <message...>: show why the board ended, save it, wait for a key
|
|
7
|
+
printf '%s\n' "$@"
|
|
8
|
+
mkdir -p "$(dirname "$log")" 2>/dev/null
|
|
9
|
+
{ date '+%Y-%m-%d %H:%M:%S'; echo "folder: $(pwd)"; printf '%s\n' "$@"; } > "$log" 2>/dev/null
|
|
10
|
+
printf '\nSaved in %s. Press any key to close.' "$log"
|
|
11
|
+
if [ -t 0 ]; then
|
|
12
|
+
old=$(stty -g 2>/dev/null); stty -icanon -echo 2>/dev/null
|
|
13
|
+
dd bs=1 count=1 >/dev/null 2>&1
|
|
14
|
+
[ -n "$old" ] && stty "$old" 2>/dev/null
|
|
15
|
+
else
|
|
16
|
+
sleep "${ORCH_BOARD_HOLD_S:-30}"
|
|
17
|
+
fi
|
|
18
|
+
exit 1
|
|
19
|
+
}
|
|
3
20
|
orch=$(command -v orch || echo "$HOME/.local/bin/orch")
|
|
4
|
-
[ -x "$orch" ] ||
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
21
|
+
[ -x "$orch" ] || hold "orch not found on PATH — install herdr-orchestra (npx herdr-orchestra@latest)"
|
|
22
|
+
git rev-parse --show-toplevel >/dev/null 2>&1 \
|
|
23
|
+
|| hold "This folder ($(pwd)) is not a git repo with an orch run. Open the board from a pane inside the repo."
|
|
24
|
+
{ [ -t 0 ] && [ -t 1 ]; } || hold "The popup has no terminal to draw in (stdin or stdout is not a terminal)."
|
|
25
|
+
err=$(mktemp 2>/dev/null || echo "/tmp/orch-board.$$")
|
|
26
|
+
start=$(date +%s)
|
|
27
|
+
"$orch" board 2>"$err"; code=$?
|
|
28
|
+
took=$(( $(date +%s) - start ))
|
|
29
|
+
msg=$(tail -n 25 "$err" 2>/dev/null); rm -f "$err"
|
|
30
|
+
[ "$code" -eq 0 ] && exit 0 # closed with q or Esc
|
|
31
|
+
hold "orch board stopped by itself (exit $code, after ${took}s) in $(pwd):" "" "${msg:-no error text}"
|