499
return tc;
500
}
501
>
// A tool call in `auth-required` can only be completed with a failed
reducer.ts
502
>
// result — that's the client cancelling the invocation instead of
503
>
// resolving the pending MCP authentication challenge. A *successful*
504
>
// completion from `auth-required` is invalid: execution never
505
>
// resumed after the challenge, so there's nothing that could have
506
>
// produced a real result. The reducer ignores it, leaving the tool
507
>
// call in `auth-required`; the client must resolve the auth
508
>
// challenge (`chat/toolCallAuthResolved`) before completing
509
>
// successfully.
510
if (tc.status === ToolCallStatus.AuthRequired && action.result.success) {
511
return tc;
512
}
513
>
const base = tcBaseWithMeta(tc, action._meta);
reducer.ts
514
>
const confirmed = tc.status === ToolCallStatus.Running || tc.status === ToolCallStatus.AuthRequired
515
>
? tc.confirmed
516
: ToolCallConfirmationReason.NotNeeded;
517
const selectedOption = tc.status === ToolCallStatus.Running || tc.status === ToolCallStatus.AuthRequired
519
: undefined;
520
// Preserve any partial content produced before the call paused for