feat(batch): live batch-status SSE in Living Docs#67
Merged
Conversation
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 Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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.
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 shippedstatus_maintenance_batchviaasyncio.to_thread(it's sync + does network I/O), emits onedata:frame per poll, and self-terminates on:BatchStateError→{"state":"none"}),{"state":"error"}),processing_status/ended_at.ATTUNE_GUI_BATCH_POLL_SECS(default 30).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.ATTUNE_GUI_BATCH_POLL_SECSdocumented.Tests / verification
test_batch.py) cover all SSE states (none / error / pending→terminal / ended_at / disconnect / poll cadence). Full sidecar suite green (one pre-existingversion=='dev'env failure, unrelated).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