File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed
Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -54,12 +54,17 @@ function isReadableStream(response: any): response is ReadableStream {
5454 return response instanceof ReadableStream
5555}
5656
57- const ZERO_COST = Object . freeze ( { input : 0 , output : 0 , total : 0 } )
57+ const ZERO_COST = Object . freeze ( {
58+ input : 0 ,
59+ output : 0 ,
60+ total : 0 ,
61+ pricing : Object . freeze ( { input : 0 , output : 0 , updatedAt : '' } ) ,
62+ } )
5863
5964/**
60- * Zeros out cost on a StreamingExecution for BYOK users.
61- * Providers calculate cost inside streaming callbacks, so we override the cost
62- * property on execution.output to always return zero regardless of callback writes .
65+ * Prevents streaming callbacks from writing non-zero cost for BYOK users.
66+ * The property is frozen via defineProperty because providers set cost inside
67+ * streaming callbacks that fire after this function returns .
6368 */
6469function zeroCostForBYOK ( response : StreamingExecution ) : void {
6570 const output = response . execution ?. output
@@ -113,11 +118,6 @@ export async function executeProviderRequest(
113118 } )
114119 throw error
115120 }
116- } else {
117- logger . info ( 'No workspaceId provided, skipping BYOK check' , {
118- provider : providerId ,
119- model : request . model ,
120- } )
121121 }
122122
123123 resolvedRequest . isBYOK = isBYOK
You can’t perform that action at this time.
0 commit comments