Repository navigation
Conversation
A tab streamed only runs it started or found active on load, so a build
wake-up, a Telegram message or a schedule run never reached a tab that already
had the thread open; the reply showed only after a reload.
The run manager publishes {thread, run, status} on admission and every status
change to an in-process hub; GET /api/threads/activity streams those (SSE,
viewer's own runs and threads only, heartbeat, no content, no replay). The
workspace mounts one subscriber per visible tab that invalidates the thread's
runs list (so the existing rejoin streams the reply), its history when the run
ends, and the sidebar. Hidden tabs close their stream and resync when shown;
errors back off to 5 min.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem
A tab streams only the runs it starts, or one it finds active when it loads. A run started anywhere else (a build wake-up from the Argus host, a Telegram message, a scheduled playbook) never reached a tab that already had the thread open: the reply appeared only after a reload. The sidebar missed new threads and titles the same way.
Change (patch bytedance#103)
RunManagerpublishes{thread_id, run_id, status, user_id, updated_at}on admission (create_or_reject) and every status change (set_status) to an in-process hub (runtime/runs/activity.py). One gateway worker per stack sees every run. Publishing never blocks or raises; a subscriber 256 events behind gets oneresync.GET /api/threads/activity(routers/thread_activity.py, registered before the/{thread_id}routes): SSE, filtered to runs stamped with the viewer's id or on threads they own, heartbeat every 25 s (under nginx's 600 s timeout), no content, no replay.ThreadActivityBridgein the workspace: a run event invalidates["thread", id](the runs list, so the existingactiveRunIdrejoin joins and streams the reply), a terminal one the thread's history too, plus a debounced sidebar refresh. Hidden tabs close their stream and resync when shown; errors back off 2 s to 5 min.Load
One idle SSE connection per visible workspace tab; per run, ~3 tiny events and a few small refetches for the tabs of that user. No polling.
Tests
backend/tests/test_thread_activity.py(6),frontend/tests/unit/core/threads/activity.dom.test.tsx(4). Existing run manager / runs API / features (147) and frontend threads+app (33 files) suites green; tsc, eslint, prettier, ruff clean.Rollout
Canary on atlas-nicholas only, with its own image tags (not the shared
:latest), before any pin bump.🤖 Generated with Claude Code