Skip to content

FE-541: Rich chat UI with tool calls and reasoning rendering#15

Merged
lunelson merged 3 commits into
mainfrom
ln/fe-541-rich-chat-ui
Apr 2, 2026
Merged

FE-541: Rich chat UI with tool calls and reasoning rendering#15
lunelson merged 3 commits into
mainfrom
ln/fe-541-rich-chat-ui

Conversation

@lunelson
Copy link
Copy Markdown
Contributor

@lunelson lunelson commented Apr 1, 2026

feat: add tool-call lifecycle events to core, SSE adapter, and client

Extend DomainEvent with tool-call-start/delta/end variants, translate
SDK tool_use content blocks through SSE adapter as tool-call-streaming-start/
tool-call-delta/tool-call events, and render dynamic-tool parts in the
React client. Adds 10 new tests (3 core, 6 SSE adapter, 1 app integration).

Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com

chore: gitignore .claude/worktrees/

Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com

refactor: enrich tool-call DomainEvents with toolCallId and toolName

tool-call-delta now carries toolCallId (was missing — blocked concurrent
tool calls). tool-call-end now carries toolName (was lost — adapter emitted
empty string). Domain adapter uses real ids instead of synthetic ones.

Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com

@linear
Copy link
Copy Markdown

linear Bot commented Apr 1, 2026

FE-541 Rich chat UI: tool calls + reasoning rendering

Ask about this escape hatch. Separate useChat instance scoped to current question. Responses don't pollute main interview transcript or entity extraction.

Copy link
Copy Markdown
Contributor Author

lunelson commented Apr 1, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@lunelson lunelson changed the title feat: add tool-call lifecycle events to core, SSE adapter, and client FE-541: Rich chat UI with tool calls and reasoning rendering Apr 1, 2026
@lunelson lunelson marked this pull request as ready for review April 1, 2026 15:29
@augmentcode
Copy link
Copy Markdown

augmentcode Bot commented Apr 1, 2026

🤖 Augment PR Summary

Summary: This PR adds first-class tool-call streaming support across the server domain events, SSE adapter, and React client so the UI can render tool-call lifecycle state alongside reasoning/text.

Changes:

  • Extended DomainEvent with tool-call-start, tool-call-delta, and tool-call-end (including toolCallId and toolName).
  • Updated conductTurn() to detect tool_use content blocks and emit tool-call lifecycle domain events.
  • Enhanced the SSE translator to convert SDK tool_use/input_json_delta blocks into tool-call-streaming-start, tool-call-delta, and final tool-call events.
  • Added a domain-to-SSE adapter path for tool-call events to support the Express SSE route.
  • Rendered dynamic-tool parts in the React client with basic status labels.
  • Added new tests in core, SSE adapter, and an app-level integration test to validate tool-call event emission.

Technical Notes: Tool-call events now carry real IDs to support multiple tool calls and to avoid losing tool names/args through the adapter layers.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode Bot left a comment

Choose a reason for hiding this comment

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

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread src/server/core.ts
yield { type: 'text-delta', delta: delta.text };
} else if (delta.type === 'input_json_delta' && delta.partial_json) {
const toolBlock = toolUseBlocks.get(event.index!);
yield { type: 'tool-call-delta', toolCallId: toolBlock?.toolCallId ?? '', delta: delta.partial_json };
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

src/server/core.ts:116 — If toolUseBlocks.get(event.index!) returns undefined, this still yields a tool-call-delta with toolCallId: '', which can collide across calls and makes downstream correlation ambiguous. Consider not emitting a tool-call event unless there’s a registered tool block for that index.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

Comment thread src/server/sse-adapter.ts
}

case 'tool-call-delta': {
currentToolArgsJson += event.delta;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

src/server/sse-adapter.ts:198 — createDomainAdapter() appends every tool-call-delta into a single currentToolArgsJson buffer without checking/associating by event.toolCallId, so interleaved tool calls could produce a final tool-call event with mixed or incorrect args. Consider tracking args per toolCallId (or asserting only one active tool call) to keep concurrency-safe behavior consistent with the new IDs.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

@lunelson lunelson self-assigned this Apr 1, 2026
@lunelson lunelson force-pushed the ln/fe-541-rich-chat-ui branch from 5cd25b7 to edd3dc7 Compare April 1, 2026 15:58
Copy link
Copy Markdown
Contributor Author

lunelson commented Apr 2, 2026

Merge activity

  • Apr 2, 6:20 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Apr 2, 6:27 AM UTC: Graphite rebased this pull request as part of a merge.
  • Apr 2, 6:28 AM UTC: @lunelson merged this pull request with Graphite.

@lunelson lunelson changed the base branch from ln/fe-552-drizzle-core-extraction to graphite-base/15 April 2, 2026 06:25
@lunelson lunelson changed the base branch from graphite-base/15 to main April 2, 2026 06:26
lunelson and others added 3 commits April 2, 2026 06:27
Extend DomainEvent with tool-call-start/delta/end variants, translate
SDK tool_use content blocks through SSE adapter as tool-call-streaming-start/
tool-call-delta/tool-call events, and render dynamic-tool parts in the
React client. Adds 10 new tests (3 core, 6 SSE adapter, 1 app integration).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
tool-call-delta now carries toolCallId (was missing — blocked concurrent
tool calls). tool-call-end now carries toolName (was lost — adapter emitted
empty string). Domain adapter uses real ids instead of synthetic ones.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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