Переглянути джерело

remove debug code writing to /tmp/message.json

Dax Raad 9 місяців тому
батько
коміт
3664b09812
1 змінених файлів з 3 додано та 21 видалено
  1. 3 21
      packages/opencode/src/session/index.ts

+ 3 - 21
packages/opencode/src/session/index.ts

@@ -248,7 +248,7 @@ export namespace Session {
       if (
         model.info.limit.context &&
         tokens >
-        (model.info.limit.context - (model.info.limit.output ?? 0)) * 0.9
+          (model.info.limit.context - (model.info.limit.output ?? 0)) * 0.9
       ) {
         await summarize({
           sessionID: input.sessionID,
@@ -295,7 +295,7 @@ export namespace Session {
               draft.title = result.text
             })
         })
-        .catch(() => { })
+        .catch(() => {})
     }
     const msg: Message.Info = {
       role: "user",
@@ -433,24 +433,6 @@ export namespace Session {
     }
 
     let text: Message.TextPart | undefined
-    await Bun.write(
-      "/tmp/message.json",
-      JSON.stringify(
-        [
-          ...system.map(
-            (x): CoreMessage => ({
-              role: "system",
-              content: x,
-            }),
-          ),
-          ...convertToCoreMessages(
-            msgs.map(toUIMessage).filter((x) => x.parts.length > 0),
-          ),
-        ],
-        null,
-        2,
-      ),
-    )
     const result = streamText({
       onStepFinish: async (step) => {
         log.info("step finish", { finishReason: step.finishReason })
@@ -572,7 +554,7 @@ export namespace Session {
           case "tool-call": {
             const [match] = next.parts.flatMap((p) =>
               p.type === "tool-invocation" &&
-                p.toolInvocation.toolCallId === value.toolCallId
+              p.toolInvocation.toolCallId === value.toolCallId
                 ? [p]
                 : [],
             )