Repository navigation
Conversation
…ckage Replace the ~75 fmt.Fprintf(stdout.Writer(), "[ocr] ...") call sites with progress.Publish, so run progress becomes structured events rather than pre-formatted lines. The default sink prints each event as the [ocr] line it always was, so piped, CI and --format json/sarif output is byte-for-byte unchanged. Events that exist only to update a live view carry no text and print nothing; publishing both a notice and a state event for one fact doubled the output. Token usage was a single process-wide total, which cannot attribute spend to one unit of work while N groups run concurrently. The runner now keeps a per-task breakdown alongside the aggregate, so a row can report what it actually cost rather than a share of the total.
Replace the wall of [ocr] lines with a full-screen view that repaints in place: a progress bar, counters, one row per unit of concurrent work, and a scrolling activity log. The bar is segmented because "reused from a resumed session" and "reviewed during this one" are different states, and a resumed run opens partly full before this run has done any work. Skipped files are excluded from the numerator: the denominator is the count selected for review, which already excludes everything selection skipped. The dashboard starts only on an interactive terminal, for text format and the human audience, so pipes, CI and --format json/sarif never see an alternate screen. --no-tui opts out explicitly.
fix(llm): allow unlisted OpenRouter model overrides (alibaba#1610)
Flip the live terminal dashboard from opt-out (--no-tui, on by default on interactive terminals) to opt-in (--tui). Plain [ocr] progress lines are now the default, preserving the old text behavior unless --tui is passed. The dashboard still only starts on an interactive terminal with --format text and --audience human. Renames progress.Options.Disabled to Enabled and inverts the gate, updates the review and scan commands, and refreshes the CLI reference in all five locales.
Pulls in main's 20 commits (ACP service, ChatGPT auth, scan token-budget and prompt-overflow fixes, provider docs, dependency bumps, etc.) and reconciles them with this branch's interactive dashboard work. The branch had advanced internal/telemetry to a 3-arg PrintToolCall API while main stayed on 2-arg, so the telemetry/llmloop/scan/output files are resolved to main's consistent 2-arg set. The internal/progress dashboard (independent of telemetry) and the opt-in --tui flag are kept from this branch: plain [ocr] progress lines are the default and the live dashboard only starts with --tui on an interactive terminal.
…rough the package The scan's publishers were defined but never called, so a dashboard run of `ocr scan` had no denominator, an empty work list and zero counters, while the scan's own lines went straight to stdout and scribbled over the view. The publishers are now called at the points the facts become known, and the lines go through the progress package like every other one. The tool-call lifecycle is published too, so a row shows the tool it is calling rather than sitting on "starting…". The resume lookup re-hashed every file's content; it now uses the fingerprint cache the rest of the run already builds. The dashboard's log rows are the events' own text, and the text sink adds the "[ocr] " prefix itself, so a line that already carried one showed it twice. The prefix is stripped for the dashboard.
11 of 15 tasks
The English page documented the dashboard and the flag, and the other locales had only the flag row. The section describes what a reader sees and which keys do what, so it belongs in all of them.
The ctrl+c row of the key table was missing its closing pipe, so the row did not render as a table row.
Terminal UI now lives only in the command layer, as it does upstream, and the dashboard shares the palette provider_tui.go already declares. internal/progress keeps the event stream and the plain text sink; it exports Sink and Install so the command layer can take the stream over for the duration of a run. The command layer now also resolves terminal interactivity and the colour profile, untrusted strings are sanitised as events enter the model, truncation is width-aware, and a terminal too small for the dashboard is told to enlarge. Details and reasoning are in the PR description.
The message hard-coded 40x12 while the floor lives in two constants, so raising the floor would have left the two disagreeing.
Six events the live dashboard renders were never published, so the view silently disagreed with the run: - the scan counted a file's findings before the comment workers had drained, and reported zero for every file; - the scan published its skips as plain notices, so a scan filled the activity log with one row per skipped file and never counted them; - a scan cut short mid-task never published the budget event; - a review group that stopped short published no terminal event at all, so its row kept spinning and its files never advanced the bar; - the budget event carried text, so the plain sink printed the budget notice twice; - the tool error was published as a warning, leaving the kind reserved for it unused. Found by running the project's own review over the branch.
The dashboard's per-row token column is driven by the usage event, and nothing published it: the kind was declared and rendered but never emitted, so every row ended with zero tokens. The accounting it needed was lost when upstream's llmloop was merged in. Track each task's running total in the runner and publish it after every response, so a row shows what it spent rather than what its last call cost.
The rename that moved the dashboard into the command layer also rewrote the word inside the help line, so the view offered "tab dashboardPane". Found by running the dashboard under a real terminal.
The dashboard's row names the tool it is calling right now, but nothing published the end of a call, so the name stayed after the tool had finished and the row read as though it were still running that tool. Publish the end of a call, and attribute a failed one to its row, so the name clears when the call is over.
The header rendered the elapsed time as minutes and seconds, so a run of seventy-two minutes read as "72:00" while the summary line the same run printed said "1h12s elapsed". The header now uses the same formatter as the summary, which also has an hours case, and the duplicate formatter that was left with no caller is gone. The token abbreviations diverge from the [ocr] progress lines on purpose: theirs rounds, so 3800 tokens print as "4K" in the log and as "3.8k" here. The comment says so, rather than leaving the difference to be discovered.
Three ways the dashboard could draw outside the width it was given: - the bar's cell count assumed the "n/m" counter was seven characters wide, which a four-digit file count already beats, and the legend beside it was not counted at all, so a narrow window cut the legend off the right edge; - the bar's three segments were each measured against the whole bar, so they could add up to more than the bar has and run past the counter and the legend; - a log entry whose text spanned lines rendered as two rows while the region counted entries rather than lines, pushing the rows below it off the frame. Found by the project's own review over the dashboard.
fix(tool): report an empty code_comment batch instead of success (alibaba#1773)
Author
|
Reopening to re-run the automated review against the current head. The review that ran at open time failed in the workflow's own checkout (upstream's sparse-checkout pollution, since fixed by #1783), so this branch's restructured form has never been through it. The branch is otherwise unchanged and up to date with upstream main. |
The session writer holds its file open until it is finalized, and Windows cannot delete an open file, so the test's temp directory could not be cleaned up. Finalizing the session closes it.
A row showed its spend under the header's input arrow, but the row's number was input and output added together, so a row could read larger than the whole run had spent. The arrows now mean the same thing in the header, in a running row and in a finished one: ▲ is input, ▼ is output. The status line's separators also had no spaces, so the counters ran together and the documentation's example did not match what was drawn.
Four things the dashboard got wrong, all found by reading the rendered screen rather than the code: - a row cleared the tool name when the call ended, and tool calls finish in milliseconds, so the row sat at "starting…" while the activity log moved on. The name stays — it is the last thing the row did — and the row says whether the call is still in flight; - the frame came out one line taller than the terminal, so the help line fell off the bottom, and a pane that was shorter than its allowance pulled the regions below it up, so the log moved as work came and went; - the bar's segments were measured separately and truncated, so they never added up to the full width and the bar never quite filled. They are stacked now, each ending where the next begins; - a failure small enough to round away left no trace in the bar at all, while the count beside it said files had failed. The activity list also gets a scrollbar, so the reader can see how much of the feed is left and where the window sits in it.
SaahiilM
force-pushed
the
feat/live-progress-dashboard
branch
from
October 20, 2026 16:19
781d081 to
bc5aa1b
Compare
The estimate was a line in the log, so it scrolled away within seconds while the run spent it. It is now published with the file count and shown on a line of its own, beside the batch plan, and every row names the batch it belongs to. Rows are wrapped rather than cut: a note that did not fit continued on the next line, indented under its own column, and the name column gives ground to the note so it always has room. The activity log folds away with "l", and the work list takes the height the two of them shared.
The heading counted every row the run had ever opened, so it read "work (51)" next to a status row saying four files were in flight, and the two were about different things. It counts what is being worked on now, and the folded rows are called finished rather than done, because some of them failed.
This branch has not been deployed
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.
Description
ocr reviewandocr scanprint a wall of[ocr]progress lines during a run.On a real 487-file scan that is hundreds of lines, none of which answer "which
file is it on right now", and a run can spend minutes inside one blocking LLM
call showing nothing at all.
With
--tuion an interactive terminal this replaces those lines with a livedashboard: header, progress bar, counters, a plan line carrying the run's
estimated cost, one row per unit of concurrent work, and a scrolling activity
log. Without
--tuithe run keeps printing the plain[ocr]progress lines, sopiping, CI, and
--format json/sarifoutput stays byte-for-byte unchanged.Where the dashboard lives, and why
The Bubble Tea program moved out of
internal/progressand intocmd/opencodereview, next toprovider_tui.go. Upstream already keeps itsterminal UI in the command layer and nowhere else — before this restructure the
repository's only
charm.landimports outsidecmd/were the ones this PRintroduced, which is a convention worth keeping rather than breaking in the
first patch that adds a second terminal UI. An early commit in this branch has
the renderer in
internal/progress; a later one moves it.The split that follows from it:
internal/progressowns the event stream and the plain[ocr]text sink.It is what six internal packages publish to, and it stays free of any UI
framework.
cmd/opencodereviewowns the dashboard: the model, the view, the program,and the decision of when to show them.
internal/progressexports aSinkinterface and anInstallfunction so thecommand layer can take over the event stream for the duration of a run.
Relationship to the upstream
ocr tuiworkUpstream has an open PR (#1739) adding an
ocr tuicommand: an interactiveworkspace for choosing what to review, configuring the provider, launching
runs, following progress, and reading findings afterwards. The two coexist:
ocr tuiis a workspace — it picks the scope, launches the run, andbrowses the results.
ocr review --tuiis a live view of a run whose scope was already fixed onthe command line.
They never render the same run:
ocr tuilaunches its child review without--tuiand reads the child's stderr, so there is exactly one dashboard onscreen. The
--tuiname also matches the vocabulary upstream already uses forterminal interfaces (
provider_tui.gois onmain).This PR follows the conventions that work points towards, so the two can share
the codebase rather than diverge:
cmd/opencodereviewprovider_tui.go'stui*Styledeclarations instead of declaring a second set.interactiveTerminal()andprogressColorProfile()live besideresolveColor(), and the dashboard is told the answer rather than probing the terminal itself.--colordecides the colour profilecolorprofile.Detectfor auto,TrueColorfor always,Asciifor never.sanitizeTerminal, so a file name carrying an escape sequence cannot repaint the dashboard.ansi.Truncaterather than a hand-rolled cut.The dashboard's UI copy stays English, like
provider_tui.goonmain. Whenupstream's terminal-interface locale files land, the copy can move into them.
Design decisions a reviewer should weigh
textSinkreproduces the historical[ocr]bytes; the TUI consumes the same events. A dashboard-only eventcarries no text and prints nothing.
count selected for review, and selection already removed what it skipped.
Counting them again measured progress against a total that never contained
them.
full before this run has done any work; without the distinction that reads
as progress the run did not make.
llmloop.Runner. The process-widetotal cannot attribute spend while N groups run concurrently; a snapshot
delta around one group would capture every other group's calls.
bubbles/progress, which needsharmonicafor spring physics a discrete filecounter does not want.
--tuiturns it on and plain progress lines arethe default, so an existing script or a piped run sees no change in output.
What the review should check
Each of these is a defect that existed at some point in this branch and was
fixed. They are the highest-yield things to re-derive:
--format jsonmust emit exactly oneparseable document on stdout;
--audience agentmust still print itssummary line. A second silencing mechanism once swallowed that summary
because its restore ran after the summary was published.
Program.Send/Waitblock forever on a program that was never started.The dashboard hung on a real TTY until
Duringquit the program when thework finished; only a piped run hid it.
a bare
[ocr]prefix with no newline, which ran into the next line as adoubled prefix.
skip doubled every skip in the log and defeated run-collapsing, because the
notice row landed between two skip rows.
--resumearithmetic. Reused files were marked but published no doneevent, so the bar stalled short of full on a resumed run.
ISIG.ctrl+cproduces no SIGINT while the dashboardis up, so the view has to hand the request back to the run itself.
and nothing called them, so
ocr scan --tuihad no denominator for itsbar, an empty work list and zero counters — and the scan's own lines went
straight to stdout and scribbled over the dashboard. Fixed.
"starting…" for the whole run instead of showing the tool it was calling.
Fixed.
where the run already builds that cache. Fixed.
[ocr]prefix showed it twice in thedashboard's log, because the text sink adds the prefix itself. The prefix
is now stripped for the dashboard.
group on the next page stayed open while the button read "Expand all".
Every group is collapsed now.
Events are now sanitised as they enter the model.
header rendered minutes and seconds, so a run of seventy-two minutes read
as
72:00where the same run's summary said1h12s elapsed. The headernow uses the summary's own formatter, which has an hours case, and the
duplicate formatter left with no caller is gone.
n/mcounter was seven characters wide — a four-digit file count already beats
that — and did not count the legend beside it at all, so a narrow window
cut the legend off the right edge.
was measured against the whole bar rather than against what was left of
it, so the bar could run past the counter and the legend.
rendered lines, so an entry whose text spanned lines pushed the rows
below it off the frame. One entry is now one row.
A second pass with the project's own review over the whole branch found seven
more, all of them in the pipeline rather than in the view, and all of them
making the dashboard disagree with the run it was showing:
drained. The count came back zero for every scanned file, so the
findings counter never moved. The scan now drains the pool for the file
before it counts, the way the review path does.
publishes a skip event; the scan published a line, so a scan over a repo
with many binary files filled the activity log with one row per file and
the skipped counter stayed at zero. Both publish the same event now.
published by the between-files gate but not by the mid-task stop, so the
dashboard finished without a budget line while the report said
budget_exceeded: true.Two of the group's exits published nothing: a group that produced
findings —
reportAsErroris false whenever the group has a comment —and a group that stopped without a reason. The row kept spinning and the
bar never advanced. Both now publish the split between the files that
finished and the ones that did not.
sink printed the budget notice twice, breaking the byte-for-byte promise
for piped runs.
rendered but never emitted, so every row ended with zero tokens. The
accounting it needed was lost when upstream's
llmloopwas merged in;the runner tracks each task's running total again.
for it unused and its styling dead code. It is published as that kind
now, on the same stream as before.
A later pass over the dashboard itself found four more, all of them about
what the reader could actually see:
seconds while the run spent exactly the thing the estimate predicted.
The estimate is now published with the file count, before the first
dispatch, and shown on a line of its own that stays for the whole run.
A scan that groups its work says so beside it, and each row names the
batch it belongs to.
fixed sixty characters wide, so on an eighty-column terminal the note —
the part that says which round the file is on, which tool it is calling
and what it has spent — was cut off. The name column now follows the
longest path in the run and gives ground to the note, and a note that
still does not fit wraps under its own column instead of being cut.
made the frame a column wider than the terminal. The terminal wrapped
that row onto a second line, and the help line fell off the bottom. The
marker is a line of its own now.
size it claimed to fit, once the plan line took a row of its own. The
floor is 40x13 now — the layout's real minimum — and the too-small
message is two short lines that fit the narrowest terminal it would
otherwise have drawn.
run had ever opened, so a heading reading
work (51)sat next to astatus row saying four files were in flight, and the two were about
different things — a reader took the heading for the files being worked
on, and it was the files already behind them. It counts what is being
worked on now, and the folded rows are called finished rather than
done, because some of them failed.
The first two of those have a regression test that fails without the fix.
Type of Change
How Has This Been Tested?
make testpasses locallyVerified on a real 487-file scan under a PTY, and by diffing piped output
against a binary built from
mainon the same repo — the only differences wereLLM nondeterminism. The same diff was re-run after the fixes above, and the
structural lines still match, with no line carrying the prefix twice.
A scan and a resumed scan were also run under the dashboard: the first shows
the bar reaching the file count with the findings counted, the second the
reused segment. A work row shows the tool it is calling.
Notes for reviewers
internal/progressis a new package. The text sink deliberately keeps writingto
stdout.Writer(), so the existing redirection (--audience agent,--format json) still controls where progress goes.This adds a mutex acquisition per LLM response for the per-task usage map.
That is negligible beside the network call, but it is the one new cost on a
hot path.
Upstream
mainhas been merged in. Itsinternal/telemetrystill uses thetwo-argument
PrintToolCall*API while this branch had moved it to threearguments, so the merge resolves the telemetry,
llmloop,scanandoutputfiles to upstream's two-argument set. The dashboard package doesnot depend on that API, so the TUI and
--tuiare unaffected by it.The
code-reviewworkflow was failing onmainfor every PR, includingother contributors', with the runner reporting
Can't find 'action.yml'. Thatwas the workflow's own sparse checkout polluting the shared runner
workspace, not a finding against any branch. Upstream has since fixed it
(fix(ci): prevent PR policy checkout state pollution #1783), and this branch merges that fix. The workflow only triggers on
opened, so a check from this branch's opening commit will not re-run byitself — a maintainer with write access has to re-run it, and it now gets
past the checkout. The same review on feat(viewer): show live sessions as running with a ticking duration #1786 passed after the fix.
The workflow runs on this PR are waiting to be approved. Every one of
them shows as
action_requiredwith no jobs at all, which is GitHub holdinga fork pull request's workflows until a maintainer approves them — the
Checks tab offers "Approve and run workflows". Nothing has failed and
nothing is waiting for a runner: the jobs have not started. The same ground
is covered locally by
make check,make testandmake coverage, whichare what the CI
testjob runs, and the repository's ownAnalyze (go)andwindowsjobs pass on the fork.Checklist
go fmt,go vet)AI Assistance
This branch was written with AI assistance. The original implementation was
produced with Claude Code (model
claude-opus-5); the merge of upstreammainand the--tuiopt-in with OpenCode; and the restructure ontoupstream's terminal-UI conventions described above, the review comments
addressed here, and the prose in this description with Claude Code, whose
session reports its model as
minimax/minimax-m3.1-flash:free.The diff has been reviewed by hand and every behavioural claim above was
checked against a real run rather than assumed. Commits carry no AI
attribution trailers.
🤖 Generated with Claude Code