Repository navigation
Keep the dashboard running when a refresh fails - #440
Merged
Merged
Conversation
action_refresh read the task list with no error handling, on the UI thread (the snooze timer, `r`) and from the feed worker via call_from_thread, so a 500 / timeout / refused connection from the task service exited the app and dropped the operator to the shell. It also cleared the table before reading. Now the reads happen first; an httpx.HTTPError keeps the last-drawn table, warns once per outage, re-arms the snooze timer, and the feed worker rewinds its cursor so the missed change is retried once the service is back. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tildesrc
marked this pull request as ready for review
November 4, 2026 04:05
tildesrc
added a commit
that referenced
this pull request
Nov 4, 2026
…r-row work, skip no-op writes On a host with ~850 finished tasks and dozens of live agents, every change-feed tick made each long-poller re-read and re-serialize the whole task list, and the dashboard fetched it twice and rebuilt every row. - GET /tasks takes `terminal_limit`: the N most recently updated finished task trees (a finished child of an active governor, and every member of a kept finished ensemble, always survive). The dashboard asks for the newest 50; `D` shows them all. - The dashboard draws the snapshot its long-poll already returned instead of fetching again, and leaves the table alone when the rows it would draw are the ones on screen. - The list endpoint resolves the artifact mark in one batched scan, memoised in the service (the artifact store's only writer), and composes container statuses in one pass over registrations. - set_turn / set_blocked / report_lifecycle no longer save or bump the change feed when they restate the current value (the turn hooks fire on every prompt and stop). - The host daemon's cleanup settles a finished task with no checkout and no claim of ours with a stat, not a `docker ps` fork per finished task per pass. - Folded into #440's refresh error handling: `_refresh(tasks=None)` makes the reads (only the runner list when the long-poll or the snooze timer already holds the tasks) and keeps the last-drawn table on failure; `_render` draws. - `panopticon request-mix [LOG]` tallies the service log: writes vs long-polls vs full reads. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tildesrc
added a commit
that referenced
this pull request
Nov 4, 2026
…r-row work, skip no-op writes (#441) On a host with ~850 finished tasks and dozens of live agents, every change-feed tick made each long-poller re-read and re-serialize the whole task list, and the dashboard fetched it twice and rebuilt every row. - GET /tasks takes `terminal_limit`: the N most recently updated finished task trees (a finished child of an active governor, and every member of a kept finished ensemble, always survive). The dashboard asks for the newest 50; `D` shows them all. - The dashboard draws the snapshot its long-poll already returned instead of fetching again, and leaves the table alone when the rows it would draw are the ones on screen. - The list endpoint resolves the artifact mark in one batched scan, memoised in the service (the artifact store's only writer), and composes container statuses in one pass over registrations. - set_turn / set_blocked / report_lifecycle no longer save or bump the change feed when they restate the current value (the turn hooks fire on every prompt and stop). - The host daemon's cleanup settles a finished task with no checkout and no claim of ours with a stat, not a `docker ps` fork per finished task per pass. - Folded into #440's refresh error handling: `_refresh(tasks=None)` makes the reads (only the runner list when the long-poll or the snooze timer already holds the tasks) and keeps the last-drawn table on failure; `_render` draws. - `panopticon request-mix [LOG]` tallies the service log: writes vs long-polls vs full reads. Co-authored-by: Charlie Scherer <27368115+tildesrc@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.
Dashboard.action_refreshcalledlist_tasks()/live_runners()with no error handling. It runs on the UI thread (first paint,r, Enter collapse, the snooze-display timer) and from the change-feed worker viacall_from_thread, so anyhttpxfailure from the task service — a 500, aReadTimeout, a refused connection — exited the Textual app, killed the tmux pane and droppedpanopticon startto the shell. Seen twice on 2026-10-22 while the service was stalled ondatabase is locked. It also cleared the table before reading, so even a caught failure would have blanked it._refresh()catcheshttpx.HTTPError(status, timeout and transport errors; real bugs still surface) and returns whether it succeeded;action_refreshwraps it.Tests in
tests/terminal/test_dashboard.pymake the fake client'slist_tasksraise and cover the direct refresh (table kept, one warning), warn-once-per-outage, the snooze-timer path, and the feed-worker path including recovery.Plan: task artifact
plan.md.🤖 Generated with Claude Code