Przeglądaj źródła

fix task tool ui disappearing once done

Dax Raad 5 miesięcy temu
rodzic
commit
baaff81a06
1 zmienionych plików z 5 dodań i 1 usunięć
  1. 5 1
      packages/opencode/src/tool/task.ts

+ 5 - 1
packages/opencode/src/tool/task.ts

@@ -75,10 +75,14 @@ export const TaskTool = Tool.define("task", async () => {
         ],
         ],
       })
       })
       unsub()
       unsub()
+      let all
+      all = await Session.messages(session.id)
+      all = all.filter((x) => x.info.role === "assistant")
+      all = all.flatMap((msg) => msg.parts.filter((x: any) => x.type === "tool") as MessageV2.ToolPart[])
       return {
       return {
         title: params.description,
         title: params.description,
         metadata: {
         metadata: {
-          summary: result.parts.filter((x: any) => x.type === "tool"),
+          summary: all,
         },
         },
         output: (result.parts.findLast((x: any) => x.type === "text") as any)?.text ?? "",
         output: (result.parts.findLast((x: any) => x.type === "text") as any)?.text ?? "",
       }
       }