@@ -21,7 +21,7 @@ import {
2121 makeBootstrapWarn as makeBootstrapWarnImpl ,
2222 resolveBootstrapContextForRun as resolveBootstrapContextForRunImpl ,
2323} from "../bootstrap-files.js" ;
24- import { resolveCliAuthEpoch } from "../cli-auth-epoch.js" ;
24+ import { CLI_AUTH_EPOCH_VERSION , resolveCliAuthEpoch } from "../cli-auth-epoch.js" ;
2525import { resolveCliBackendConfig } from "../cli-backends.js" ;
2626import { hashCliSessionText , resolveCliSessionReuse } from "../cli-session.js" ;
2727import { resolveHeartbeatPromptForSystemPrompt } from "../heartbeat-system-prompt.js" ;
@@ -188,15 +188,16 @@ export async function prepareCliRunContext(
188188 modelId,
189189 authProfileId : effectiveAuthProfileId ,
190190 } ) ;
191+ const skipLocalCredentialEpoch = shouldSkipLocalCliCredentialEpoch ( {
192+ authEpochMode : backendResolved . authEpochMode ,
193+ authProfileId : effectiveAuthProfileId ,
194+ authCredential,
195+ preparedExecution,
196+ } ) ;
191197 const authEpoch = await resolveCliAuthEpoch ( {
192198 provider : params . provider ,
193199 authProfileId : effectiveAuthProfileId ,
194- skipLocalCredential : shouldSkipLocalCliCredentialEpoch ( {
195- authEpochMode : backendResolved . authEpochMode ,
196- authProfileId : effectiveAuthProfileId ,
197- authCredential,
198- preparedExecution,
199- } ) ,
200+ skipLocalCredential : skipLocalCredentialEpoch ,
200201 } ) ;
201202 const preparedBackendEnv =
202203 preparedExecution ?. env && Object . keys ( preparedExecution . env ) . length > 0
@@ -232,6 +233,7 @@ export async function prepareCliRunContext(
232233 binding : params . cliSessionBinding ,
233234 authProfileId : effectiveAuthProfileId ,
234235 authEpoch,
236+ authEpochVersion : CLI_AUTH_EPOCH_VERSION ,
235237 extraSystemPromptHash,
236238 mcpConfigHash : preparedBackendFinal . mcpConfigHash ,
237239 mcpResumeHash : preparedBackendFinal . mcpResumeHash ,
@@ -332,6 +334,7 @@ export async function prepareCliRunContext(
332334 bootstrapPromptWarningLines : bootstrapPromptWarning . lines ,
333335 heartbeatPrompt,
334336 authEpoch,
337+ authEpochVersion : CLI_AUTH_EPOCH_VERSION ,
335338 extraSystemPromptHash,
336339 } ;
337340}
0 commit comments