feat: live streaming for active runs (per-iteration feed + live web viewer)#25
Merged
Conversation
…iewer)
Two parts so active runs can be watched in real time instead of waiting on
checkpoints (which only land every checkpoint_interval):
(b) Per-iteration progress feed. The process controller appends one JSON line
per completed iteration to <output>/progress.jsonl
{iter, score, best, program_id, model, ts}, wrapped so telemetry can never
break the evolution loop. explore.read_progress / progress_trajectory read it,
and run_state now prefers it for the live iteration / best / curve (so the
already-live `kai monitor` and the viewer overview stop lagging to checkpoints).
(a) Live web viewer. The run dashboard shows a pulsing "● live" badge while a
run is active (run_state.is_active), draws the trajectory from the per-iteration
feed, and polls a new /setup/{label}/run/{idx}/live.json every 3s to update the
chart + headline stats in place (no full reload, no chart logic duplicated in
JS - the endpoint re-renders svg.trajectory). Falls back cleanly to checkpoint
steps for older runs with no feed.
Tests: test_live.py covers the feed readers, the run_state live override, and
the dashboard badge + live.json (active and idle). Full suite green (342).
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.
Lets you watch an active run progress in real time on both surfaces, instead of waiting for checkpoints (which only land every
checkpoint_interval).(b) Per-iteration progress feed
The process controller appends one JSON line per completed iteration to
<output>/progress.jsonl—{iter, score, best, program_id, model, ts}— wrapped in try/except so telemetry can never break the evolution loop.explore.read_progress/progress_trajectoryread it, andrun_statenow prefers it for the live iteration / best / curve, so the already-livekai monitorand the viewer overview stop lagging to checkpoints.(a) Live web viewer
run_state.is_active).…/run/{idx}/live.jsonendpoint returns{active, iteration, best, cost, calls, chart}; the dashboard polls it every 3s and updates the chart + headline stats in place (no full-page reload, and the chart is re-rendered server-side viasvg.trajectoryso there's no chart logic duplicated in JS). When the run finishes, the badge flips to "● finished" and polling stops.Verification
test_live.py(5): feed readers,run_statelive override, dashboard badge +live.jsonfor both active and idle runs.🤖 Generated with Claude Code