@@ -1956,7 +1956,6 @@ export class Task extends EventEmitter<TaskEvents> implements TaskLike {
19561956 maxReadFileLine = - 1 ,
19571957 maxReadCharacterLimit = 20000 ,
19581958 apiRequestBlockHide = true ,
1959- apiConfiguration,
19601959 } = ( await this . providerRef . deref ( ) ?. getState ( ) ) ?? { }
19611960
19621961 await this . say (
@@ -1967,7 +1966,10 @@ export class Task extends EventEmitter<TaskEvents> implements TaskLike {
19671966 : currentUserContent . map ( ( block ) => formatContentBlockToMarkdown ( block ) ) . join ( "\n\n" ) +
19681967 "\n\nLoading..." ,
19691968 apiProtocol,
1970- originModelId : apiConfiguration ?. zgsmModelId ,
1969+ originModelId :
1970+ this . apiConfiguration ?. apiProvider === "zgsm"
1971+ ? this . apiConfiguration ?. zgsmModelId
1972+ : this . apiConfiguration ?. apiModelId ,
19711973 } ) ,
19721974 )
19731975
@@ -2010,7 +2012,10 @@ export class Task extends EventEmitter<TaskEvents> implements TaskLike {
20102012 ? undefined
20112013 : finalUserContent . map ( ( block ) => formatContentBlockToMarkdown ( block ) ) . join ( "\n\n" ) ,
20122014 apiProtocol,
2013- originModelId : apiConfiguration ?. zgsmModelId ,
2015+ originModelId :
2016+ this . apiConfiguration ?. apiProvider === "zgsm"
2017+ ? this . apiConfiguration ?. zgsmModelId
2018+ : this . apiConfiguration ?. apiModelId ,
20142019 } satisfies ClineApiReqInfo )
20152020
20162021 await this . saveClineMessages ( )
@@ -2067,6 +2072,10 @@ export class Task extends EventEmitter<TaskEvents> implements TaskLike {
20672072 cost : totalCost ?? costResult . totalCost ,
20682073 cancelReason,
20692074 streamingFailedMessage,
2075+ originModelId :
2076+ this . apiConfiguration ?. apiProvider === "zgsm"
2077+ ? this . apiConfiguration ?. zgsmModelId
2078+ : this . apiConfiguration ?. apiModelId ,
20702079 } satisfies ClineApiReqInfo )
20712080 }
20722081
@@ -2195,7 +2204,7 @@ export class Task extends EventEmitter<TaskEvents> implements TaskLike {
21952204 case "automodel" : {
21962205 // Check if it is Selected LLM information (only in Auto model mode).
21972206 if (
2198- this . apiConfiguration . apiProvider === "zgsm" &&
2207+ this . apiConfiguration ? .apiProvider === "zgsm" &&
21992208 lastApiReqIndex >= 0 &&
22002209 this . clineMessages [ lastApiReqIndex ]
22012210 ) {
@@ -3169,6 +3178,7 @@ export class Task extends EventEmitter<TaskEvents> implements TaskLike {
31693178 const metadata : ApiHandlerCreateMessageMetadata = {
31703179 mode : mode ,
31713180 zgsmCodeMode,
3181+ provider : this . apiConfiguration . apiProvider ,
31723182 zgsmWorkflowMode : this . zgsmWorkflowMode ,
31733183 rooTaskMode : this ?. rootTask ?. _taskMode ,
31743184 parentTaskMode : this ?. parentTask ?. _taskMode ,
@@ -3199,7 +3209,7 @@ export class Task extends EventEmitter<TaskEvents> implements TaskLike {
31993209 yield firstChunk . value
32003210 this . isWaitingForFirstChunk = false
32013211 } catch ( error ) {
3202- const isZgsm = apiConfiguration ?. apiProvider === "zgsm"
3212+ const isZgsm = this . apiConfiguration ?. apiProvider === "zgsm"
32033213 let errorMsg = ""
32043214 if ( isZgsm ) {
32053215 const errorCodeManager = ErrorCodeManager . getInstance ( )
0 commit comments