herdr-orchestra 6.29.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 CHANGED
@@ -2,6 +2,28 @@
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.
5
27
  ## [6.29.0] - 2026-11-27
6
28
 
7
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.
package/VERSION CHANGED
@@ -1 +1 @@
1
- 6.29.0
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 = asset("view/herdr-plugin")
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 = subprocess.run([HERDR, "plugin", "link", str(d)], text=True, capture_output=True)
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
- once = "--once" in args or not sys.stdout.isatty()
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
- lines = render_board(vm, size.columns, color, sel, note)[:size.lines]
8320
- sys.stdout.write("\x1b[H\x1b[2J" + "\n".join(lines))
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
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.29.0",
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": {
@@ -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" ] || { echo "orch not found on PATH — install herdr-orchestra (npx herdr-orchestra@latest)"; sleep 5; exit 1; }
5
- if ! git rev-parse --show-toplevel >/dev/null 2>&1; then
6
- echo "This folder ($(pwd)) is not a git repo with an orch run. Open the board from a pane inside the repo."; sleep 5; exit 1
7
- fi
8
- exec "$orch" board
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}"