Repository navigation
agora phase 2 — tui: the seat fleet as a navigable organisation chart, Enter opens the conversation - #93
Conversation
New skills/agora/scripts/agora_chart.py: snapshot() reads seats + live state into a node forest and folds dead seats (retired/failed/error, or gone from the harness) into a +N retired note; layout() places boxes roots-left, children right, siblings stacked, parents centred on their children, with bus connectors; paint_chart() draws onto a Screen (GridScreen renders text). agora.py gains the chart verb (group optional → fleet with rounded group boxes, --all, --width), refresh_caches() for a long-lived reader, and chart_module() so the chart binds to the running module's caches. 27 assertions on an org fixture (busy/idle/blocked/vacant/retired, Korean now line keeps borders aligned).
…rows move, enter attaches in a tmux window, s sends, detail/board panels, headless driver New skills/agora/scripts/agora_tui.py: one state dict, handle_key() as the whole keymap, paint() onto any Screen; RealActions opens claude attach in a new tmux window (or switches to the seat's open one) and runs agora send in a thread; HeadlessActions records decisions so agora tui --headless --keys … drives the same code from the bash suite. A Refresher thread re-reads the harness every AGORA_TUI_REFRESH seconds off the drawing thread. agora tui re-execs itself inside tmux new-session -A -s agora when started outside tmux. agora.py gains the tui verb and sibling_module(); agora_chart.fit() learns collapse=False for columnar text. 60 headless assertions.
… string peer_live compared the harness's procStart (written in UTC) with ps -o lstart= (printed in local time) as text, so on any machine not on UTC every live seat read as stopped: agora send refused everything, wake resumed instead of using the socket, and sync mirrored idle sessions as stopped. Observed on this machine (KST): the record said 'Wed Sep 2 22:38:53 2026' and ps said 'Thu Sep 3 07:38:53 2026' for the same live pid, an exact 9-hour offset, on every record from harness 2.1.251 through 2.1.259. same_process() now compares instants and accepts the recorded string read as either UTC or local. Three assertions pin it, using the suite's own live socket-server pid: local-form and UTC-form procStart both identify the process (the UTC one fails without this fix), an unrelated time still reads as a recycled pid. The helper reads ps under LC_ALL=C, as agora does — a localized ps prints an unparseable date and silently skips the check.
…evidence, live-proof transcripts; SKILL.md documents chart and tui
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 65b11166fc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| Run it milestone by milestone through `fork` subagents, one milestone per fork. You stay the orchestrator: the fork inherits your full context — the grill, the reasoning behind the plan, the state of the branch — so it starts oriented instead of re-deriving, and the implementation churn stays out of your context, which is what makes a long plan survivable in a single session. Dispatch in plan order and wait for each fork before the next; milestones build on each other and the next one needs the previous result in the tree. Brief each fork with its milestone's scope and acceptance, and let it own that milestone's bookkeeping and commits. When it reports back, verify the acceptance yourself — holding the whole arc is the orchestrator's job. A milestone too small to be worth a dispatch is fine to do inline; this is the default shape, not a gate. | ||
|
|
||
| This profile fits durable background sessions — seats spawned through doperpowers:agora: the ExecPlan is exactly what a spawn prompt can carry, and it survives the seat's context death — the document is the memory. |
There was a problem hiding this comment.
Restore this protocol until its behavior is evaluated
This deletes the ExecPlan track's only default execution shape, allowing future long plans to run inline or with unconstrained delegation, but this commit provides no before/after skill-behavior evaluation or pressure-test results for that change—the reported 497 assertions exercise the Agora CLI/TUI. Restore the protocol or provide the required behavioral evidence before changing it. CLAUDE.mdL32-L39
Useful? React with 👍 / 👎.
| text, state["input"] = state["input"].strip(), None | ||
| node = focused_node(state) | ||
| if text and node is not None: | ||
| actions.send(node, text) |
There was a problem hiding this comment.
Bind message input to the originally selected seat
If the selected seat disappears or becomes hidden while the operator is typing, the three-second refresher calls rebuild(), which moves focus to the first visible root; Enter then resolves focused_node(state) again here and sends the text to that different seat. Preserve the target seat ID when input mode starts and either send to that same seat or refuse if it is no longer available.
Useful? React with 👍 / 👎.
| if prune(c): | ||
| kept.append(c) | ||
| else: | ||
| node["hidden"] += 1 + count_nodes(c["children"]) |
There was a problem hiding this comment.
Include all descendants in folded-seat counts
When an entirely dead subtree is pruned, recursive calls have already removed its descendants from c["children"] and accumulated them in c["hidden"]. Counting only the remaining children therefore reports +1 retired for a dead node with any number of dead descendants, even though the summary correctly counts the whole subtree; include the child's accumulated hidden count.
Useful? React with 👍 / 👎.
| return [(node["label"], ""), (counts, ""), (("+%d retired" % node["hidden"]) if node["hidden"] else "", "")] | ||
| live = node["live"] or "unknown" | ||
| state = "%s %s" % (GLYPH.get(live, "?"), live) | ||
| tail = node["now"] or (("+%d retired" % node["hidden"]) if node["hidden"] else "") |
There was a problem hiding this comment.
Preserve the retired note when a parent has status text
For a live parent that has both a now value and folded dead children, this expression always selects now and suppresses the +N retired note. Since active seats commonly set their status line, the chart then loses the promised indication of which parent owns the hidden seats; render both pieces, or otherwise reserve a visible place for the folded count.
Useful? React with 👍 / 👎.
| alias = node["label"] | ||
| try: | ||
| wins = self._tmux("list-windows", "-F", "#{window_id}").stdout.split() | ||
| wid = st["attached"].get(alias) |
There was a problem hiding this comment.
Key attached windows by full seat identity
Fleet mode permits the same alias in different groups, but this lookup keys the window cache only by alias. After opening group-a/scout, pressing Enter on group-b/scout will select the first seat's existing window instead of opening the second conversation; use the node's full group/alias ID as the cache key.
Useful? React with 👍 / 👎.
|
|
||
|
|
||
| def main_loop(stdscr, state, curses): | ||
| curses.curs_set(0) |
There was a problem hiding this comment.
Tolerate terminals that cannot hide the cursor
On a real TTY whose terminfo lacks the cursor-visibility capability—reproducible with TERM=dumb, particularly when using the documented --no-tmux mode—curses.curs_set(0) raises curses.error, and the wrapper exits before rendering anything. Treat cursor hiding as optional by catching that exception, as the color initialization already does.
Useful? React with 👍 / 👎.
…ch into a surviving tmux session, qualify attach windows, count folded subtrees Four findings from the codex review of this branch, all confirmed: - A refresh landing while the operator types rebuilds the layout and can move the focus, so enter sent the text to whatever was focused then — and to a GROUP node in fleet view, which crashed on node["seat"]. The target is now captured when the editor opens; if it has left the chart the message is dropped with a reason. - The agora tmux session outlives the chart (enter's conversation windows keep it alive), so new-session -A on the next run merely attached and dropped the command, landing the operator in an old conversation with no chart. An existing session now gets a fresh chart window. - Open conversation windows were keyed by bare alias, so the same alias in two groups switched to the wrong seat's window. Keyed by qualified seat id now. - Folding a dead child added one for its whole dead subtree, so a box said '+1 retired' while the summary counted several. 7 new assertions, including two driver-level tokens (!focus, !drop) that let the suite reproduce what only the refresh thread does in a live screen. The tmux relaunch is verified live: with a leftover window holding the session open, agora tui opens window 'chart' and attaches to it.
…ux relaunch proof
Summary
agora phase 2 — the fleet as a navigable organisation chart.
agora tuidraws a group (or the whole fleet) as boxes: roots on the left, children to the right, siblings stacked, each seat showing its alias, role, a live-state glyph and the one-line status the agent set. Arrow keys move a heavy-bordered focus; Enter opens that seat's conversation withclaude attachin a new tmux window, so the chart stays up and returning to the map is an ordinary tmux window switch.stypes a message and delivers it over the seat's inbox socket,bshows the group's board with a post overlay,aunfolds retired seats,?lists the keys.The same layout engine renders without curses:
agora chart [group]prints the chart as text, for agents and for anyone outside tmux.What lands:
skills/agora/scripts/agora_chart.py—snapshot()reads seats plus live state into a node forest and folds dead seats (retired, failed, errored, or gone from the harness) into a+N retirednote on their parent;layout()places boxes left-to-right with per-depth column widths and bus connectors;paint_chart()draws onto aScreen. Display width is counted in cells, so a Korean status line keeps a box's borders aligned.skills/agora/scripts/agora_tui.py— one state dict,handle_key()as the whole keymap,paint()onto anyScreen. Effects sit behind an actions object:RealActionsopens or switches tmux windows and runsagora sendoff the drawing thread;HeadlessActionsrecords decisions, soagora tui --headless --keys "right,down,enter"drives the identical code from the bash suite. A refresher thread re-reads the harness every few seconds (the read takes over a second, so it never runs on the drawing thread). Started outside tmux,agora tuire-executes itself insidetmux new-session -A -s agora.refresh_caches()for a long-lived reader.skills/agora/SKILL.mddocuments both verbs;skills/execplan/SKILL.mddrops the one-milestone-per-fork execution shape.The defect the live proof found
peer_live()decided whether a seat's session was still the process its record described by comparing the harness's recordedprocStartwith whatps -o lstart=prints — as text. The harness writes that field in UTC;psprints local time. On any machine not on UTC the comparison never matched, so every live seat read asstopped:agora sendrefused with "not live",wakeresumed a session instead of using its open socket, andsyncmirrored idle sessions as stopped.Observed here (KST): for live pid 28115 the record said
Wed Sep 2 22:38:53 2026andpssaidThu Sep 3 07:38:53 2026— the same instant, 32400 seconds apart — and every peer record on this machine from harness 2.1.251 through 2.1.259 carried the same offset.same_process()now compares instants and accepts the recorded string read as either UTC or local.Two reasons the v3 suite could not catch it: its fabricated peer records carry no
procStartat all (the check is skipped when either side is unparseable), and the first regression test written for it also passed without the fix, because a Korean-localepsprints수 9/ 2 23:08:14 2026, which the helper could not parse. ReadingpsunderLC_ALL=C, asagora.proc_startalready does, made the assertion fail without the fix and pass with it.Review
A codex native review of the branch (
gpt-5.6-sol) returned four findings; all were confirmed and fixed ineaf9c287:node["seat"]. The target is captured when the editor opens; if it has left the chart, the message is dropped with a reason.agorasession outlives the chart, because the conversation windows Enter opens keep it alive.new-session -Athen merely attaches and drops the command, landing the operator in an old conversation with no chart. An existing session now gets a freshchartwindow. Verified live: with a leftover window holding the session open,agora tuiopened windowchartand attached to it.+1 retiredwhile the summary counted several.Testing the first one needed a way to move the focus mid-run, which the keymap cannot do (input mode swallows every keystroke).
--keysnow accepts two driver-level tokens,!focus:<id>and!drop:<id>, that do what only the refresh thread does in a live screen.Verification
tests/agora/run-agora-tests.sh: 504 assertions pass (406 before this branch) — 27 for the chart, 60 for the screen driven headlessly, 4 for the process-identity fix, 7 for the review wave.1 of 497 assertions FAILED — a procStart written in UTC identifies the same process; with the fix, all 497 pass.demorepliedPONG-TUI;agora tui demorendered it; Enter openedclaude attachin window 1 while the chart kept running in window 0; Enter again switched to that window rather than opening a second;qquit the chart and left the conversation window open. After the liveness fix,sdelivered to a live seat and it replied "Reachable. What's needed?". Transcripts are in the plan's Artifacts section.tests/claude-code/run-skill-tests.sh: 17 passed, 8 skipped (gated tiers), 1 failed —test-subagent-driven-execution.sh, which greps a model's free-form prose forexecutor.*fix. It passed on a rerun, and this branch does not touch that skill.Plan
docs/doperpowers/execplans/2026-09-02-agora-tui.md— the living ExecPlan: Decision Log (grill choices and the calls made while building), Surprises (the liveness defect and its evidence, the harness's own agent view, whatclaude attachdoes to a stopped session, background pids that outlive their session record), Artifacts (chart output and live-proof transcripts).