Explorar o código

cli: prefix reasoning output with 'Thinking:' and use trimEnd()

Dax Raad hai 2 meses
pai
achega
2a38007101
Modificáronse 1 ficheiros con 4 adicións e 3 borrados
  1. 4 3
      packages/opencode/src/cli/cmd/run.ts

+ 4 - 3
packages/opencode/src/cli/cmd/run.ts

@@ -416,15 +416,16 @@ export const RunCommand = cmd({
 
 
             if (part.type === "reasoning" && part.time?.end) {
             if (part.type === "reasoning" && part.time?.end) {
               if (emit("reasoning", { part })) continue
               if (emit("reasoning", { part })) continue
-              const text = part.text.trim()
+              const text = part.text.trimEnd()
               if (!text) continue
               if (!text) continue
+              const line = `Thinking: ${text}`
               if (process.stdout.isTTY) {
               if (process.stdout.isTTY) {
                 UI.empty()
                 UI.empty()
-                UI.println(`\u001b[3m${text}\u001b[0m`)
+                UI.println(`\u001b[3m${line}\u001b[0m`)
                 UI.empty()
                 UI.empty()
                 continue
                 continue
               }
               }
-              process.stdout.write(text + EOL)
+              process.stdout.write(line + EOL)
             }
             }
           }
           }