opencode-agent[bot] 3 месяцев назад
Родитель
Сommit
321db7a819
1 измененных файлов с 26 добавлено и 24 удалено
  1. 26 24
      packages/opencode/src/cli/cmd/github.ts

+ 26 - 24
packages/opencode/src/cli/cmd/github.ts

@@ -896,33 +896,35 @@ export const GithubRunCommand = effectCmd({
         }
 
         let text = ""
-        await runLocalEffect(busSvc.subscribeCallback(MessageV2.Event.PartUpdated, (evt) => {
-          if (evt.properties.part.sessionID !== session.id) return
-          //if (evt.properties.part.messageID === messageID) return
-          const part = evt.properties.part
-
-          if (part.type === "tool" && part.state.status === "completed") {
-            const [tool, color] = TOOL[part.tool] ?? [part.tool, UI.Style.TEXT_INFO_BOLD]
-            const title =
-              part.state.title || Object.keys(part.state.input).length > 0
-                ? JSON.stringify(part.state.input)
-                : "Unknown"
-            console.log()
-            printEvent(color, tool, title)
-          }
+        await runLocalEffect(
+          busSvc.subscribeCallback(MessageV2.Event.PartUpdated, (evt) => {
+            if (evt.properties.part.sessionID !== session.id) return
+            //if (evt.properties.part.messageID === messageID) return
+            const part = evt.properties.part
+
+            if (part.type === "tool" && part.state.status === "completed") {
+              const [tool, color] = TOOL[part.tool] ?? [part.tool, UI.Style.TEXT_INFO_BOLD]
+              const title =
+                part.state.title || Object.keys(part.state.input).length > 0
+                  ? JSON.stringify(part.state.input)
+                  : "Unknown"
+              console.log()
+              printEvent(color, tool, title)
+            }
 
-          if (part.type === "text") {
-            text = part.text
+            if (part.type === "text") {
+              text = part.text
 
-            if (part.time?.end) {
-              UI.empty()
-              UI.println(UI.markdown(text))
-              UI.empty()
-              text = ""
-              return
+              if (part.time?.end) {
+                UI.empty()
+                UI.println(UI.markdown(text))
+                UI.empty()
+                text = ""
+                return
+              }
             }
-          }
-        }))
+          }),
+        )
       }
 
       async function summarize(response: string) {