Skip to content

fix(thread): surface agent messages + plans, per-group spinner, trim noise#2729

Merged
adamleithp merged 1 commit into
mainfrom
fix/thread-surface-messages-plans-spinner
Jun 17, 2026
Merged

fix(thread): surface agent messages + plans, per-group spinner, trim noise#2729
adamleithp merged 1 commit into
mainfrom
fix/thread-surface-messages-plans-spinner

Conversation

@adamleithp

@adamleithp adamleithp commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

What

The conversation thread folded a turn's entire activity into one collapsible chip. That buried the agent's direct messages and plans, and the chip's running state was tied to the whole turn so finished work kept spinning.

  • Surface direct messagesagent_message_chunk items never fold; they render as their own chat row wherever they occur in a turn (not just trailing).
  • Surface plans — the switch_mode (ExitPlanMode) tool call never folds; renders via PlanApprovalView standalone.
  • Per-group spinner — chip spins on the group's own in-flight tool (summary.active), not turn-level turnComplete. A turn split across chips no longer keeps finished chips spinning. While running, the chip reads what happened · what's happening with a spinner.
  • Trim noise — hide an empty, done-streaming "Thinking" row.
  • Styling cleanup — tighter markdown margins, selected-fill on open tool rows, drop dead variants/classes.

Verified

Driven live against the running app over CDP:

  • Direct messages interleave between collapsed chips (Worked → "Checking." → 1 tool call → answer).
  • Running chip: ⠏ Ran 1 command · Sleep 15 then echo ok (spinner + both labels).
  • Per-group spinner fix confirmed after the regression report.

lint + typecheck clean.

🤖 Generated with Claude Code

@adamleithp adamleithp force-pushed the fix/thread-surface-messages-plans-spinner branch from 44bee79 to 7d98178 Compare June 17, 2026 10:53
@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit 96f888b.

@adamleithp adamleithp added the Stamphog This will request an autostamp by stamphog on small changes label Jun 17, 2026
@adamleithp adamleithp enabled auto-merge (squash) June 17, 2026 10:53
github-actions[bot]
github-actions Bot previously approved these changes Jun 17, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pure UI rendering fix in @posthog/ui — no business logic, data models, API contracts, or security surface touched. The core change (flushing agent messages and plans instead of peeling from buffer tail) is a sound simplification, well-documented, and display-only.

@adamleithp adamleithp force-pushed the fix/thread-surface-messages-plans-spinner branch from 7d98178 to f34dda7 Compare June 17, 2026 10:55
@github-actions github-actions Bot dismissed their stale review June 17, 2026 10:55

New commits pushed (delta classified non_linear_history) — stamphog approval dismissed; re-review running automatically.

@adamleithp adamleithp force-pushed the fix/thread-surface-messages-plans-spinner branch from f34dda7 to 2f2bcc0 Compare June 17, 2026 10:56
@greptile-apps

greptile-apps Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
packages/ui/src/features/sessions/components/new-thread/ToolCallGroupChip.tsx:40
The string `"Worked"` is the sentinel return value of `buildDoneLabel` when there are no countable actions. Comparing against it here creates silent coupling — if the default label ever changes in `conversationThreadConfig.ts`, the chip will always show both labels (or never show them) with no compiler/lint signal. The intent is better expressed as a field on `GroupSummary` that `summarize` computes once, close to the data.

```suggestion
  const hasDone = summary.hasCountableWork;
```

Reviews (1): Last reviewed commit: "fix(thread): surface agent messages + pl..." | Re-trigger Greptile

Comment thread packages/ui/src/features/sessions/components/new-thread/ToolCallGroupChip.tsx Outdated

@stamphog stamphog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The current-head Greptile bot flagged a valid unaddressed concern: the summary.doneLabel !== "Worked" string comparison in ToolCallGroupChip.tsx creates silent coupling to the sentinel value in buildDoneLabel. If that sentinel ever changes, the chip's label logic silently misbehaves with no compiler or lint signal. Per review policy, a bot comment with a valid concern that remains unaddressed on the current head warrants escalation.

@stamphog stamphog Bot removed the Stamphog This will request an autostamp by stamphog on small changes label Jun 17, 2026
…noise

Conversation thread folded a turn's entire activity into one collapsible
chip, which buried the agent's direct messages and plans, and the chip's
running state was tied to the whole turn.

- buildThreadGroups: agent_message_chunk and plan (switch_mode) tool calls
  never fold — they surface as their own chat rows wherever they occur in a
  turn, not just trailing.
- ToolCallGroupChip: spin on the group's own in-flight tool (summary.active),
  not turn-level turnComplete, so a turn split across chips doesn't keep
  finished chips spinning. While running, show "what happened · what's
  happening" with a spinner.
- ThoughtView: hide an empty, done-streaming "Thinking" row (pure noise).
- Markdown/tool-view styling cleanup: tighter margins, selected-fill on open
  tool rows, drop dead variants/classes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@adamleithp adamleithp force-pushed the fix/thread-surface-messages-plans-spinner branch from 2f2bcc0 to 96f888b Compare June 17, 2026 10:58

@stamphog stamphog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

An unresolved current-head inline comment flags a valid concern: summary.doneLabel !== "Worked" couples chip logic to a sentinel string in buildDoneLabel. If that sentinel changes, the label display silently misbehaves with no compiler or lint signal. The fix is straightforward — add a hasCountableActions boolean to GroupSummary — but it was not made in this diff.

@adamleithp adamleithp added the Stamphog This will request an autostamp by stamphog on small changes label Jun 17, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pure UI rendering fix in @posthog/ui — the bot's concern about sentinel string coupling was directly addressed by adding hasCountableWork as a typed boolean on GroupSummary, and the inline comment is resolved. No business logic, data models, API contracts, or security surfaces touched.

@adamleithp adamleithp merged commit ffb81fe into main Jun 17, 2026
26 checks passed
@adamleithp adamleithp deleted the fix/thread-surface-messages-plans-spinner branch June 17, 2026 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Stamphog This will request an autostamp by stamphog on small changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant