fix: remove all console.log/warn to avoid breaking TUI

This commit is contained in:
Vectry
2026-02-10 13:46:55 +00:00
parent 638a5d2640
commit 07cf717c15
4 changed files with 9 additions and 20 deletions

View File

@@ -1,6 +1,6 @@
{ {
"name": "opencode-agentlens", "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", "description": "OpenCode plugin for AgentLens — trace your coding agent's decisions, tool calls, and sessions",
"type": "module", "type": "module",
"main": "./dist/index.cjs", "main": "./dist/index.cjs",

View File

@@ -22,11 +22,10 @@ const plugin: Plugin = async ({ project, directory, worktree }) => {
const config = loadConfig(); const config = loadConfig();
if (!config.enabled || !config.apiKey) { if (!config.enabled || !config.apiKey) {
console.log("[agentlens] Plugin disabled — missing AGENTLENS_API_KEY");
return {}; return {};
} }
console.log(`[agentlens] Plugin enabled — endpoint: ${config.endpoint}`);
init({ init({
apiKey: config.apiKey, apiKey: config.apiKey,
@@ -62,7 +61,7 @@ const plugin: Plugin = async ({ project, directory, worktree }) => {
worktree, worktree,
title: info?.["title"] as string | undefined, 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) { if (sessionId) {
state.endSession(sessionId); state.endSession(sessionId);
await flush(); await flush();
console.log(`[agentlens] Session ended and flushed: ${sessionId}`);
} }
} }
@@ -157,9 +156,7 @@ const plugin: Plugin = async ({ project, directory, worktree }) => {
directory, directory,
worktree, worktree,
}); });
console.log(
`[agentlens] Auto-created session from tool call: ${input.sessionID}`,
);
} }
state.startToolCall( state.startToolCall(
input.callID, input.callID,
@@ -186,9 +183,7 @@ const plugin: Plugin = async ({ project, directory, worktree }) => {
directory, directory,
worktree, worktree,
}); });
console.log(
`[agentlens] Auto-created session from chat.message: ${input.sessionID}`,
);
} }
if (input.model) { if (input.model) {
state.recordLLMCall(input.sessionID, { state.recordLLMCall(input.sessionID, {

View File

@@ -1,6 +1,6 @@
{ {
"name": "agentlens-sdk", "name": "agentlens-sdk",
"version": "0.1.2", "version": "0.1.3",
"description": "AgentLens TypeScript SDK — Agent observability that traces decisions, not just API calls.", "description": "AgentLens TypeScript SDK — Agent observability that traces decisions, not just API calls.",
"type": "module", "type": "module",
"main": "./dist/index.cjs", "main": "./dist/index.cjs",

View File

@@ -68,15 +68,9 @@ export class BatchTransport {
}); });
if (!response.ok) { if (!response.ok) {
const text = await response.text().catch(() => ""); await response.text().catch(() => "");
console.warn(
`AgentLens: Failed to send traces (HTTP ${response.status}): ${text.slice(0, 200)}`,
);
} }
} catch (error: unknown) { } catch {
const message =
error instanceof Error ? error.message : String(error);
console.warn(`AgentLens: Failed to send traces: ${message}`);
} }
} }
} }