Skip to content

fix(tui): exclude buffered bursts from the output rate at turn start - #454

Merged
hetaoBackend merged 1 commit into
mainfrom
fix/tui-output-rate-buffered-burst
Oct 8, 2026
Merged

hetaoBackend merged 1 commit into
mainfrom
fix/tui-output-rate-buffered-burst

Conversation

@hetaoBackend

@hetaoBackend hetaoBackend commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

The output-speed readout could spike at the very start of a turn. When a provider buffers upstream output and releases it in one burst, the decode window for that burst says nothing about model speed, but its tokens were still folded into the rate — so the first reported value was far above the model's real throughput.

A sample is now treated as a buffered burst when its decode window is under 10% of the request duration and its implied speed exceeds 1000 tok/s, and such samples are dropped instead of aggregated. Genuinely fast providers are unaffected: a 1900 tok/s sample spread over most of its request still counts.

Changes

  • packages/tui/src/tui/controller/projection/turn-output-rate.ts — drop buffered burst samples before aggregation
  • packages/tui/test/unit/tui/controller/projection/turn-output-rate.test.ts — cover burst, instant-burst, normal and fast-provider cases

Validation

  • turn-output-rate.test.ts: 11 passed (1 new case)
  • eslint on both changed files: clean
  • tsc --noEmit -p tsconfig.standalone.json: clean
  • Full capability gate: 5035 passed. The 340 failures in that gate are pre-existing and unrelated — an untouched main run in the same environment produces the identical 16 failed files / 340 failed tests, caused by a missing better-sqlite3 native binding in this sandbox.

Notes

This is a port of an internally released fix. The public distribution has no per-session subagent concurrency limit, so the two related changes shipped alongside it internally do not apply here.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant