Skip to content

fix(dashboard): keep dashboards responsive and show observed usage - #1276

Merged
mldangelo-oai merged 32 commits into
mainfrom
mdangelo/codex/dashboard-performance
Oct 11, 2026
Merged

mldangelo-oai merged 32 commits into
mainfrom
mdangelo/codex/dashboard-performance

Conversation

@mldangelo-oai

@mldangelo-oai mldangelo-oai commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

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 onUsage observer and component usage event, 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

  • Final b6e5cbc on main 00a3f1c: 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.
  • Current Python usage consumer: 30 passed and 2 platform skips.
  • Later main 9ffa99e composes 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 tested b6e5cbc/00a3f1c pair.
  • The current package passed source, archive, and installed-package smoke checks. Its 551 archive entries include all 14 verified current native payloads; all 916 tracked source paths and executable modes were checked against the final commit.
  • Complete affected SDK consumer group: 1,007 passed, 4 platform skips, 0 failures, and 46,264 assertions across 18 files, seed 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.
  • Historical full SDK runs on f4b634d: seeds 12345 and 3674888116 each passed 4,078 tests with 67 skips, 0 failures, and 74,427 assertions. Subsequent focused integration checks and the prior published d07fd36 hosted 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-width and strip-ansi become 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

  • No customer, partner, prospect, or user identities, data, or identifying details are included.
  • No credentials, personal data, private source, scan findings, or nonpublic links or tickets are included.
  • I reviewed the branch name, title, description, commits, changes, comments, logs, screenshots, attachments, and links for public disclosure.

@github-actions github-actions Bot added the bug Something isn't working label Oct 5, 2026
@mldangelo-oai
mldangelo-oai marked this pull request as ready for review October 5, 2026 14:52
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-10T13:48:58.139927Z a177d7d New commits
🔒 Security Review ✅ Completed 2026-10-10T13:49:39.607611Z a177d7d New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread sdk/typescript/src/api.ts Resolved
Comment thread sdk/typescript/src/scan-dashboard.ts Resolved
Comment thread sdk/typescript/src/component-scan.ts Resolved

@alandelong-oai alandelong-oai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 alandelong-oai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread sdk/typescript/src/scan-dashboard.ts Resolved

@zcrab-oai zcrab-oai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread sdk/typescript/src/cli.ts Outdated
archiveExisting: arguments_.archiveExisting,
parentScanId: arguments_.parentScanId,
expectedPluginVersion: arguments_.expectedPluginVersion,
onUsage: (usage) => dashboard?.setUsage(usage),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: 5320a8a61e

ℹ️ 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".

@mldangelo-oai mldangelo-oai changed the title fix(cli): keep dashboards responsive and show observed usage fix(dashboard): keep dashboards responsive and show observed usage Oct 8, 2026
@mldangelo-oai mldangelo-oai added area:cli Command-line help, arguments, terminal UI, and user interaction. area:cost Token usage, cost estimates, spending limits, and quota visibility. area:integrations SDK/API surfaces, MCP integrations, hooks, and external application connections. and removed area:cost Token usage, cost estimates, spending limits, and quota visibility. area:cli Command-line help, arguments, terminal UI, and user interaction. area:integrations SDK/API surfaces, MCP integrations, hooks, and external application connections. labels Oct 8, 2026

@zcrab-oai zcrab-oai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@mldangelo-oai
mldangelo-oai merged commit 3ede902 into main Oct 11, 2026
68 checks passed
@mldangelo-oai
mldangelo-oai deleted the mdangelo/codex/dashboard-performance branch October 11, 2026 19:25
@github-actions github-actions Bot mentioned this pull request Oct 11, 2026
3 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants