Repository navigation
fix(dashboard): keep dashboards responsive and show observed usage - #1276
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9de04e64a5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
alandelong-oai
left a comment
There was a problem hiding this comment.
Reviewed the full contribution at 9de04e64a582a2b9221331636a7af24ad4f958b5 with selected base e4eff6521926241c1ad1df1bb6395b71135e56d3, including changed tests and touched context, using three independent reviews followed by root synthesis.
No supported introduced finding.
Static source review; tests were inspected but not executed. CI, mergeability and integration are separate.
alandelong-oai
left a comment
There was a problem hiding this comment.
Reviewed the complete contribution and changed tests with three independent review passes plus root synthesis. No supported introduced finding remains at this head. This is a static source review; tests were not executed, and CI and integration remain separate.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a357a272fe
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
zcrab-oai
left a comment
There was a problem hiding this comment.
Reviewed the diff and relevant surrounding code at c812165, with an independent second pass. No obvious correctness or regression issues found. Full local platform suites were not rerun. CI still has failed, canceled, or unfinished checks; those results remain separate from this source-review approval.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6913c527eb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| archiveExisting: arguments_.archiveExisting, | ||
| parentScanId: arguments_.parentScanId, | ||
| expectedPluginVersion: arguments_.expectedPluginVersion, | ||
| onUsage: (usage) => dashboard?.setUsage(usage), |
There was a problem hiding this comment.
Forward usage into headless scan progress
For the main scan command under --headless, CI, or a non-TTY, dashboard is null, so this callback discards every usage update. With an unpriced model, ScanCostTracker never invokes onCost, leaving the headless progress output without token updates; moreover, the completion summary formats only result.turnResult.usage, which can omit usage from delegated worker sessions that the tracker aggregated. Preserve the latest usage and render it through the headless progress path independently of cost.
Useful? React with 👍 / 👎.
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
…/codex/dashboard-performance
zcrab-oai
left a comment
There was a problem hiding this comment.
Reviewed the diff and relevant callers at b6e5cbc, with an independent second pass. No actionable findings.
Focused validation: 206 cost/activity/dashboard/history tests passed, 1,818 assertions, after source plugin projection and pinned dependencies were made available.
Validation limits: Source review used the exact recorded head, not the current checkout. Full cross-platform/integration suites were not rerun.
Current CI is green.
Summary
Replaying a busy scan could redraw the terminal for every event, and usage polling reopened unchanged session files. Keep the dashboard responsive while showing observed token usage even when the selected model has no price entry.
Changes
Coalesce replay frames, reuse activity layouts and Unicode measurements, and read session files only when they grow. Keep complete output scrollable without splitting graphemes or losing wide characters in narrow terminals.
Add an optional SDK
onUsageobserver and componentusageevent, with the usage type exported from the package root. Headless component output renders each usage update once; cost events update only the estimate. Main scan progress also shows live usage without pricing, while paired usage and cost updates preserve the existing cost and budget messages. Also correct history counts, severity ordering, key handling, terminal padding, and verification viewport sizing. Explicit null usage heartbeats remain valid; malformed records retain warnings. Use the existing upstream terminal-control parser to prevent repeated incomplete OSC sequences from stalling dashboard redraws.Testing
b6e5cbcon main00a3f1c: the three conflicting CLI progress/usage cases passed with 31 assertions; the boolean cases now have distinct test names. Complete SDK/MCP types, SDK formatting, plugin build, and all five portable source checks passed.9ffa99ecomposes cleanly and changes only MCP migration-test expectations; production, dependencies, native inputs, and package inputs are unchanged. The branch and review remain bound to the testedb6e5cbc/00a3f1cpair.12345. Three independent native review passes and a distinct verifier completed with no actionable findings. No new full SDK run is claimed for this merge.f4b634d: seeds12345and3674888116each passed 4,078 tests with 67 skips, 0 failures, and 74,427 assertions. Subsequent focused integration checks and the prior publishedd07fd36hosted CI were green. These results retain their original source attribution; the new public head still needs hosted platform checks.The existing regressions cover coalesced replay frames, large Unicode scrollback, unchanged and growing rollouts, unpriced token usage, observer failures, and paired usage/cost rendering. Current checks use synthetic fixtures on Linux; they do not establish live-scan performance or replace hosted Windows and macOS checks.
Risk and rollout
The SDK observer and component event are additive. CLI syntax and defaults are unchanged, and pricing and budget enforcement remain independent of usage display.
string-widthandstrip-ansibecome direct dependencies at versions already used transitively. The upstream parser treats an unexpected escape inside an OSC control string as an interruption; surrounding visible diagnostic text is retained instead of being swallowed through a later terminator.Public disclosure review