fix(confirmation): use type guard for ToolConfirmationPayload union type

Replace direct property access with 'in' operator to properly narrow the
union type, fixing TypeScript compilation error.
This commit is contained in:
Philippe GRANGER
2026-02-04 16:16:36 +01:00
parent fa4623204a
commit 37dabd873a

View File

@@ -171,7 +171,7 @@ export async function resolveConfirmation(
// This prevents the infinite loop issue reported in #7669
outcome = ToolConfirmationOutcome.Cancel;
}
} else if (response.payload?.newContent) {
} else if (response.payload && 'newContent' in response.payload) {
await handleInlineModification(deps, toolCall, response.payload, signal);
outcome = ToolConfirmationOutcome.ProceedOnce;
}