Skip to content

feat(batch): live batch-status SSE in Living Docs#67

Merged
silversurfer562 merged 2 commits into
mainfrom
feat/batch-status-sse
Jun 14, 2026
Merged

feat(batch): live batch-status SSE in Living Docs#67
silversurfer562 merged 2 commits into
mainfrom
feat/batch-status-sse

Conversation

@silversurfer562

Copy link
Copy Markdown
Member

Implements specs/gui-batch-status-sse — an observe-only live batch-progress surface in the dashboard.

What

  • GET /api/batch/status/stream (routes/batch.py) — Server-Sent Events stream of the pending attune-author maintenance batch. Polls the shipped status_maintenance_batch via asyncio.to_thread (it's sync + does network I/O), emits one data: frame per poll, and self-terminates on:
    • no batch (BatchStateError{"state":"none"}),
    • unexpected error ({"state":"error"}),
    • terminal processing_status / ended_at.
  • Cadence via ATTUNE_GUI_BATCH_POLL_SECS (default 30).
  • Living Docs panel — an EventSource-driven "Batch progress" card (queued → in-progress n/N → complete), hidden when no batch is pending. Closes the stream on none/error/terminal to avoid browser auto-reconnect loops.
  • README + ATTUNE_GUI_BATCH_POLL_SECS documented.

Tests / verification

  • 12 unit tests (test_batch.py) cover all SSE states (none / error / pending→terminal / ended_at / disconnect / poll cadence). Full sidecar suite green (one pre-existing version=='dev' env failure, unrelated).
  • Verified live: GET /api/batch/status/stream → 200 OK, panel correctly hidden with no pending batch, zero console errors, clean stream close.

Observe-only — triggering a batch from the UI is a separate spec. Tasks 1–8 complete.

🤖 Generated with Claude Code

silversurfer562 and others added 2 commits June 14, 2026 18:16
Add GET /api/batch/status/stream — Server-Sent Events stream of the
pending attune-author maintenance batch, observe-only. Polls
status_maintenance_batch via asyncio.to_thread (sync + network I/O),
emits one data: frame per poll, and self-terminates on no-batch
(BatchStateError → "none"), unexpected error, or terminal status.
Cadence via ATTUNE_GUI_BATCH_POLL_SECS (default 30).

Implements specs/gui-batch-status-sse tasks 1-5,7. Frontend panel
(task 6) and docs (task 8) follow.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add an observe-only "Batch progress" panel to the Living Docs page,
driven by EventSource over GET /api/batch/status/stream. Renders
queued → in-progress (n/N) → complete with a progress bar; hides when
no batch is pending. Closes the stream on none/error/terminal frames to
suppress browser auto-reconnect loops.

README: document the panel and ATTUNE_GUI_BATCH_POLL_SECS.

Completes specs/gui-batch-status-sse tasks 6 + 8.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Jun 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.29630% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
sidecar/attune_gui/routes/batch.py 96.22% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@silversurfer562 silversurfer562 merged commit fdea8ce into main Jun 14, 2026
6 checks passed
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.

1 participant