fix(web): throttle useAgent re-renders (fixes UI freeze) + tool-call cards#363
Open
blove wants to merge 2 commits into
Open
fix(web): throttle useAgent re-renders (fixes UI freeze) + tool-call cards#363blove wants to merge 2 commits into
blove wants to merge 2 commits into
Conversation
Co-Authored-By: Claude Opus 4.8 <[email protected]>
The research UI froze during a full run: useAgent re-renders are UNTHROTTLED by
default (CopilotKit's documented default), so every panel and the sidebar
transcript re-rendered on every streamed token — hundreds per run — pegging the
renderer. Set defaultThrottleMs={100} on <CopilotKit> in both demos.
Also adds a wildcard tool-call card (useRenderTool name:'*') to the research UI,
unwrapping Dawn's JSON-string args and the serialized LangChain ToolMessage so
cards show the real argument and output instead of double-encoded internals.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
blove
enabled auto-merge (squash)
July 16, 2026 21:43
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bug (found while adding tool cards)
A full research run froze the web UI — the renderer became unresponsive and never recovered. Root cause, from CopilotKit's own types:
Every
useAgent()consumer —PlanPanel,SubagentActivity,MemoryCandidates, plus theCopilotSidebartranscript — re-rendered on every streamed token. A full research run streams hundreds of events (coordinator tokens + ~200 subagent events), so the main thread got pegged.This is a pre-existing bug in the merged research web (#345), not caused by the cards. Fix:
defaultThrottleMs={100}on<CopilotKit>(~10 re-renders/sec, still live-feeling). Applied to both demos — the chat UI has the identical latent issue.Tool-call cards (the original feature)
A wildcard
useRenderTool({ name: "*" })card in the research UI showing each tool's name, status, argument, and output. It unwraps two layers of noise:input→ cards showed{"input":"{\"path\":\"…\"}"}. Now:corpus/retrieval-augmented-generation.md.ToolMessage→ cards dumped{"lc":1,"type":"constructor",…}. Now: the actual content.Test plan
Verified live in Chrome against a real model (research demo, full run):
researchersubagent dispatches streamed, cards rendered cleanly (recall→(no memories found),searchCorpus→RAG,readDoc→corpus/retrieval-augmented-generation.md+ real content).typecheck+buildgreen for@dawn-example/research-weband@dawn-example/chat-web.🤖 Generated with Claude Code