515
? tc.confirmed
516
: ToolCallConfirmationReason.NotNeeded;
517
>
const selectedOption = tc.status === ToolCallStatus.Running || tc.status === ToolCallStatus.AuthRequired
reducer.ts
518
? tc.selectedOption
519
: undefined;
520
>
// Preserve any partial content produced before the call paused for
reducer.ts
521
>
// auth — a client cancelling from `auth-required` without
522
>
// authenticating never resumes execution, so this is the only
523
>
// content the tool ever produced unless `action.result` overrides it.
524
>
const preAuthContent = tc.status === ToolCallStatus.AuthRequired ? tc.content : undefined;
525
>
// Cancelling from `auth-required` always completes terminally: the
526
>
// pending auth challenge isn't a "pending result" the client can
527
>
// review, so `requiresResultConfirmation` is ignored for this path —
528
>
// it must never enter `pending-result-confirmation`.
529
>
if (action.requiresResultConfirmation && tc.status !== ToolCallStatus.AuthRequired) {
530
return {
531
status: ToolCallStatus.PendingResultConfirmation,