Skip to content

revert: remove the stream throughput watchdog and the live tok/s working line (#1759) - #1761

Merged
code-yeongyu merged 2 commits into
mainfrom
fix/1759-remove-stream-throughput-watchdog
Sep 16, 2026
Merged

code-yeongyu merged 2 commits into
mainfrom
fix/1759-remove-stream-throughput-watchdog

Conversation

@code-yeongyu

@code-yeongyu code-yeongyu commented Sep 16, 2026

Copy link
Copy Markdown
Owner

Fixes #1759

Summary

Removes both halves of #1743 - the provider stream throughput watchdog and the live tok/s segment on the interactive working line - so that neither feature leaves a trace in code, settings, docs, the changelog or the tests.

Why

  • The floor fails healthy turns. A stream measured at 6.1 tok/s over the 20s window had its request aborted mid tool call, surfacing as a failed tool call plus the raw watchdog string. Thinking-heavy models and gateways that batch several tokens into one delta routinely sustain rates under the shipped 8 tok/s floor, so the guard converts a slow-but-correct answer into a hard failure and spends a fallback hop on it.
  • It cannot be softened where it is produced. The wording is simultaneously the retry classifier's token (packages/ai/src/utils/retry.ts), and the verdict aborts the request controller, so the partial answer is discarded rather than delivered slowly.
  • The readout has no remaining purpose. It existed to make the verdict observable while it was being measured; end-of-turn rate is still reported by the builtin TPS extension.

What changed

Reverts ced1dadeb1 and d04674187c (#1743) plus e5ab39dba8 (#1748, the test stub that existed only to feed the tok/s reader):

  • deleted packages/agent/src/stream-throughput-watchdog.ts, packages/agent/test/agent-loop-throughput-watchdog.test.ts, packages/coding-agent/test/suite/retry-fallback-throughput-degraded.test.ts;
  • AgentLoopConfig.streamThroughput / AgentOptions.streamThroughput, the index exports and the agent-loop reader wiring are gone, leaving the start-bound and idle-bound guards as before;
  • isProviderStreamThroughputDegradedError, the "provider stream throughput degraded" retryable alternation, the _handleRetryableError branch, the stream_throughput_degraded event and its notice box are gone;
  • retry.provider.minThroughputTokensPerSecond / throughputWindowMs / throughputGraceMs removed from the settings type, SettingsManager, core/sdk.ts, the test harness and docs/settings.md;
  • the working line is back to Working (<elapsed> • esc to interrupt);
  • the CHANGELOG bullet and the three changes.md sections are deleted rather than annotated, per the issue: this is a withdrawal, not a documented change.

Stall surfacing (#1740 / #1744) is deliberately untouched - silence is a different class with its own bounds and copy.

Verification


Summary by cubic

Fixes #1759 by reverting the stream throughput watchdog and the live tok/s working-line segment from #1743, so slow-but-alive streams finish instead of being aborted mid-answer. The 8 tok/s floor was tripping healthy turns from thinking-heavy models and batching gateways, and the abort discarded the partial answer; the rate readout existed only to make that verdict visible.

What changed

  • Deletes the watchdog module, its error type, the retry classification path, and their tests.
  • Removes streamThroughput and the retry.provider.minThroughputTokensPerSecond / throughputWindowMs / throughputGraceMs settings; existing values in user configs are now ignored.
  • Restores the working line to Working (<elapsed> • esc to interrupt).
  • Removes the docs rows and changelog entry, and updates fork-tracker notes to record the withdrawal.
  • Leaves silence-stall handling untouched.

Written for commit fedd1ab. Summary will update on new commits.

Review in cubic

@code-yeongyu code-yeongyu added the no-changelog No changelog required label Sep 16, 2026
@code-yeongyu

Copy link
Copy Markdown
Owner Author

Removal evidence (measured)

Tree state — reverts ced1dadeb1 + d04674187c (#1743) and e5ab39dba8 (#1748) at HEAD 73bd1577c2.

Focused suites — run on a second machine (macOS arm64, bun 1.4.2, vitest 4.1.11) from a worktree checked out at 73bd1577c2 (HEAD asserted equal to the pushed branch before running):

package files result
packages/agent agent-loop-stream-start-timeout, agent-loop-idle-timeout 6 passed (1 file)
packages/coding-agent interactive-mode-status, interactive-mode-working-status, settings-manager 168 passed (3 files)
packages/ai retry, provider-retry, retry-profile-classifiers 133 passed (3 files)
packages/coding-agent all 21 test/suite/retry-fallback*.test.ts 242 passed (21 files)
packages/coding-agent 5 stall suites (stream-start-stall-*, retry-fallback-stall-shared-budget, ...) 18 passed (5 files)

Stall handling (#1740) is verified intact by the last row: it is the silence class and keeps its own bounds, copy and shared retry budget.

One file-level failure, classified environmental, not a regression: packages/agent/test/agent-loop.test.ts fails to load with Cannot find package '@earendil-works/chord/context' imported from packages/agent/src/harness/context.ts. The same file fails identically on a BASE worktree of main (a7dee82bb1) in the same environment - the linked node_modules has chord unbuilt. It is a setup artifact of running vitest against a symlinked worktree, not something this diff touches; CI's own Test jobs are the authority.

Changelog gate: the PR carries no-changelog. The entry for #1739 was deleted from the released [2026.9.16-2] section (same treatment #1756 gave the #1754 entry) and no "Removed" note replaces it, because the decision is that the feature reads as never having shipped rather than as an added-then-removed behaviour.

…ing line

The rate guard shipped in #1743 fails healthy turns. A stream measured at
6.1 tok/s over the 20s window had its request aborted mid tool call, and
thinking-heavy models and gateways that batch several tokens into one delta
routinely sustain rates under the 8 tok/s floor. The verdict is also the
retry classifier's token, so it cannot be softened where it is produced, and
it aborts the request controller, discarding the partial answer instead of
delivering it slowly.

The live rate segment on the working line existed only to make that verdict
observable while it was being measured, so it goes with the watchdog;
end-of-turn rate is still reported by the builtin TPS extension.

Reverts #1743 (ced1dad, d046741) and its follow-up test stub #1748
(e5ab39d), including the settings knobs, the docs rows, the changelog
entry and the fork-tracking notes, so neither feature leaves a trace.
Silence stalls (#1740) are untouched: that is a different class with its own
bounds and its own copy.
…ckers

The changes.md trackers must cover every production path a PR touches, so
the removal needs an entry in each affected tracker saying these files are
back to their pre-guard shape. Without it the next upstream merge would
still expect fork-local throughput code that no longer exists.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog No changelog required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove the provider stream throughput watchdog and the live tok/s working-line readout

1 participant