Repository navigation
fix(tier3): keep the Rich progress frame at a fixed height - #420
Conversation
The interactive Tier 3 progress table changed height as the plan resolved and stages arrived: the Provider and Run plan rows appeared later, every stage added a row, and long details wrapped. Rich also redrew it from its own refresh thread at 8 Hz. Redraws of a frame whose height changes can leave repeated or jumbled frames in the terminal. - Always render the Provider and Run plan rows, with a placeholder until the plan resolves. - Keep each row on one line: the title and every column end in an ellipsis instead of wrapping. - Show the most recently updated stages in a fixed number of rows, at least six and at least one per agent, padded with blank rows. The slot count never shrinks. - Create Live with auto_refresh=False, so redraws come only from progress events and heartbeats, which hold the reporter lock. - Reset the plan, rows and slot count on close even when Live never started. A redraw failure on the heartbeat thread used to end the thread with a traceback and leave the reporter active. The heartbeat loop now catches it and calls a failure callback; SafeProgressReporter registers its disable hook there, which closes the reporter and stops the live view while the run continues. Without a callback the loop stops. A disabled SafeProgressReporter no longer reports itself active, and start() is a no-op once it is disabled. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Explain in the Tier 3 guide how the rich progress view keeps its height, which stages it shows and what happens when drawing fails, note the fixed-height table in the CLI reference, and add an Unreleased / Fixed CHANGELOG entry. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
When a redraw failed, SafeProgressReporter turned progress off through the reporter's close(), which reports every running stage as "failed - interrupted before completion" and redraws. A one-off write error on the heartbeat thread therefore left a frame saying the running agents had failed while the run went on, and progress stayed off. - PlainProgressReporter and RichProgressReporter get close_after_failure(), which stops without marking running stages failed. The Rich reporter keeps the last frame and prints one line saying the display stopped and the run continues. SafeProgressReporter._disable uses it when the reporter has it. - The heartbeat thread skips a redraw that fails with BlockingIOError or InterruptedError (a write that would block on a terminal another process made non-blocking) and draws again on the next heartbeat. - A heartbeat failure while close() is already stopping the reporter no longer calls the failure callback. - Rich progress lines are printed without Rich's number highlighting. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
SafeProgressReporter checked its disabled flag before calling the reporter, but not atomically with the heartbeat thread's _disable(). A plan update waiting on the reporter lock while a heartbeat redraw failed could pass the check after the reporter was closed, and then start a new Live on a disabled wrapper. That frame stayed on screen, with stdout and stderr redirected through it, until the run's final close(). - start() holds a wrapper lock while the reporter draws the plan, and _disable() sets its flags under the same lock. A failure reported from the heartbeat thread waits for the plan update and then stops what it drew. The reporter is closed outside the lock, because closing joins the heartbeat thread. - Registering the failure callback is now best effort. A caller-supplied reporter whose set_failure_callback raises, or whose attribute lookup raises, is wrapped as before instead of failing the evaluation. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
The fixed-height frame cuts each row with an ellipsis. At 80 columns that hid most of the Run plan row (concurrency, max agents, timeout, matrix trials, containers, the scaled agent timeout), every agent's model after the first, and the second Ctrl+C hint, which only appears in a stopping agent's detail. On main these rows wrapped and stayed visible. - The Rich reporter prints the Agents / models, Provider and Run plan lines in full above the frame whenever one of them changes. They stay in the scrollback; the frame keeps its height. - The stopping detail is now a runner constant that starts with a short hint, "Ctrl+C again skips wait", so the row cut at 80 columns still shows it with the longest built-in stage label in the frame. - close() also clears the record of printed plan lines, so the next run prints its plan again. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Live is created with transient=False, so its last frame stays in the scrollback. That frame kept the six-row recent window, so earlier outcomes dropped out of the record (for example a failed first agent, or a degraded Docker images stage). Its details were cut with an ellipsis, and a run that failed before the plan resolved left "pending / resolving" rows behind, as if work were still in progress. - close() updates Live with a final table before stopping it. That table lists every stage without padding rows, wraps the Detail column in full, and shows unresolved Provider and Run plan rows as "- / not resolved". - After a drawing failure, Live keeps the last frame it drew instead, since drawing the final table could fail the same way. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Align the CHANGELOG entry, the rich view paragraph in docs/tier3-live-evaluation.mdx and the --progress row in docs/cli-reference.mdx with the progress fixes: the full plan printed above the table, the final table listing every stage in full, the Ctrl+C hint shown first, a blocked heartbeat write skipped, and what a drawing failure leaves on screen. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
A heartbeat redraw that failed with BlockingIOError or InterruptedError was skipped so that the next heartbeat could draw again. Rich does not drop a refused frame: it keeps it in the heartbeat thread's buffer and sends it again, from the start, before the next one. A terminal that refuses writes for a while therefore gets a backlog that grows by one frame per heartbeat, and once the backlog is larger than one write can take, it never drains while the reporter stays active. Treat these errors like any other drawing failure: call the failure callback, which stops the live view without marking running stages failed and says that the run continues. The heartbeat thread then ends, and its buffer with it. The test drives a real Rich Live on a terminal that refuses heartbeat writes once or every time, and checks that progress turns off and the heartbeat thread ends. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ay stops close_after_failure() cleared the running stages under the reporter lock, released it, and then called close(), which takes the lock again and marks every still-running stage "failed - interrupted before completion". An agent update that took the lock in between put its stage back, and that stage was then drawn as failed in the frame Live leaves on screen. close() and close_after_failure() now share one _close(after_failure=...) path that decides under the same lock hold whether to mark the running stages. After a drawing failure nothing is marked, so a late update is drawn as running. The test runs the late update from another thread the first time the stopping thread releases the reporter lock. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
At 80 columns, with Agent Runtime Preflight in the stage window, the Detail cell is 24 characters wide and "Ctrl+C again skips wait" filled it with no column to spare. At 79 columns, or on a legacy Windows console, which uses one column less, the hint was already cut. The stopping detail now starts with "2nd Ctrl+C skips wait", two characters shorter, so it still shows at 78 columns. The 80-column test also renders the frame at 78 columns, so a longer hint fails before it reaches the edge. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e as is The Agents / models, Provider and Run plan lines above the Rich progress frame are printed in full so that values the frame cuts stay readable. They went through console.print with markup and highlighting off but emoji replacement on, so a model ID such as "ollama:llama:3.1-8b" was printed as "ollama", a llama emoji and "3.1-8b". The table cells are Text objects and were already verbatim. Print the lines with emoji=False too. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
…row terminal The final Rich frame, which stays in the scrollback, folded its Detail column so that each detail is shown in full. Stage, State and Elapsed do not wrap, so in a 60-column terminal they left the Detail column 4 characters wide and every detail folded into a stack of 4-character pieces: the emulated full run left a 252-line table, against 134 lines on main. Rich gives a ratio column whatever width the other columns leave and ignores its min_width, so the final frame is now drawn at render time: it wraps its details only when the width it is drawn at leaves the Detail column at least 20 columns wide, and otherwise keeps each row on one line as while running. The emulated 60-column run now leaves 35 lines; at 80 columns and wider nothing changes. The test renders the final frame at 76 columns, where the Detail column is exactly 20 wide, and at 75 and 60 columns. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ert points The entry sat at the end of Unreleased > Fixed, where open PRs #367 and #386 also add their entries, so each of them conflicted with this branch. It now sits in the middle of the same Fixed list, which no open PR changes. The text is unchanged. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
…display's stop A terminal that refuses a heartbeat redraw (a write that would block) usually refuses the stop that follows a few microseconds later on the same thread. Rich then loses the queued show-cursor control with that thread's buffer, the stop notice is skipped, and close() finds no Live to stop, so the cursor stayed hidden after the run. close_after_failure() now records when Live's stop or the notice under the last frame was refused, with the thread it ran on. The run's final close() then shows the cursor with Console.show_cursor(True) and prints "...; the run went on without it." A notice that was refused on the closing thread itself is not printed again: Rich still holds it for that thread and sends it with the cursor write. The refused-write test gains a terminal that refuses every thread's writes until the heartbeat thread has ended, a case that refuses only the notice, and the cursor and single-notice checks after close(). A new test covers the same refusals on the caller's thread. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Two gaps in how the run's close() finished a stop the terminal refused after a drawing failure: - The heartbeat thread recorded a refused stop, or a refused notice, in a second lock hold after the one that stopped Live, and wrote the notice outside the lock. A run-end close() that took the lock in between found no Live to stop and no record, so the cursor stayed hidden, and the record then reached the next run's close(), which printed the late notice in a healthy run. The stop, the notice and the record now share one lock hold, so close() either stops Live itself or finds the record. start() of a new run also drops a record left by a run that was never closed. - close() showed the cursor through the same Rich console, which first sent everything that console held for the closing thread from refused writes: the refused frame and Live's stop, each led by cursor-up and erase-line controls sized to the frame on screen when drawing failed. Lines printed since then, such as logged warnings, were erased and overwritten. close() now drops that held output first, shows the cursor and ends the frame's last line when the stop was refused, and prints the late notice whenever the notice did not reach the terminal, so a refused notice is no longer sent as the on-time "the run continues" line at the end of the run. Tests: the caller-thread refusal cases now print warnings before close() and check that close() writes no cursor-up or erase-line control and ends with the late notice. A new test closes the run from another thread while the heartbeat thread's refused stop is in progress, and another starts a reporter again without close() after a refused stop. The stop-notice check also requires the notice on a line of its own. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rame was refused Rich's Live.start() stops Live itself when its first frame fails, then raises. When the terminal refused that stop as well, the write that shows the cursor again stayed in the caller's Rich buffer. The stop that follows the drawing failure then had nothing left to do and raised nothing, so the record said the stop went through, and close() dropped the held write without showing the cursor. close() now also shows the cursor when the refused output it drops holds that write. No frame reached the terminal then, so it ends no line. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
rng1995
left a comment
There was a problem hiding this comment.
Reviewed the full production diff, callers, report/runner contracts and affected regression coverage; no actionable findings. Existing CI on reviewed head 406de3a: 20 successful checks, 2 skipped; no failed or pending checks. Fresh merge-tree verification against current main ce52a09 succeeds without conflicts. No code changes or local test rerun were needed.
Signed-off-by: Narendran Raghavan <[email protected]> # Conflicts: # CHANGELOG.md
rng1995
left a comment
There was a problem hiding this comment.
Resolved the new CHANGELOG conflict with main a0b65a9, preserving the progress-frame entry and the landed N/A-display entry. Focused frame, heartbeat, drawing-failure and cancellation coverage passed 23 tests; make lint and pinned Fern check passed. Fresh live-head and latest-main merge-tree checks passed before the normal fast-forward push. Final head bc0cc79.
Brings in main through b38b71b (#416, #417, #420, #422, #423, #428, #429, #467). Merged without conflicts; CHANGELOG, docs, decoys.py and eval_core/checks.py auto-merged with both sides' edits in separate hunks. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
…p the running spinner moving (#548) * fix(tier3): say progress stopped when a plan line is refused before the frame The Rich view prints the Agents / models, Provider and Run plan lines before it starts Live. When the terminal refused one of those writes, for example with BlockingIOError on a terminal another process made non-blocking, progress turned off with no notice: close_after_failure() recorded the outcome only when Live existed, so neither the on-time nor the late notice was printed. The refused line also stayed in the Rich console's buffer for that thread and went out again with the next run's plan, which then printed it twice. A drawing failure before Live starts now prints the notice that the run continues, after the refused line, and records the outcome as a failure with Live does. When the terminal refuses the notice too, the run's close() drops the held output and prints the late notice. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier3): keep the running spinner moving between redraws Rich no longer redraws the progress view on its own timer, and every redraw built a new spinner for each running stage. A Rich spinner picks its frame from the time since it was first drawn, so each new one showed its first frame and the running indicator stood still for the whole run. Each running stage now keeps one spinner across redraws until it leaves the running state, so every heartbeat or update draws it at a later frame. The spinners are dropped with the other rows when the reporter closes. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier3): move the running spinner one frame per redraw The progress view redraws only on progress events and heartbeats. A Rich spinner picks its frame from the clock, so even when kept across redraws it stood still whenever redraws came a whole number of its cycles apart, for example every 4 seconds with --progress-interval 4, and showed only two frames every 2 seconds. Each running stage now shows the next frame of the same dots spinner on every redraw, however far apart the redraws come, and starts again from the first frame when it runs again after finishing. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(changelog): note the Tier 3 progress plan-line and spinner fixes Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier3): print a refused plan line once on a buffered terminal stream The CLI passes standard error to the progress view, a line-buffered text stream over a buffered writer. When a non-blocking terminal refuses a plan line printed before Live starts, that buffered writer keeps the line and raises BlockingIOError from its flush, and the Rich console keeps its own copy for the thread. The stop notice then sent both copies, so the refused line appeared twice in the same run. A drawing failure before Live starts now drops the console's copy before it prints the notice, as the late notice already does. The stream sends the line it kept with the notice, once. The test terminal that refuses plan lines counts only writes that carry text, since dropping the held output writes an empty string. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier3): drop progress output still refused when the run ends When the terminal still refused the late notice, or the write that shows the cursor again, when a run whose progress display failed was closed, the Rich console kept that output for its thread. A later run on the same reporter then started with it: the late notice from the earlier run, or a stray show-cursor escape before its plan lines. The run's close() now drops what the terminal refused there as well, as it already does with refused frames, so a later run starts with its own output. Follow-up to #420. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier3): hold the progress stop notice while the terminal is still full When the terminal refused a plan line before the Rich progress table started, standard error kept the refused line in its buffer. It was usually still full a moment later, when the line saying that the run continues was written, so the stream kept that line too and sent it when the run ended, just before the line saying that the run went on. The terminal then showed both notices. Before writing the notice, the view now flushes the stream. If the terminal still refuses what the stream holds, the notice is left for the run's close(), which prints the late notice, so only one of the two reaches the terminal. A stream that keeps nothing it refused flushes at once, so it still gets the notice right away. Follow-up to #420. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(changelog): note the one stop notice and dropped refused output The Tier 3 progress follow-up entry now says that only one stop notice appears when the terminal still refuses writes, and that output still refused when a run ends is not sent with the next run on the same reporter. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier3): drop refused progress output at the end of every run When nothing failed while a run went on but the terminal refused the final table and Live's stop in the run's close(), the Rich console kept that output for its thread. Only a run whose display had failed earlier dropped what was still refused. A later start() on the same reporter then sent the old final table first. It starts by moving the cursor up over the frame that was on screen, so it erased the lines printed between the runs and drew the old table over them. The run's close() now drops whatever the terminal still refuses once it has finished, after a drawing failure or not. Follow-up to #420. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(changelog): note that a refused final progress table is dropped Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(changelog): say standard error can still send refused progress output The Tier 3 progress entry said the view no longer sends output the terminal still refuses when the run ends with the next run on the same reporter. The run's close() drops only the view's own copy. A stream that keeps what the terminal refused, as standard error does, still sends it with its next write, and a final table sent then can still erase the lines printed between the runs. The entry now says so, and a test checks it. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(tier3): say standard error can still send refused progress output The rich progress view paragraph in the Tier 3 live evaluation guide said that refused frames are dropped when the run ends, so they are never drawn over output printed since. The view drops only its own copy. A stream that keeps what the terminal refused, as standard error does, can still send it later, and a table sent then can still erase the lines printed since. The guide now says so, as the Unreleased CHANGELOG entry does, and a test checks the paragraph. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(tier3): say the view drops refused output when any run ends The guide said the view "then" drops its own copy of output the terminal still refuses, such as the final table, right after the sentences about a failed display. After a drawing failure the view draws no final table, and the drop happens when every run ends. The sentence now says so, and the docs test checks the new wording and rejects the old one. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(tier3): find the progress CHANGELOG entry wherever it sits The check split CHANGELOG.md at blank lines and expected the entry to start its own block, so it failed once main added entries above it in the same subsection. It now reads each bullet with its continuation lines and finds the entry by its opening words. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier3): print the late stop notice when the cursor write is refused _finish_failed_stop showed the cursor and wrote the late stop notice in one try, so when the terminal refused the show-cursor write as the run closed, the notice was never written. Since the stop notice now waits for close() while the stream still holds refused output, a first frame refused on standard error, a terminal that drained during the run and was full again at close left the run with no stop notice at all; main had sent the early notice from the stream's buffer. A refused update frame already lost the notice this way. The notice now has its own try after the cursor restore. Standard error keeps the refused notice with the show-cursor write and sends both once the terminal drains; on a stream that keeps nothing, close() drops both as before. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(changelog): drop the extra blank line after the progress entry The Unreleased Fixed entry for the Tier 3 progress view was followed by two blank lines before the 0.9.0 heading. The entry's CHANGELOG check now also requires a single blank line after it. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(tier3): accept a refused frame cut inside a character in the late notice test On Python 3.12 and 3.13 the 8 KiB BufferedWriter under the test's stderr-shaped stream keeps only the start of the refused update frame and sends it with the next write, cut inside a box-drawing character, so a strict UTF-8 decode of what the terminal received failed (CI Tests 3.12/3.13, Tier 2 Windows, Tier 3 macOS). Python 3.14's buffer keeps the whole frame. Decode with replacement; the cursor and stop-notice assertions are unchanged. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier3): print one stop notice when the stream keeps a refused notice _stop_live_after_failure flushes the stream before the "the run continues" notice so that standard error does not send a refused notice before the late one. That missed the next step: the terminal takes the flush, then refuses the notice write itself. Standard error's buffer kept the notice, and close() sent it from the stream and then wrote the late "the run went on without it" notice as well. A plan line refused before the table started (raw writes 1 and 3 refused) printed both notices, where main printed none, and a refused update frame followed by a refused notice printed both on main too. The flush and the notice now have separate tries. When the notice write raises BlockingIOError on a stream over a BufferedWriter right after the flush, and the console held nothing else, the stream holds the whole notice. The record says so, and close() flushes the stream instead of writing the late notice. A stream that keeps nothing it refused still gets the late notice. A first frame that Live.start() stopped itself is left as it was: the console's held frame and stop go out with the notice, so how much of it the stream kept depends on its buffer size. Tests: the buffered-stream plan-line test gains the refused-lines-1-and-3 case, and a new test refuses an update frame and then the notice on a stderr-shaped stream, with the terminal taking writes at close or still full then. All three cases print two notices without the fix. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(tier3): pin that a notice after a refused first frame is not taken as kept 781ec05 treats a stop notice the terminal refused as kept by the stream only when the console held nothing else. After a refused first frame, Live.start() stops Live itself, and when the terminal refuses that stop too the console holds the frame and stop and sends them with the notice in one write. A stream buffer smaller than that write keeps only its start, so the notice is lost and the late notice is needed. No test covered that exclusion: removing it left every test passing, and the run then ended with no stop notice. The new test refuses the first frame and Live.start()'s stop on a stderr-shaped stream with a 1 KiB buffer, lets the flush before the notice through, refuses the notice, and checks that one stop notice, the late one, ends the output. It sets the buffer size so that it does not depend on the Python version's default. With the exclusion removed it fails with 0 == 1 on Python 3.14 and 3.13. The comments now say what the code does. After a failed first frame the late notice is written whether or not Live.start()'s stop went out, because nothing there tells which. When that stop went out and the stream kept the notice, both notices still print, as on main. A stream buffer smaller than the notice would keep only part of it; standard error's buffer is many times larger. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(tier3): say that standard error sends a refused notice it kept After 781ec05, a stream that keeps what the terminal refused, as standard error does, sends a refused "the run continues" line when the run ends, and the late "the run went on" line no longer follows it. The guide still said that a refused line is always replaced by the late one, which on standard error is now so only when the terminal also refuses the writes before that line. The CHANGELOG entry said the same for the plan-line case and did not mention the refused table update, after which standard error printed both lines. The guide's rich view paragraph now says that a stream that kept the refused line sends it then instead of the later one, and that after a failed first frame both can still appear, as on main. The CHANGELOG entry says the same for its plan-line case and notes the table update case. The changelog and guide tests check the new sentences and fail on the old text. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(tier3): start the late stop notice on its own line after a refused cursor write 73c3323 moved the late stop notice into its own try so that a refused show-cursor write no longer loses it. That write also skips the line() that ends the frame's last line, and the notice was then written anyway. When the stream had kept only the start of the refused Live stop, cut before the stop's newline, the notice landed on the cut frame's last line. The 8 KiB default BufferedWriter of Python 3.12 and 3.13, as under the tests' stderr-shaped stream, does this when it already holds a refused update frame: with raw writes 6, 7 and 9 refused, the output ended with the cut box border followed by the notice. When the cursor write raises before line() runs, the notice now starts with a newline in the same write. A refused line() needs nothing more: the console keeps it and sends it ahead of the notice. Where the stream kept the whole stop, the notice follows a blank line, as it already did when the terminal took the cursor write. 73c3323's message said standard error sends the notice with the show-cursor write once the terminal drains. It does so only when its buffer has room: one already full of a refused frame keeps neither, as before that commit. The code and test comments now say so. Tests: a new test refuses an update frame and Live's stop on a stderr-shaped stream with a 1 KiB buffer, so that it does not depend on the Python version's default, prints nothing before close, and refuses the show-cursor write at close. It checks that the late notice is on a line of its own, and it fails without the fix on Python 3.14 and 3.13. Enumerating every refuse/accept pattern of the first 11 raw writes, with and without a warning line, at the default, 1 KiB and 4 KiB buffers, leaves the notice count and the cursor state unchanged in every pattern and leaves no notice joined to a frame line on this path. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(tier3): say the late notice is kept only while the stream's buffer has room The guide said that when the terminal refuses the line saying the run continues, or the write that shows the cursor again, the line saying the run went on is printed and the cursor is shown when the run ends. That holds when the terminal takes writes then, or when the stream that keeps what the terminal refused, as standard error does, has room for them. When its buffer is already full of a refused frame and the terminal still refuses writes at close, the stream keeps neither: the late line is lost and the cursor stays hidden, even after the terminal takes writes again. 5cda204 corrected the same claim in the code comment. The guide now says the stream sends the late line and the cursor write only if its buffer has room, and that a buffer full of a refused table can drop the line and leave the cursor hidden. The guide test asserts the new sentence and fails on the old text. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(tier3): clear TTY_INTERACTIVE so the forced-terminal progress tests draw in place Rich reads TTY_INTERACTIVE when it builds a console, and TTY_INTERACTIVE=0 makes it non-interactive even with force_terminal=True. Live then stops redrawing the frame in place, so seven tests that drive a forced terminal and a refusing stream failed in that environment on Python 3.14 and 3.13: the late notice tests, the kept-notice tests, the refused-first-frame test, the refused-from-an-update case of the next-run test and 5cda204's new cut-frame test. CI does not set the variable. An autouse fixture in the module now removes TTY_INTERACTIVE, so these tests draw the same frames wherever they run. The module passes with TTY_INTERACTIVE unset, 0 and 1 on Python 3.14 and 3.13 (7 failed with TTY_INTERACTIVE=0 before). Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Signed-off-by: Narendran Raghavan <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
Summary
The interactive Tier 3 progress view (
--progress rich, orautoin a terminal) now keeps one height for the whole run and draws only from progress events and heartbeats. Text the fixed frame cuts is printed in full elsewhere, and a drawing failure turns progress off without reporting the running stages as failed.The closed plugin-evaluation PR #28 carried a version of this fix inside its larger change; this PR lands the generic part on its own.
pendingwithresolving/preparing.no_wrapwith an ellipsis, so each row is one line._LIVE_MIN_EVENT_ROWS) and at least one per agent, padded with blank rows. The count only grows. An updated stage moves to the end, so the rows show the most recently updated stages.Liveis created withauto_refresh=False. Before, Rich also redrew at 8 Hz from its own thread, outside the reporter lock.ollama:llama:3.1-8bprints as is.close()draws a final table before stoppingLive. It lists every stage without padding and shows unresolved Provider and Run plan rows as-/not resolved. Its Detail column wraps in full when the width it is drawn at leaves that column at least 20 columns (_FINAL_DETAIL_MIN_WIDTH). In a narrower terminal each row stays on one line, as while running. Before, a 60-column terminal left the Detail column 4 characters wide and folded every detail into 4-character pieces.2nd Ctrl+C skips wait; stopping Harbor jobs, up to 30s of environment cleanup(_HARBOR_RUN_STOPPING_DETAILinrunner.py). The hint comes first and is short. At 80 columns, next to the longest built-in stage label (Agent Runtime Preflight), the row still shows it with two columns to spare, so a legacy Windows console, which uses one column less, shows it too._heartbeat_loopcatches aheartbeat()failure and calls a failure callback registered with the newset_failure_callback(). With no callback it sets the stop event. Either way the thread ends without a traceback. A failure whileclose()is already stopping the reporter calls nothing.BlockingIOError, for example on a terminal another process made non-blocking) is a drawing failure like any other. It is not skipped: Rich keeps a refused frame and sends it again before the next one, so skipping would grow that backlog by one frame per heartbeat.SafeProgressReporterregisters its_disablehook as that callback, best effort: a reporter whose registration raises is wrapped as before._disablecalls the reporter's newclose_after_failure()when it has one. That stops without marking running stagesfailed - interrupted before completion; the Rich reporter keeps its last frame and printsTier 3 progress display stopped after a drawing error; the run continues.Live, prints the notice and records which of the two the terminal refused, all in one hold of the reporter lock (_stop_live_after_failure). The run's finalclose()therefore either stopsLiveitself or finds that record, even when it runs while the heartbeat thread is still turning the display off.close()first drops what the closing thread's Rich console still holds from refused writes (Console.begin_capture()thenend_capture()). Rich would otherwise send it before that thread's next write. A refused frame or stop starts with cursor-up and erase-line controls sized to the frame that was on screen when drawing failed, so it would erase lines printed since, such as logged warnings, and draw the old frame over them. Then, when the stop was refused,close()shows the cursor and ends the frame's last line. When the notice did not reach the terminal, it printsTier 3 progress display stopped after a drawing error; the run went on without it.Live.start()stopsLiveitself when its first frame fails, then raises. When the terminal refused that stop too, the later stop has nothing left to do, so the record says the stop went through.close()therefore also shows the cursor when the output it drops holdsLive's show-cursor write. No frame reached the terminal then, so it ends no line.start()of a new run drops such a record, and the held output, when the run whose display failed was never closed.close()andclose_after_failure()share one_close(after_failure=...), which decides under the same lock hold whether to mark running stages. An agent update that reaches the reporter while a failed display stops is drawn as running, not as failed.SafeProgressReporter.start()holds a wrapper lock while the reporter draws the plan, and_disablesets its flags under it. A heartbeat failure during a plan update waits for the update and then stops what it drew, instead of the update starting a newLiveon a disabled wrapper. After_disable,is_activeisFalse, andstart()does nothing while disabled.RichProgressReporter.close()resets the plan, rows, slot count and printed plan lines even whenLivenever started.richview in "Tune the run" indocs/tier3-live-evaluation.mdx, and the--progressrow indocs/cli-reference.mdx. CHANGELOG entry under Unreleased > Fixed.Why
On
mainthe Rich table grows as the plan resolves and stages arrive, and long details wrap. With the input oftest_rich_progress_frame_height_stays_fixed_as_plan_and_events_grow(one agent, the plan resolving, 10 stages with long details), the frame goes from 7 to 62 lines at 80 columns and from 7 to 128 lines at 60 columns. Redrawing a frame whose height changes, from two threads, can leave repeated or jumbled frames on screen.A fixed frame has to cut long rows. At 80 columns that would hide most of the Run plan row, every agent's model after the first, failure reasons, and the second Ctrl+C hint, which
docs/tier3-live-evaluation.mdxpromises in the progress view. The plan lines above the frame, the final table and the hint-first detail keep all of that visible.When a redraw fails on the heartbeat thread, the thread ends with an uncaught exception printed to stderr.
SafeProgressReporternever hears about it: the reporter stays active,Livestays attached and elapsed times stop updating. A failure on the caller's thread was already handled, but throughclose(), which reports every running stage as failed and redraws, so a one-off write error left a frame saying the running agents had failed while the run went on.Kept from public
heartbeat()call is wrapped.TEXT,MUTED,FAINTand the state colors) is kept. The new placeholders useMUTED.main,close()stopsLiveon the caller's thread, so the cursor comes back once the terminal takes writes again. This PR stopsLivewhen drawing fails, on the failing thread, and keeps that outcome: when the terminal refuses that stop,close()still shows the cursor.SafeProgressReporter.close()still resets_disabled, so a closed wrapper can start again, astest_safe_reporter_disables_broken_presentation_without_raisingrequires.close()still reports running stages as interrupted when the run itself is interrupted; only a drawing failure skips that.PlainProgressReporteroutput is unchanged. Its_write_linealready stops on a closed stream.test_rich_reporter_immediately_starts_one_live_box_and_keeps_stage_updates_inside_itnow expects the three plan lines above the box. Stage updates still never print outside it.runner.pyonmainbuilds no such console, so there is nothing to restore.mainkeeps the top-levelevaluatehidden and advertisestier3 evaluate.Tier3RunPlan.trial_retriesrows and the flag-like env value redaction).progress.pyortests/test_tier3_progress.py. Open PRs feat(tier3): reuse a compatible retained no-skill baseline #384, feat(tier3): add experimental Hermes agent with native NVIDIA Build routing #385, feat(tier3): compare a run against a prior skill version #387, Enable public plugin assessment and saved-run reports #394, feat(tier3): report whether a dataset is big enough for its claims #400, feat(tier3): add run budget limits with admission control and partial results #404 and feat(datasets): record how a dataset was generated and show it on reports #405 also changerunner.py, several open PRs change the two docs pages, and most add CHANGELOG entries at the start or end of an Unreleased subsection. This entry sits in the middle of Unreleased > Fixed. fix(tier3): show N/A for N/A metrics in the terminal Skill Lift and the HTML trial drill-down #411 adds its entry at the same place, so whichever of the two merges second has a CHANGELOG.md conflict to resolve; no other open PR adds lines there.git merge-treeof this branch with each open PR that changes these files and has a local branch reports no conflicts, except fix(tier1): scope ownership email policy and retain completeness diagnostics #333, fix(reporting): stop validate from repeating its header in short terminals #368 and feat(cli): show the wordmark in terminals narrower than 115 columns #369, which already conflict withmain(35ef01e) on their own. fix(tier3): decode inline and Promise.allSettled Codex wrappers (#235) #325, fix(reporting): let default Tier 3 runs with a baseline pass publication #332, feat(quality): configure Reliability error handling in the quality config #336, fix(quality): derive instruction tokens from parsed frontmatter #356, fix(tier2): retain trailing shell comments in deduplication #357 and feat(tier3): add fixed-source skill interaction evaluation #392 have no local branch, so they were not checked. Of those, only feat(tier3): add fixed-source skill interaction evaluation #392 changes more than the CHANGELOG: it also changes the two docs pages. The branch merges cleanly withmain35ef01e6, and with currentmain86f1a1f0, which has since merged feat(plugin): recognize native OpenClaw manifests in the private plugin helpers #391, fix(tier3): end feedback chat URL spans where a path after them can start #389 and feat(ci): add three-tier onboarding and private report feedback #349.Tests
tests/test_tier3_progress.pyadds 23 tests (29 with parameters):Livegetsauto_refresh=Falseand norefresh_per_second; after 7 stages and an update to the first, the six most recent stages are shown and the oldest is notLivestart leaves no plan, rows, extra slots or printed plan lines afterclose()ollama:llama:3.1-8bandcustom:rocket:proxyas isAgent Runtime Preflightin the frame, every stopping agent row shows the runner's hint at 80 and at 78 columns, and every agent's model and the plan values the frame cuts are printed above it (two agents, andmini-swe-agentalone)not resolvedwith nopending,resolvingorpreparingSafeProgressReporteris inactive after a failure on anemit()that follows a successful startLiveonce and detaches it; no frame saysfailedorinterrupted, the last one still saysrunning, the stop line is printed, and later events no longer reachLiveLiveon a terminal that refuses writes withBlockingIOError(4 cases: the heartbeat thread's redraw only; every heartbeat write; every thread's writes until the heartbeat thread has ended, then none; the redraw and the notice but not the stop): progress turns off, the heartbeat thread ends, later events are not drawn, nothing saysfailedorinterrupted, and nothing reachesthreading.excepthook. Afterclose()the last\x1b[?25hcomes after the last\x1b[?25land the stop notice is printed exactly once, on a line of its own: on time when only the redraw is refused, otherwise the late notice. When only the redraw is refused, the agent still showsrunningclose()writes no cursor-up or erase-line control after them, ends with the late notice, shows the cursor when the stop was refused, and the notice is printed exactly onceclose()on another thread while the heartbeat thread's refused stop is in progress (started the first time that thread releases the reporter lock after the stop): the cursor is shown and the late notice is printed once, and a second run on the same reporter prints no noticeclose()after a refused update and stop: the new run shows none of the refused frame and no notice, and ends with the cursor shownLivewhose hide-cursor write the terminal takes, but whose first frame and its own stop it refuses (2 cases: the notice refused too, or taken): afterclose()the cursor is shown and the notice is printed exactly once, on a line of its own, with no cursor-up control sent at close. When the notice is refused, no frame and no blank line appear before the late noticefailedorinterruptedLive; no secondLiveis createdset_failure_callbackraises, and a proxy whose attribute lookup raises, are wrapped and receive eventsthreading.excepthooktest_safe_reporter_disables_broken_presentation_without_raisingalso checks thatstart()on a disabled wrapper, and astart()that fails, leave it inactive.test_second_interrupt_forces_running_agents_to_stopchecks the full stopping detail, which now starts with the hint.test_rich_reporter_immediately_starts_one_live_box_and_keeps_stage_updates_inside_itexpects the plan lines above the box.src/frommainand this PR's tests,tests/test_tier3_progress.pyhas 31 failed and 145 passed. The 31 are 28 of the 29 new test cases and the 3 changed tests. The registration test passes onmain, which registers no callback; it fails on this branch's first version.BlockingIOError(the heartbeat thread kept running), the late agent update (drawn asfailed - interrupted before completion), the hint at 78 columns (cut toCtrl+C again skips wa…), the plan lines (ollama🦙3.1-8b), the final frame at 75 columns (22 table lines instead of 7), the refused stop (5 of the 6 refused-write cases fail: the cursor stays hidden or no notice is printed; the redraw-only case passes there too), the run-end close race and replayed frames (6 failed, 168 passed: both caller-thread cases, whereclose()wrote 28 cursor-up controls over the warnings or sent the refused on-time notice; the race test, where the cursor stayed hidden; the restart test, which showed the refused frame; and the every-heartbeat-write and every-thread cases, where the late notice followed the frame's last line), and the refused first frame and stop (1 failed, 175 passed: with the notice refused too, the cursor stayed hidden).tests/test_tier3_progress.py: 176 passed. It also passes under--covwith-n 4. The 21 tests matchingheartbeat,safe_reporter,races,would_block,callers_write,plan_update,run_end_close,new_run_without_closeorrefused_first_framepassed 8 runs in a row with-W error::pytest.PytestUnhandledThreadExceptionWarning, and 3 more under--covwith-n 4.tests/test_tier3_progress.py,tests/reporting/test_terminal_polish.py,tests/test_cli.py,tests/test_evaluation_service.py,tests/tier3/test_skip_with_skill.py,tests/test_ci_workflows.py,tests/test_oss_packaging.py,tests/test_ci_change_classifier.py,tests/test_benchmark_rollout_docs.py,tests/test_harbor_claude_refusal_fallback.py,tests/tier3/test_private_loose_source.py,tests/ci/test_image_build.py,tests/test_tier3_public_runtime.py,tests/test_accuracy_arithmetic.pyandtests/test_harbor_runner_status.py: 1176 passed, 2 skipped.tests/test_tier3_max_cases.py,tests/tier3/test_workflow.pyandtests/reporting/: 1823 passed.ruff checkandruff format --checkare clean on the changed Python files,git diff --checkis clean, andscripts/check_oss_boundary.pypassed.🤖 Generated with Claude Code