Skip to content

The open source coding agent.

TypeScript

fix: task type error (#1384)

Aiden Clinec165360e17d5
diff --git a/packages/opencode/src/tool/task.ts b/packages/opencode/src/tool/task.ts
index 6d78daf73be..f245c777252 100644
--- a/packages/opencode/src/tool/task.ts
+++ b/packages/opencode/src/tool/task.ts
@@ -70,7 +70,7 @@ export const TaskTool = Tool.define("task", async () => {
metadata: {
summary: result.parts.filter((x) => x.type === "tool"),
},
- output: result.parts.findLast((x) => x.type === "text")!.text,
+ output: result.parts.findLast((x) => x.type === "text")?.text ?? "",
}
},
}