From 07cf717c1531a36dcaa1f55b3b6e2baded31f8f8 Mon Sep 17 00:00:00 2001 From: Vectry Date: Tue, 10 Feb 2026 13:46:55 +0000 Subject: [PATCH] fix: remove all console.log/warn to avoid breaking TUI --- packages/opencode-plugin/package.json | 2 +- packages/opencode-plugin/src/index.ts | 15 +++++---------- packages/sdk-ts/package.json | 2 +- packages/sdk-ts/src/transport.ts | 10 ++-------- 4 files changed, 9 insertions(+), 20 deletions(-) diff --git a/packages/opencode-plugin/package.json b/packages/opencode-plugin/package.json index 6728f7f..93adb7e 100644 --- a/packages/opencode-plugin/package.json +++ b/packages/opencode-plugin/package.json @@ -1,6 +1,6 @@ { "name": "opencode-agentlens", - "version": "0.1.5", + "version": "0.1.6", "description": "OpenCode plugin for AgentLens — trace your coding agent's decisions, tool calls, and sessions", "type": "module", "main": "./dist/index.cjs", diff --git a/packages/opencode-plugin/src/index.ts b/packages/opencode-plugin/src/index.ts index 42958a5..0ecbf45 100644 --- a/packages/opencode-plugin/src/index.ts +++ b/packages/opencode-plugin/src/index.ts @@ -22,11 +22,10 @@ const plugin: Plugin = async ({ project, directory, worktree }) => { const config = loadConfig(); if (!config.enabled || !config.apiKey) { - console.log("[agentlens] Plugin disabled — missing AGENTLENS_API_KEY"); return {}; } - console.log(`[agentlens] Plugin enabled — endpoint: ${config.endpoint}`); + init({ apiKey: config.apiKey, @@ -62,7 +61,7 @@ const plugin: Plugin = async ({ project, directory, worktree }) => { worktree, title: info?.["title"] as string | undefined, }); - console.log(`[agentlens] Session started: ${sessionId}`); + } } @@ -107,7 +106,7 @@ const plugin: Plugin = async ({ project, directory, worktree }) => { if (sessionId) { state.endSession(sessionId); await flush(); - console.log(`[agentlens] Session ended and flushed: ${sessionId}`); + } } @@ -157,9 +156,7 @@ const plugin: Plugin = async ({ project, directory, worktree }) => { directory, worktree, }); - console.log( - `[agentlens] Auto-created session from tool call: ${input.sessionID}`, - ); + } state.startToolCall( input.callID, @@ -186,9 +183,7 @@ const plugin: Plugin = async ({ project, directory, worktree }) => { directory, worktree, }); - console.log( - `[agentlens] Auto-created session from chat.message: ${input.sessionID}`, - ); + } if (input.model) { state.recordLLMCall(input.sessionID, { diff --git a/packages/sdk-ts/package.json b/packages/sdk-ts/package.json index 2639e1a..9b083e0 100644 --- a/packages/sdk-ts/package.json +++ b/packages/sdk-ts/package.json @@ -1,6 +1,6 @@ { "name": "agentlens-sdk", - "version": "0.1.2", + "version": "0.1.3", "description": "AgentLens TypeScript SDK — Agent observability that traces decisions, not just API calls.", "type": "module", "main": "./dist/index.cjs", diff --git a/packages/sdk-ts/src/transport.ts b/packages/sdk-ts/src/transport.ts index 48e51b1..4b6245a 100644 --- a/packages/sdk-ts/src/transport.ts +++ b/packages/sdk-ts/src/transport.ts @@ -68,15 +68,9 @@ export class BatchTransport { }); if (!response.ok) { - const text = await response.text().catch(() => ""); - console.warn( - `AgentLens: Failed to send traces (HTTP ${response.status}): ${text.slice(0, 200)}`, - ); + await response.text().catch(() => ""); } - } catch (error: unknown) { - const message = - error instanceof Error ? error.message : String(error); - console.warn(`AgentLens: Failed to send traces: ${message}`); + } catch { } } }