[Fix] Costs miss Fast mode inference usage - #1630
Draft
roomote-roomote[bot] wants to merge 3 commits into
Draft
Conversation
Contributor
|
No code issues found. See task
Reviewed 9ac3ba9 |
Contributor
Author
|
Fixed the remaining long-lived event-stream wait in 9ac3ba9: the final-event barrier now expires after one second, clears its waiter, and runs the bounded current-turn fallback. Regression coverage uses a non-terminating stream that omits the final event. Targeted tests pass (98), package typecheck and touched-file checks pass, and the full pre-push gates pass. |
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.
What changed
non-task:<source>:<session>:<message>idempotency key and original participant ownership.Why this change was made
Fast mode previously recorded only the final parent response. Intermediate parent turns and advisor/judge sessions incurred inference cost but were omitted from
llm_usage_events, causing Costs analytics to undercount Fast usage.Impact
Costs now includes the complete successful Fast turn without rewriting historical usage ownership or doing work proportional to the warm conversation's lifetime. OpenCode 1.18.10's
AssistantMessage/message.updatedcontract does not expose a stable provider request or generation identifier, so this PR does not guess one from untyped part metadata. The precise reconciliation follow-up is to expose that identifier in OpenCode's assistant-message event contract, then persist it in usage-event details (or dedicated columns if it becomes a query key) for matching against OpenRouter generation exports.Validation