Skip to content

Stop the Agents panel re-querying every thread's messages on each stream event - #49

Merged
currentbits merged 3 commits into
mainfrom
coder/agents-panel-re-queries-all-threads-mess-0e30c6
Aug 15, 2026
Merged

currentbits merged 3 commits into
mainfrom
coder/agents-panel-re-queries-all-threads-mess-0e30c6

Conversation

@currentbits

Copy link
Copy Markdown
Owner

What

The Agents panel team view refetched threads:summaries whenever the threads array changed identity. useCoder rebuilds that array on every thread:updated, and services.threadSummaries scans messages for every thread in the store — so during an orchestration the panel fired that IPC many times per second.

The effect now depends on a cheap id:status key derived from threads, so identity-only pushes (token deltas, updatedAt bumps) trigger nothing. Because the worker rows show a live lastActivity line, a 2s poll keeps that fresh — but only while some thread is actually working, so an idle panel makes zero calls.

Why not a debounce

A trailing debounce would keep resetting for as long as the stream keeps pushing, which is exactly when the activity line matters, so it would freeze mid-run. The key + bounded poll caps the rate without losing freshness.

Verification

  • test/teamView.test.tsx gains a case that counts fetches: two identity-only pushes leave the count at 1, a status flip takes it to 2.
  • Full renderer suite: 719 pass, 0 fail.
  • tsc --noEmit clean.

Fixes #29

  • PR created by the Claude Code agent

Willem and others added 3 commits August 15, 2026 12:59
… Store: every stream event rewrites the entire 15 MB store sy
useCoder rebuilds the threads array on every thread:updated, so the Agents
panel re-ran threads:summaries — which walks every thread's messages — many
times per second during an orchestration. Depend on a cheap ids+statuses
key instead, and keep lastActivity live with a 2s poll while any thread is
working.

Fixes #29

Co-Authored-By: Claude Opus 5 <[email protected]>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@currentbits
currentbits merged commit ed0015f into main Aug 15, 2026
1 check failed
@currentbits
currentbits deleted the coder/agents-panel-re-queries-all-threads-mess-0e30c6 branch October 3, 2026 16:07
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.

Agents panel re-queries all threads' messages on every stream push

1 participant