Home

mweinbach / agent-coworker

publicmweinbach/agent-coworker
Overview Code History Branches Pull requestsIssuesInsights
main
HomeOverview Code PRsIssues

fix: persist strict-mode SLO failure before aborting and guard SSE enqueue after stream closure

8 months ago

c14b375
Authored
mweinbach2/12/2026, 1:06:26 AM
Defer the strict-mode SLO throw until after run_meta.json and
artifacts_index.json are written so downstream readers (readRunSummary,
portal) see the failure. Record the error in both strict_slo_failure.txt
and the run_meta error field.

Guard all controller.enqueue() calls in the SSE runs stream against the
closed flag and wrap in try/catch to prevent unhandled rejections when
the client disconnects during an async snapshot fetch.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Parent9c1ff3b

2 files changed
  • apps/portal/app/api/stream/runs/route.ts+14−4
  • scripts/run_raw_agent_loops.ts+8−1