Skip to content

feat(sidebar): a bot's row carries its running threads, its conversation leaves the chats (#24) - #27

Merged
crcrworks merged 1 commit into
mainfrom
agent/24-bot-row-threads
Nov 29, 2026
Merged

crcrworks merged 1 commit into
mainfrom
agent/24-bot-row-threads

Conversation

@crcrworks

Copy link
Copy Markdown
Owner

Closes #24

What

Two related sidebar findings, both in the bots' section and the chats list:

  1. A bot's row now carries how many of its threads run now. The count is
    the conversation's chat row's own (running_subagents + working_side_chats
    — exactly the sum an activity row's pill shows), read where the shell
    already reads that row's state and title: no new call, nothing polled. The
    badge is SessionRow.subagents, the same part the activity rows use, and it
    stands between the state badge and the corner — where an activity row has
    it.

  2. A bot's conversation leaves the chats list. Its row in the Bots
    section is the bot (a click opens the conversation, ADR 0009), so listing
    it again below was one bot twice. The lists skip the conversations of the
    bots sessions.bots names. A thread a bot started stays an ordinary chat:
    it is what the child strip and the right sidebar's archive open, and a
    conversation carries the bot's own id whereas a thread carries it too but is
    a chat of its own.

    Scope decided here (also commented on the issue): only each bot's
    main conversation is filtered — sessions.bots[].conversation. Every
    chat carrying a bot id is not, because a bot's spawned threads would then
    have nowhere to be reached from in the sidebar.

Before After
Shared/crosspond-24/before-sidebar.png Shared/crosspond-24/after-sidebar.png
both regions stacked: Shared/crosspond-24/compare/bots-before-after.png (small: -s.png)

In the before shot Sora's row is Sora @sora Working (ring) and "Umi's
conversation" leads the Activity list; after, the row is
Sora @sora Working ●3 (ring) and the conversation is gone from the list while
the four chats of the person's own are untouched (Working's count drops 2 → 1
with it).

Files

  • apps/zgx/ui/screens/shell/sidebar.luau — the bots computed takes
    subagents from the conversation's chat row; the projects computed skips
    bot_chats (and does not count them as making a project listed).
  • apps/zgx/ui/ds/bot_row.luau — Bot.subagents in the type, SessionRow.subagents
    in the row.
  • apps/zgx/ui/shell_fixture.luau — fixture.sora_threads (Sora's
    conversation at 2 subagents + 1 working side chat).
  • apps/zgx/tests/bot_rows.rs — two tests.
  • docs/adr/0009-mvp-bot-ui.md — decision 1 amended (ADR 0009 is the spec's
    word on the bots' UI; no new ADR: the same decision, extended).

No Rust host change: running_subagents, side_chats and working_side_chats
were already on the scripts' chat rows, and sessions.bots already names each
bot's conversation.

Acceptance (from the issue)

Condition Result
A bot with a running thread shows the count badge on its row; the count matches what an activity row would have shown yes — bot_rows.rs::a_bot_row_carries_how_many_threads_run (row reads "3 subagents running" after fixture.sora_threads sets 2 subagents + 1 working side chat; the other bot's row has none; the pill sits inside the row). Same expression as the activity row's subagents in screens/shell/sidebar.luau
No bot conversation appears in the Activity section; ordinary chats unaffected yes — bot_rows.rs::a_bot_conversation_is_not_a_chat_of_the_activity_list (both conversations absent with Activity on, "Write the docs" present) and the screenshots
State badge, context ring, click-to-open keep working yes — a_rows_state_is_its_conversations (Working → Input follows the chat row), a_click_on_a_bot_opens_its_conversation (route becomes /session/bot-sora), a_bot_row_is_one_line_tall_with_its_content_centred still passes; badge and ring are visible in after-sidebar.png
cargo check --workspace --locked and cd apps/zgx && cargo check --locked pass yes — both exit 0 (local-ci status on this head)
VM screenshots (vmux, crosspond-<n>): sidebar with a bot running a thread, before/after yes — vmux session crosspond-24, above

Verification

Full record: /Users/crcr/OpenBot/Shared/crosspond-24/verification.md
(re-run with scenario.sh check and scenario.sh shots [before|after] +
scenario.sh compare; scenario at Shared/crosspond-24/scenario.sh).

Command Result
cargo check --workspace --locked exit 0
cd apps/zgx && cargo check --locked exit 0
cd apps/zgx && cargo test --locked --test bot_rows 7 passed / 0 failed
cd apps/zgx && cargo test --locked --test design_lint 1 passed
cd apps/zgx && cargo test --locked --test sidebar_row_ink --test leftovers --test archived_list --test chat_drop 11 passed / 0 failed
cd apps/zgx && cargo test --locked --test reload 15 passed / 1 failed (below)
cd apps/zgx && cargo test --locked --test pointer_cursor 1 passed / 1 failed (below)
ci-local.sh crcrworks/crosspond both verify commands ok, local-ci = success

Known failures, compared on origin/main (78237f723) in a separate worktree
with the same UI: reload::a_reload_keeps_the_project_editor_open and
pointer_cursor::the_sidebar_edge_shows_the_resize_cursor_and_a_row_the_hand
fail identically there (same panic, same numbers). Same failure set as base.

Not run: zgx test ui (the Luau UI suite) — this environment has no zgx CLI
(~/zgx-cli/bin/zgx is absent and installing it builds zgx's own binary at the
pinned rev). The two behaviours it would cover are covered by
tests/bot_rows.rs on the same fixture; CI's scripts/ci/test-zgx.sh ui runs
it. A crosspond v2 note: v2's ds/sidebar.luau copy passes no new prop to
BotRow, so it needed no change and .base.json was not re-recorded.

要相談

None.

…ion leaves the chats (#24)

A bot's conversation showed twice — in the Bots section (its row) and again
in the chats list — and the count of running threads (the activity row's
pill) only reached the second one.

- `screens/shell/sidebar`: the bots' rows take `subagents` from their
  conversation's chat row (its subagents plus its working side chats, the
  same sum an activity row's pill shows), and the lists of chats skip the
  conversations of the bots `sessions.bots` names: one bot, one row. A
  thread a bot started stays an ordinary chat.
- `ds/bot_row`: the row shows `SessionRow.subagents` where an activity
  row's pill stands, between its state badge and its corner.
- ADR 0009 amended with both.
@crcrworks crcrworks added the agent/code-ready レビュー待ち label Nov 29, 2026
@crcrworks crcrworks added the agent/review レビュー中 label Nov 29, 2026 — with OpenBotGit
@crcrworks crcrworks removed the agent/code-ready レビュー待ち label Nov 29, 2026

@crcrworks crcrworks left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VERDICT: APPROVE_OK
patch-id: 9d07932cccd0c11dd22101dcdcb454dbdab99ad2

Status

Reviewed head e15017558, light depth (no agent/risky, no reviewHighRiskPaths for this repo). PR is open, not draft, MERGEABLE, base main, closingIssuesReferences = #24 (Closes #24).

Result

APPROVE_OK. Every acceptance condition below is confirmed; three things are recorded as follow-ups and one thing was not run.

受け入れ条件 (established before reading the diff)

# Condition (issue #24) How I checked Result
A1 A bot with a running thread shows the count badge on its row, and the count is the same one an activity row would show diff of screens/shell/sidebar.luau (bots computed) vs the activity row's subagents; ds/bot_row.luau uses SessionRow.subagents; ran cargo test --test bot_rows; read compare/bots-before-after-s.png 確認済み
A2 No bot conversation appears in the Activity section; ordinary chats unaffected diff of the projects computed (bot_chats, skipped in listed and when filling group.sessions); bot_rows::a_bot_conversation_is_not_a_chat_of_the_activity_list; the same screenshot pair 確認済み
A3 State badge, context ring, click-to-open keep working bot_rows::a_rows_state_is_its_conversations, a_click_on_a_bot_opens_its_conversation, a_bot_row_is_one_line_tall_with_its_content_centred all pass in the same run; badge + ring visible in after shot 確認済み
A4 cargo check --workspace --locked and cd apps/zgx && cargo check --locked pass local-ci commit status on this head = success (2 commands); I did not re-run them 確認済み
A5 VM screenshots (vmux, crosspond-<n>): sidebar with a bot running a thread, before/after read Shared/crosspond-24/compare/bots-before-after-s.png; Shared/crosspond-24/baseline/{bot_row,sidebar}.luau are byte-identical to origin/main's copies (diff -q), so the "before" half really is the base 確認済み
A6 The scope decision (all chats with a bot id, or only the main conversation) is decided and recorded on issue #24 gh issue view 24 comments: main conversation only (sessions.bots[].conversation), with the reasoning (a spawned thread is what the child strip and the right-sidebar archive open) 確認済み

Mine, beyond the record (spot checks, 2 commands):

  • cargo test --test bot_rows → 7 passed / 0 failed (the two new tests included).
  • cargo test --bin zeron-zgx zeron_v2_is_in_step → 1 passed. This matters: the diff touches ui/screens/shell/sidebar.luau and ui/ds/bot_row.luau, and the shell sidebar is the default's (not v2's overlay file), while BotRow's props are only added to (a new optional subagents field), so v2's copy needs no change and .base.json need not be re-recorded. The staleness guard agrees.
  • Read Shared/crosspond-24/verification.md and scenario.sh: the record names the head SHA, the base SHA compared, the failure sets that match base (reload::a_reload_keeps_the_project_editor_open, pointer_cursor::the_sidebar_edge_shows_the_resize_cursor_and_a_row_the_hand), and the exact operations behind the before/after shots.

The count is not a second read: row.subagents = (c.running_subagents or 0) + (c.working_side_chats or 0) at sidebar.luau:496 is the same expression the activity row uses at sidebar.luau:666, both off the chat row the shell already has. SessionRow.subagents hides itself at n <= 0, so a bot with nothing running carries no empty pill (checked in the test: Umi's row has none).

反証 (three ways this could break)

  1. A person's chats vanish from the list. The filter is keyed on the bot's conversation id only (bot_chats[b.conversation]), never on a chat's bot id, so neither a person's chat nor a bot-spawned thread is touched. Grounds: bot_rows::a_bot_conversation_is_not_a_chat_of_the_activity_list asserts "Write the docs" is present while both bot conversations are absent; the screenshot shows the same four person chats in the same order and with the same corners before and after.
  2. A project disappears because its only listed chats were bot conversations. The diff also drops bot chats from listed[group], so an "Atlas" whose chats are all bot conversations is not counted as listed and would fall into the empty/unused bucket. That is the intended direction (a bot conversation with no session of its own makes no session row), and in the fixture Atlas still holds a1/a2/a3/z1 plus Kite's conversation, so the group stays. It is the same behaviour the person sees today for a project whose only chats are archived.
  3. The pill lands on top of the corner, or the row grows. The pill is placed between the state badge and corner(bot), exactly where SessionRow.Row puts it; the test asserts badge.x >= row.x && badge.x + badge.width <= row.x + row.width + 1, and after #22 the row is one line (SessionRow.SLOT), unchanged here. The screenshot shows the row's height and the ring's place identical before and after.

確認していないこと

  • zgx test ui (the Luau UI suite) was not run, by the implementer or by me; this environment has no zgx CLI. scripts/ci/test-zgx.sh ui covers it in CI. The two behaviours have headless coverage in apps/zgx/tests/bot_rows.rs against the same fixture.
  • I did not re-run the repo's two verify commands; I relied on the local-ci status for the identical head SHA.
  • An archived bot conversation: sessions.bots leaves archived bots out (by design, account/sessions.luau), so such a conversation would keep appearing on the sidebar's Archived shelf instead of being filtered. Same for a bot conversation that a person pinned by hand before this change. Both are narrow and a matter of taste; neither is in the issue's conditions.
  • I did not check zgx's own right sidebar/palette/route readers of now.chats; the issue scopes the removal to the sidebar's chat lists.

本文との食い違い

None material. Two small notes:

  • The PR body does not list cargo test --bin zeron-zgx zeron_v2_is_in_step among the commands. It passes (I ran it), and the body's v2 note ("needed no change, .base.json was not re-recorded") is correct.
  • "The two behaviours it would cover are covered by tests/bot_rows.rs on the same fixture" — accurate: those tests mount the real shell UI through the host, not a mock of the sidebar.

FOLLOWUP (not blocking)

  • ARCHITECTURE.md's "The bots' place in the sidebar" paragraph still describes only the state badge and the context ring. The pill and "a bot's conversation is not a chat of its own" live in ADR 0009's amendment only. Worth a sentence there so the spec's architecture section does not read as if the row's pill never arrived.
  • Optional: consider the Archived shelf as well if a bot's conversation archived directly should also be represented only by its bot — but that turns on how a bot is archived at all, which this PR does not change.

@crcrworks
crcrworks merged commit 823b43e into main Nov 29, 2026
1 check passed
@crcrworks
crcrworks deleted the agent/24-bot-row-threads branch November 29, 2026 09:16
@crcrworks crcrworks removed the agent/review レビュー中 label Nov 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sidebar: bot rows show the running-thread count; bot conversations leave the Activity section

1 participant