Count tool-call argument streaming as generation time - #4
Merged
Merged
Conversation
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.
Count the time a model spends writing a tool call's arguments as generation time. Ships as 0.3.3.
Problem
Tool-call arguments (e.g. a file's contents for
write) are generated tokens and OpenCode counts them in the step's output, but the stream marks only watched text and reasoning deltas. Tokens were divided by too short a window: awritestep showed 3,672 tokens "at 162.9 tok/s" against the engine's 36.4 for the turn, and the Session average read 55.1. Affects OpenCode-derived figures (universal line, per-step rates, Session speed), not engine figures.Fix
Mark
session.tool.input.startedand.ended(and.delta, kept in case it is forwarded later).Measured (MTPLX, OpenCode 2.0.12)
session.tool.input.deltareaches the plugin 0 times per step, so deltas alone did not fix it (37.7 vs 32.4).step.streamed.Debug-only: a per-step
stream windowline compares the window's end withstep.streamed.