Fix tool call guard lint

Amolith created

Use optional chaining in tool call guards to satisfy the updated Biome
rule while preserving the existing failure path for missing tool calls.

Change summary

packages/answer/src/extract.ts             | 2 +-
packages/handoff/src/handoff-extraction.ts | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

Detailed changes

packages/answer/src/extract.ts 🔗

@@ -27,7 +27,7 @@ export function resolveExtractionModel(ctx: ExtensionContext, fallback: NonNulla
 export function parseToolCallResult(response: Awaited<ReturnType<typeof complete>>): ExtractionResult | null {
 	const toolCall = response.content.find((c) => c.type === "toolCall" && c.name === "extract_questions");
 
-	if (!toolCall || toolCall.type !== "toolCall") {
+	if (toolCall?.type !== "toolCall") {
 		console.error("Model did not call extract_questions:", response.content);
 		return null;
 	}

packages/handoff/src/handoff-extraction.ts 🔗

@@ -105,7 +105,7 @@ export async function extractHandoffContext(
 
 	const toolCall = response.content.find((c) => c.type === "toolCall" && c.name === "extract_handoff_context");
 
-	if (!toolCall || toolCall.type !== "toolCall") {
+	if (toolCall?.type !== "toolCall") {
 		console.error("Model did not call extract_handoff_context:", response.content);
 		return null;
 	}