Skip to content

Bot chat activity 2/5: A calm status line, Chat activity setting, recaps and Steer/Queue - #477

Merged
sambitcreate merged 27 commits into
mainfrom
claude/bot-chat-activity-b-status-line
Oct 14, 2026
Merged

sambitcreate merged 27 commits into
mainfrom
claude/bot-chat-activity-b-status-line

Conversation

@sambitcreate

@sambitcreate sambitcreate commented Oct 14, 2026 •

Copy link
Copy Markdown
Owner

Second PR of the Bot chat activity stack ("B · status line and Chat activity", plan). It is stacked on #475 (slice A), and #476 (C1) is stacked on this. Desktop only: the Remote wire, iOS and Android are unchanged (test:aiden-remote passes, no fixture changes).

What a person sees

  • Status line. While a Bot works, one calm line shows an activity mark and a word, such as Thinking, Reading, Searching the web, Editing files, Using Notion or Waiting for you.
    • Hovering shows the current step. After 20 s the line adds elapsed time and Stop, and after 2 min it adds "Still going. I'll message you when it's done." That note is hidden while waiting on you.
    • The line hides only while reply words stream, not during a tool that follows narration.
  • Chat activity (Advanced → Chat activity). Choose Quiet (default), Summary or Detailed, and Follows the work (default) or Always "Thinking". Each choice plays a live preview built from the real components.
    • Choices save as you pick them, and a failed save reverts with a toast. Under Reduce Motion each preview holds a still frame specific to its level, with a Play button.
  • Recaps.
    • Summary adds a folded "Worked for 18s · read 1 file, searched the web" recap.
    • Detailed opens the step list while the Bot works and folds it when the reply lands.
    • Failures show in red ("Couldn't …", "N issues") and refusals in amber ("Blocked: …"). Steps cut short by Stop or a restart show neutrally as "Stopped: …".
  • "You stopped this reply." This shows after a person's Stop, including one during a tool run. It never shows on a reply that resumed and finished.
  • Progress narration is now a normal bubble; the old Updates line is removed.
  • Steer and Queue. A message queued while the Bot works shows faded with "Queued" and Remove, which withdraws it through Harness.abortSubmission. Remove shows a toast if the turn already started.
  • Faces. A Bot's face glances while it works, in the list and the chat header. Under Reduce Motion it holds a still look-aside pose.

Under the hood

  • Shared classifier: renderer/shared/bot-activity.ts maps tools to phases per spec §5.1. Unknown phases read as working.
  • Projection (main):
    • Tool calls carry kind, label and a redacted detail of at most 80 characters.
    • A command's text is never shown, only the model's description.
    • Results are ok | failed | blocked | stopped.
    • Live activity is gated on the running state and keyed per run on its first input.
    • Stop and Resume flags are scoped to the run, and Resume is marked inside the service's per-Bot serialize.
    • Queued items are only the person's own messages, classified by durable request id and hidden when classification fails.
  • BotDefinition.chatActivity: absent means Quiet / Follows. An identity edit never resets it, and a malformed value reads as absent without losing the Bot. It is stored last so the revision stays stable across save and reload.
  • Screen readers: one always-mounted role="status" region announces phases, throttled to one change every 2 s.

Testing

  • Desktop suites: tsc, lint, test:bots (702 + 10 + 5), test:bot-runtime (178), test:aiden-remote (778 tests, 1 skipped, plus 114, 7 and 21), test:settings-design (59), test:ci-policy (57), npm test. Playwright bots-starter + guided-setup pass, including a new Reduce Motion face test.
  • Harness and Stop tests: real-harness tests cover a Stop during a tool, a queued routine behind a tool-using reply, and a kill, reopen and Resume that finishes cleanly.
  • Review: every task had a spec + quality review, often several fix rounds. A whole-branch review on the most capable model, its fix wave and one targeted follow-up are all verified.
  • Visual pass: light and dark, using a harness with the real components (status phases, elapsed and Stop, still-going vs waiting, hover peek, recaps, faces).

Needs owner acceptance

  • VoiceOver pass: confirm the always-mounted status region announces the first phase and later changes, and check for duplicate speech in browse mode.
  • Manual look in the running app at the Chat activity page previews and the commit transition from streaming bubble to final reply.

Follow-ups (recorded in .memory/bot-chat-activity.md)

  • Phone Stop on the Mac: a Stop from the phone doesn't show "Stopping" on the Mac (slice D).
  • Revision mismatch on main: adding a description to a Bot that had none produces a save/reload revision mismatch. This predates this branch.
  • Deferred minors: recap memoisation, useReducedMotion re-subscribing every render, retry backoff on a permanent inspect failure, and others listed in memory.

CI notes

Run 38541655583 attempt 1 failed for reasons not caused by this PR. None of the failing specs are touched by it:

  • Headless CLI on Linux: an ECR 429 Too Many Requests while pulling the base image node:22-bookworm. This is infrastructure, and main hit it too in run 38504083057.
  • Flaky Electron E2E: tests/e2e/settings-model-picker.spec.ts:104 ("every Settings destination renders…"). The first attempt found 0 [cmdk-item] within 10 s, and it passed on retry Use catalog-driven runtime model limits #1. --fail-on-flaky-tests failed the job, which is expected. The "Require selected Linux builds" gates failed downstream of this.
  • Flaky iOS XCTest: AidenChatTests.testAnOwnStreamTakingOverALiveForeignRunShowsItsReplayOnce failed after 6.7 s, which matches the 5 s waitForCondition budget. It takes about 0.6 s on main and in sibling runs, and the test code is unchanged.

I reran the whole run once. No timeouts were raised and no retries were added.

🤖 Generated with Claude Code

sambitcreate and others added 27 commits October 14, 2026 01:56
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d status

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…etail

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…esume

Also replaces the quadratic whitespace cut in bot step details with a linear scan.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ed line

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A steer that lands while a tool is still running now joins the running turn, so the tool result no longer reads as failed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…y activity and queued

The Bot live-subscribe mocks in the Playwright specs predated the snapshot's
activity and queued fields, so the chat pane crashed on queued.length.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The harness writes only the round's stopped tool results when Stop lands
during tools, with no aborted reply, so the rows now mark the turn stopped
from a stopped result too. A real-harness test stops a slow tool.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ting

The status line's announcements move to BotStatusAnnouncer, a live region
the chat keeps mounted (empty first, cleared while words stream) so the
first phase and the first after each streaming stretch are announced. The
still-going note hides while the line reads Waiting or Stopping. Snapshots
without queued no longer throw.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…elector-6a5d3a' into claude/bot-chat-activity-b-status-line
@very-hermes-bot

Copy link
Copy Markdown
Collaborator

Hermes Review Bot

Confidence: 5

Engine: agy/gemini-3.8-flash-high
Review mode: full
Head: f6fe667b7dbed220ae3074b2b14bfe4a16c8a45a
Generated: 2026-10-14T09:25:52+00:00
Reviews: 1

Summary

Slice B of the Bot chat activity stack replaces the previous Updates progress line with a single status line (BotStatusLine) during active Bot work, introducing per-Bot chat activity configuration (Quiet, Summary, Detailed) and recaps for tool usage. Live activity state is derived in live-projection.ts from Pi Durable harness execution and streamed alongside queued message projections with support for withdrawal (bots:withdraw). In the renderer, tool steps are summarized or expanded depending on the chosen activity level, progress narration becomes ordinary bubbles, and avatar faces glance during execution while honoring reduced-motion preferences. A maintainer should manually verify the VoiceOver announcements on physical macOS hardware to ensure that the persistent role="status" live region announces phase transitions cleanly without duplicate utterances during browse mode.

Confidence Score: 5/5

Fully traced across Electron main services, IPC handlers, live projection subscriptions, store persistence, and renderer components with verification against the test suites and specification.

📁 Important Files Changed

Findings

No findings.

📊 Sequence Diagram
sequenceDiagram
    autonumber
    actor User
    participant Pane as BotChatPane
    participant IPC as Electron IPC
    participant Service as BotSessionService
    participant Projection as BotLiveProjection
    participant Harness as Pi Durable Harness

    Note over User,Harness: Bot is currently executing a running turn
    User->>Pane: Enters follow-up message
    Pane->>IPC: bots:send(botId, input, followUp)
    IPC->>Service: send(botId, input)
    Service->>Harness: submit input to inbox
    Harness-->>Projection: conversation watch frame (docs["pi.inbox"])
    Projection->>Service: quietInputs(botId, ids)
    Service-->>Projection: classified as person's message
    Projection-->>Pane: emit({ type: "queued", queued })
    Pane-->>User: Displays faded bubble with "Queued" and Remove button

    User->>Pane: Clicks Remove
    Pane->>IPC: bots:withdraw({ botId, submissionId })
    IPC->>Service: withdraw(botId, submissionId)
    Service->>Harness: abortSubmission(submissionId)
    Harness-->>Service: "aborted"
    Service-->>IPC: "withdrawn"
    Harness-->>Projection: watch frame (item removed from inbox)
    Projection-->>Pane: emit({ type: "queued", queued: [] })
    Pane-->>User: Queued bubble removed from chat
Loading

Machine-Readable Findings

[]

Last reviewed commit: f6fe667b7dbe
Reviews (1) · Comment /hermes review to trigger a new review · /hermes review full for full re-review

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Important

Two reproducible behavior issues need fixing: cross-Bot submission-ID collisions can hide queued messages and their Remove action, and finished recaps omit the final reply's generation time.

Reviewed changes Across the full stacked-branch diff, I reviewed the desktop activity feature and its shared runtime, persistence, and Remote/native-client boundaries.

  • Activity projection: Shared phase classification, redacted tool details, result statuses, and run-scoped Stop/Resume activity.
  • Chat presentation: Status announcements, elapsed/Stop controls, Summary/Detailed recaps, ordinary narration bubbles, and stopped-reply handling.
  • Steer and Queue: Person-input classification, queued bubbles, and withdrawal through Pi Durable.
  • Per-Bot settings: Persisted Chat activity choices, Advanced navigation, serialized saves, and reduced-motion previews.
  • Working avatars: Animated and reduced-motion face states, offscreen pausing, and focused coverage/registration updates.

Verification passed: TypeScript, 182 focused desktop/Remote tests, and 46 Android contract/controller tests. Both findings were independently reproduced against real harnesses; native iOS XCTest and macOS Electron/VoiceOver acceptance were not run on this Linux runner.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using gpt-6.1-sol | 𝕏

// set is lost on restart.
answers.set(
id,
requestId.startsWith("routine:") || requestId.startsWith(BOT_INTRO_REQUEST_PREFIX) || hiddenSubmissions.has(id),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[P2] Scope hidden submission IDs to their Bot. hiddenSubmissions is shared across all Bots, but each Bot's SQLite session has its own numeric ID namespace. I reproduced Bot A's hidden intro and Bot B's queued person message both receiving ID 10; this check hides B's message, including its Remove action, until it starts running.

Technical details
# Cross-Bot queue classification

## Affected sites
- `main/services/bot-runtime/bot-session-service.ts:302` creates one `Set<string>` for the whole runtime.
- `main/services/bot-runtime/bot-session-service.ts:491` records the hidden input's ID without its Bot identity.
- `main/services/bot-runtime/bot-session-service.ts:453` applies that ID to another Bot's inspected submissions.

## Reproduction
Create a normal hidden intro on Bot A (submission 10). Send Bot B's first person input (submission 8), hold its memory-section read during generation preparation, and send a follow-up before preparation completes. B's queued submission also gets 10, despite having a person-authored request ID. `quietInputs(B, ["10"])` returns true and the projected queued list is empty. Production prompt preparation awaits `memory.snapshot`, so this is a reachable timing window; without the held read, generation consumes another ID and the same probe can miss it.

Each Bot opens a separate SQLite file in `harness-host.ts:194-209`; Pi allocates IDs within that storage, not across the profile. The SDK's busy-input admission creates the queued submission directly: https://github.com/earendil-works/pi/blob/v1.0.3/packages/durable/src/harness/submissions.ts

## Required outcome
A hidden submission on one Bot must never classify another Bot's person input as quiet.

## Suggested approach
Scope the hidden set by Bot, or remove the redundant process-local set for the current durable `intro:` sender. Extend the real-harness queue coverage with two Bots and delayed prompt preparation.

kind: "recap",
id: `${turn.id}:recap`,
steps: live ? steps : steps.map((step) => (step.status === "running" ? { ...step, status: unfinished } : step)),
durationMs: Math.max(0, (turn.lastAt ?? 0) - (turn.startAt ?? turn.lastAt ?? 0)),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[P2] Measure recap duration through reply completion. lastAt ends at the final assistant message's creation timestamp, which Pi sets before requesting and streaming that answer, not when it finishes. A real tool-using reply that took 6.4 seconds produced durationMs: 110 here and displayed "Worked for 1s", omitting almost all of the final generation.

Technical details
# Finished recap omits the final generation

## Affected sites
- `renderer/main/bots/bot-transcript-rows.ts:118-120` updates `lastAt` from entry `at`.
- `renderer/main/bots/bot-transcript-rows.ts:88` treats that value as the turn's completion time.
- `main/services/bot-runtime/live-projection.ts:341` projects the assistant's provider `message.timestamp` into `at`.

Pi AI initializes `timestamp: Date.now()` before opening the provider stream. Pi Durable awaits the stream and persists that same message without restamping it. This is confirmed in the installed packages and upstream sources:
- https://github.com/earendil-works/pi/blob/d78dc83d633229d12f8b79631384c4c2717c399f/packages/ai/src/api/openai-completions.ts
- https://github.com/earendil-works/pi/blob/d78dc83d633229d12f8b79631384c4c2717c399f/packages/durable/src/harness/generation.ts

A real faux-harness `read_file` followed by a slowly streamed final answer took 6402ms from send to settlement, but its recap duration was 110ms. The existing duration fixtures assign final-message timestamps as though they were completion times, so they do not exercise this mismatch.

## Required outcome
Finished recaps must derive elapsed work from a real completion/settlement timestamp, including the final request and stream, with stable results after reload. Preserve the meaning of message creation timestamps rather than silently redefining them.

## Suggested approach
Use persisted completion timing and extend the existing real-harness projection coverage with a slow final generation and an independent elapsed-time oracle.

Base automatically changed from claude/bot-creation-flow-model-selector-6a5d3a to main October 14, 2026 22:22
@sambitcreate
sambitcreate merged commit b754983 into main Oct 14, 2026
45 of 51 checks passed
@sambitcreate
sambitcreate deleted the claude/bot-chat-activity-b-status-line branch October 14, 2026 22:23
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.

2 participants