YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context
Rust agentsagiaiai-memoryaudio-recordingcomputer-visionhermeshermes-agentllmlocal-ailocal-firstmachine-learningmcpmultimodalopenclawprivacyrewindscreen-recordingspeech-to-textycombinator
feat: show tool call indicators in pipe run output
Louis Beaumontdda33a6a7cd8
diff --git a/apps/screenpipe-app-tauri/components/__tests__/clean-pipe-stdout.test.ts b/apps/screenpipe-app-tauri/components/__tests__/clean-pipe-stdout.test.tsindex 44491ecda..9e93636f7 100644--- a/apps/screenpipe-app-tauri/components/__tests__/clean-pipe-stdout.test.ts+++ b/apps/screenpipe-app-tauri/components/__tests__/clean-pipe-stdout.test.ts@@ -225,13 +225,13 @@ describe("cleanPipeStdout", () => {it("passes through plain text for non-JSON pipes", () => {const stdout = "task completed successfully\n3 items processed\n";expect(cleanPipeStdout(stdout)).toBe(- "task completed successfully3 items processed"+ "task completed successfully\n\n3 items processed");});it("filters out lines with quotes (JSON fragments) in plain text mode", () => {const stdout = 'some plain text\n"ocr","content": {"text": "hello"}\nanother line\n';- expect(cleanPipeStdout(stdout)).toBe("some plain textanother line");+ expect(cleanPipeStdout(stdout)).toBe("some plain text\n\nanother line");});// ─── does not double-count text ──────────────────────────────────────diff --git a/apps/screenpipe-app-tauri/components/settings/pipes-section.tsx b/apps/screenpipe-app-tauri/components/settings/pipes-section.tsxindex 33eacfb42..0943fabfc 100644--- a/apps/screenpipe-app-tauri/components/settings/pipes-section.tsx+++ b/apps/screenpipe-app-tauri/components/settings/pipes-section.tsx@@ -413,9 +413,17 @@ function formatDuration(ms: number): string {* - LLM errors (credits_exhausted, rate limits, etc.) */export function cleanPipeStdout(raw: string): string {const parts: string[] = [];+ let textBuf = ""; // accumulates text_delta fragmentslet errorMessage: string | null = null;let hasTextDelta = false;+ function flushText() {+ if (textBuf) {+ parts.push(textBuf);+ textBuf = "";+ }+ }+for (const line of raw.split("\n")) {const trimmed = line.trim();if (!trimmed) continue;@@ -437,11 +445,14 @@ export function cleanPipeStdout(raw: string): string {// text_delta — the main assistant text streamif (ae.type === "text_delta" && ae.delta) {- parts.push(ae.delta);+ textBuf += ae.delta;hasTextDelta = true;}- // All other sub-types skipped: thinking_start, thinking_delta,- // thinking_end, text_start, text_end, toolcall_start/delta/end+ // tool call — show a brief indicator so the user sees what the agent did+ if (ae.type === "toolcall_start" && ae.toolName) {+ flushText();+ parts.push(`> *running \`${ae.toolName}\`...*`);+ }continue;}@@ -449,6 +460,7 @@ export function cleanPipeStdout(raw: string): string {// Text content is skipped because text_delta already streamed it// (extracting both would double-count).if (evtType === "message_start" || evtType === "message_end") {+ flushText();const msg = evt.message;if (msg?.role !== "assistant") continue;if (msg.stopReason === "error" && msg.errorMessage) {@@ -516,6 +528,7 @@ export function cleanPipeStdout(raw: string): string {parts.push(trimmed);}+ flushText();const text = parts.join("\n\n").trim();if (!text && errorMessage) {return `error: ${errorMessage}`;