One turn, two stages
Today an assistant turn is a flat stream: thinking card → tool cards → answer, all stacked
inline with equal visual weight. The proposal wraps the execution history in a
.p2s-stage1 container with a worklog bar as its header, and marks the
final answer as .p2s-answer. The same DOM renders three ways:
- Live — worklog shows Working… 0:42 · 2 tools with a pulsing dot; history is fully visible.
- Settled — worklog collapses to a single line (Worked 1:42 · 4 tools · 2 thinking); final answer sits below as the calm conclusion.
- Settled + opened — user clicks the worklog to re-expand the history for audit.
Side-by-side comparison
Same turn, same tool calls, same answer. Left is what #587 ships today. Right is the proposal: execution history collapses to a one-line summary; the final answer stands alone with a small Answer kicker.
Working timer + live execution history
The worklog bar at the top is the anchor for the whole active run: pulsing dot, elapsed
timer that ticks every second, and live counts that increment as tool cards resolve.
Thinking cards and tool cards render inside .p2s-stage1-body exactly as today.
A Round N separator is inserted when the agent starts a new reasoning/tool cycle.
Approvals stay in Stage 1; Clarify moves to the transition
Per the issue: approvals are part of doing the work (they gate a single tool),
clarifications stabilise the answer path (they precede the conclusion). The
proposal keeps .approval-card inline among tool cards, and places
.clarify-card at the Stage 1 → Stage 2 seam, above the final answer.
What the "Answer" stage looks like on its own
Three small choices distinguish Stage 2 from a regular text block: (1) a thin horizontal divider above it, (2) a tiny gold Answer kicker aligned to the text rail, (3) a slightly taller line-height. No heavy borders, no boxed treatment — the emphasis comes from what is missing around it, not ornament.
What this proposal commits to
- Stage 1 on settle → partial collapse to a single worklog bar with counts. Click to re-expand. No "nuke to black box", no "keep everything open forever".
- Final answer placement → sits beneath Stage 1, not replacing it. Visual distinction comes from the divider + kicker + spacing, not from a two-panel layout.
- Clarify placement → at the Stage 1 → Stage 2 seam. Approvals stay inline with tools.
- Timer → lives on Stage 1 only. Stops when the agent emits the first Stage 2 token; final label becomes "Worked for N:NN".
- Signal for "answer has started" → first assistant
text delta after all tool calls have resolved and no new
tool_useis pending in the current round. Already present in the SSE stream per maintainer comment.
What changes vs index.html
New wrappers
.p2s-stage1[is-live|is-settled][is-open]— wraps the execution history inside an.assistant-segment..p2s-worklog— header of Stage 1. Pulsing dot + label + counts + caret. Clickable when settled..p2s-stage1-body— holds.thinking-card+.tool-card-row+.p2s-round-sep. Animated viamax-height..p2s-round-sep— inline horizontal separator between tool/reasoning rounds..p2s-transition— thin gradient divider between Stage 1 and Stage 2..p2s-answer— wraps the final.msg-body+.msg-foot..p2s-answer-kicker— small gold Answer label..p2s-clarify-slot— placement slot for.clarify-cardat the Stage 1/2 seam.
Unchanged
.thinking-card,.tool-card,.approval-card,.clarify-card,.msg-body,.msg-foot— all existing app CSS and existing markup..assistant-turn-blocksand.assistant-segmentremain the top-level wrappers.- Tool cards still live as
.tool-card-rowsiblings — now nested inside.p2s-stage1-bodyrather than as direct children of.messages-inner.
Implementation notes
- Renderer in
static/messages.jswraps an assistant turn's non-final blocks in.p2s-stage1-bodyand appends the.p2s-worklogheader once; togglesis-live/is-settledbased ondata-live-assistant. static/boot.jsSSE handler ticks the timer whileis-live, increments counts on eachtool_use, and flips the class when the first Stage 2 delta arrives.- Persistence: no schema change needed — the worklog summary can be derived on reload from the existing persisted tool-call list + thinking rounds.