open-swe/agent/dashboard
Johannes du Plessis 72252e48c9
fix: stream agent tokens to the Agents UI (#1329)
* fix(dashboard): stream agent tokens to the Agents UI

The dashboard SSE endpoint was serializing the SDK's `StreamPart`
namedtuple via `str(part)`, so every event arrived at the browser
with `event = "StreamPart(event='values', data=..., id=None)"`. The
frontend's `event.startsWith("messages")` branch never fired and
every event fell through to a query refetch — which is why tool
calls appeared to stream (state refetch) but assistant text did not.

Also opt the run into `messages-tuple` stream mode so the server
actually buffers per-token `AIMessageChunk` events, and forward
`Last-Event-ID` so reconnects resume the in-flight run instead of
restarting from `seq=0`.

* fix(dashboard): drop unsupported stream_mode arg from join_stream

threads.join_stream's stream_mode is a ThreadStreamMode literal
(run_modes/lifecycle/state_update); passing run-level modes is
invalid. The default 'run_modes' already replays the modes the
run was created with, which we set correctly on runs.create.

---------

Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
2026-05-22 16:02:43 -07:00
..
__init__.py feat: open-swe dashboard for per-user profile config (#1302) 2026-05-15 11:23:53 -07:00
admin.py feat: open-swe dashboard for per-user profile config (#1302) 2026-05-15 11:23:53 -07:00
agent_overrides.py feat: restructure Open SWE Review tab + wire create_prs (#1319) 2026-05-21 09:17:07 -07:00
enabled_repos.py feat: restructure Open SWE Review tab + wire create_prs (#1319) 2026-05-21 09:17:07 -07:00
message_adapter.py feat: add Agents chat UI for cloud threads (#1323) 2026-05-22 18:15:59 +00:00
oauth.py fix: review style prompts UX, stale runs, and OAuth refresh (#1321) 2026-05-21 17:44:04 +00:00
options.py feat: restructure Open SWE Review tab + wire create_prs (#1319) 2026-05-21 09:17:07 -07:00
profiles.py feat: auto-review PRs on opened / ready-for-review (#1325) 2026-05-22 13:36:14 -07:00
review_style_jobs.py fix: review style prompts UX, stale runs, and OAuth refresh (#1321) 2026-05-21 17:44:04 +00:00
review_styles.py fix: review style prompts UX, stale runs, and OAuth refresh (#1321) 2026-05-21 17:44:04 +00:00
routes.py fix: stream agent tokens to the Agents UI (#1329) 2026-05-22 16:02:43 -07:00
team_settings.py feat: restructure Open SWE Review tab + wire create_prs (#1319) 2026-05-21 09:17:07 -07:00
thread_api.py fix: stream agent tokens to the Agents UI (#1329) 2026-05-22 16:02:43 -07:00