Skip to content

feat: complete the feedback loop — session thread, piggyback delivery, watch guidance#3

Merged
benvinegar merged 2 commits into
mainfrom
feat/viewer-session-thread
Jun 11, 2026
Merged

feat: complete the feedback loop — session thread, piggyback delivery, watch guidance#3
benvinegar merged 2 commits into
mainfrom
feat/viewer-session-thread

Conversation

@benvinegar

@benvinegar benvinegar commented Jun 11, 2026

Copy link
Copy Markdown
Member

Started as the session-thread fix; grown (per discussion) into the full feedback-delivery story. Three commits, three layers:

1. Session thread in the viewer (0ebe057)

Comments not attached to a snippet (sideshow comment without --snippet, or POST /api/comments with only a session) were stored and delivered to agents but never rendered in the viewer — the agent believed it replied; the user saw silence. The reverse was impossible too: no UI existed for the user to write a snippet-less comment.

A session thread now sits at the bottom of each session's stream: renders snippet-less comments live over SSE, and adds a "Message the agent…" composer. New snippet cards insert above it. Verified live in the browser; e2e on Chromium + WebKit.

2. Piggyback feedback delivery (7ade106)

Agents previously heard feedback only while blocked on the long-poll — so they either waited needlessly or missed comments until the next checkpoint.

Now every agent write (publish, update, reply) may carry a userFeedback array: comments the user left since the agent's last call. Mechanics:

  • Per-session agentSeq cursor (both stores). SqlStore adds the column via a pragma_table_info probe so pre-existing Durable Object boards migrate in place.
  • Delivered once: piggyback advances the cursor, and a consumed author=user wait advances it too (no re-delivery in either direction). The viewer's unfiltered reads never touch the cursor.
  • The user's own POST /api/comments never carries feedback; only agent-authored writes do.
  • MCP (both HTTP and stdio) tool descriptions + instructions teach agents to treat userFeedback as messages from the user; the stdio server passes the field through untouched.

3. Background watch guidance (docs, same commit)

For the stretches where the agent isn't touching sideshow at all: the skill, /setup block, and design guide now teach arming sideshow wait --timeout 600 as a background process — it exits the moment the user comments, which surfaces the output through the harness's background-task notifications; handle and re-arm. (Proven live in a Claude Code session: comment typed in browser → background long-poll exited → agent woke and replied, no polling.) Includes the arm-on-the-right-session caveat learned the hard way.

Together: piggyback covers actively-publishing agents, background watch covers quiet stretches, blocking wait remains for explicit checkpoints.

Tests

  • Store contract: agentSeq defaults, monotonic advance, unknown-session no-op; JsonFileStore reload persistence (including pre-agentSeq data files).
  • API: piggyback on update/reply, delivered-once, wait-consumes, viewer reads don't consume, MCP result carries the field.
  • e2e (Chromium + WebKit): session thread renders agent comments, composer round-trips, cards stay above the thread.
  • Full gate green: 46 unit/API tests, 10 e2e, typecheck, lint, format.
  • Live-verified against a 0.2.0-era data file (cursor migration) and in a real browser session.

🤖 Generated with Claude Code

benvinegar and others added 2 commits June 11, 2026 12:29
Comments not attached to a snippet (sideshow comment without --snippet,
or POST /api/comments with only a session) were stored and delivered to
agents but never rendered anywhere in the viewer — the agent believed it
had replied while the user saw nothing. Found while dogfooding the MCP
flow end to end.

A session thread now sits at the bottom of each session's stream: it
renders snippet-less comments live over SSE and adds a composer so the
user can message the agent without picking a snippet (the long-poll
already delivers those to agents). New snippet cards insert above the
thread; existing e2e selectors scoped to exclude it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Agents previously heard feedback only while blocked on the long-poll. A
per-session delivered-to-agent cursor (agentSeq, both stores; SQLite
column added via pragma probe for pre-existing boards) now lets every
publish/update/agent-reply response carry a userFeedback array with
comments the user left since the agent's last call — delivered once. An
author=user wait also advances the cursor so consumed feedback is not
re-delivered. MCP tool descriptions and instructions teach the field;
the stdio server passes it through untouched.

Docs now describe all three delivery paths (piggyback, blocking wait,
background watch): the skill and /setup teach arming `sideshow wait` as
a background process and re-arming on exit instead of polling.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@benvinegar benvinegar changed the title feat(viewer): render session-level comments in a session thread feat: complete the feedback loop — session thread, piggyback delivery, watch guidance Jun 11, 2026
@benvinegar benvinegar merged commit c6be5fb into main Jun 11, 2026
4 checks passed
@benvinegar benvinegar deleted the feat/viewer-session-thread branch June 11, 2026 17:18
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.

1 participant