Repository navigation
Bot chat activity 2/5: A calm status line, Chat activity setting, recaps and Steer/Queue - #477
Conversation
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
Hermes Review BotConfidence: 5 Engine: SummarySlice B of the Bot chat activity stack replaces the previous Updates progress line with a single status line ( Confidence Score: 5/5Fully 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
FindingsNo findings. 📊 Sequence DiagramsequenceDiagram
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
Machine-Readable Findings[]
|
There was a problem hiding this comment.
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.
gpt-6.1-sol | 𝕏
| // set is lost on restart. | ||
| answers.set( | ||
| id, | ||
| requestId.startsWith("routine:") || requestId.startsWith(BOT_INTRO_REQUEST_PREFIX) || hiddenSubmissions.has(id), |
There was a problem hiding this comment.
[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)), |
There was a problem hiding this comment.
[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.
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-remotepasses, no fixture changes).What a person sees
Harness.abortSubmission. Remove shows a toast if the turn already started.Under the hood
renderer/shared/bot-activity.tsmaps tools to phases per spec §5.1. Unknown phases read asworking.kind,labeland a redacteddetailof at most 80 characters.ok | failed | blocked | stopped.activityis gated on therunningstate and keyed per run on its first input.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.role="status"region announces phases, throttled to one change every 2 s.Testing
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. Playwrightbots-starter+guided-setuppass, including a new Reduce Motion face test.Needs owner acceptance
Follow-ups (recorded in
.memory/bot-chat-activity.md)main: adding a description to a Bot that had none produces a save/reload revision mismatch. This predates this branch.useReducedMotionre-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:
429 Too Many Requestswhile pulling the base imagenode:22-bookworm. This is infrastructure, and main hit it too in run 38504083057.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-testsfailed the job, which is expected. The "Require selected Linux builds" gates failed downstream of this.AidenChatTests.testAnOwnStreamTakingOverALiveForeignRunShowsItsReplayOncefailed after 6.7 s, which matches the 5 swaitForConditionbudget. 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