summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAiden Cline <[email protected]>2025-11-07 13:59:18 -0600
committerAiden Cline <[email protected]>2025-11-07 14:00:18 -0600
commit090d27df11a718cff3453a38da22d8a5eb405631 (patch)
tree4f69e0ed6f4b7ff62d0348d549f32e1f2428da7a
parentb374a6cac950759eaf14e668e8517bb7abfc32d5 (diff)
downloadopencode-090d27df11a718cff3453a38da22d8a5eb405631.tar.gz
opencode-090d27df11a718cff3453a38da22d8a5eb405631.zip
chore: rm debug logs
-rw-r--r--packages/opencode/src/mcp/index.ts12
1 files changed, 2 insertions, 10 deletions
diff --git a/packages/opencode/src/mcp/index.ts b/packages/opencode/src/mcp/index.ts
index eddd19249..149cd76f6 100644
--- a/packages/opencode/src/mcp/index.ts
+++ b/packages/opencode/src/mcp/index.ts
@@ -223,11 +223,10 @@ export namespace MCP {
}
const result = await withTimeout(mcpClient.tools(), mcp.timeout ?? 5000).catch((err) => {
- log.error("create() failed to get tools from client", { key, error: err })
+ log.error("failed to get tools from client", { key, error: err })
return undefined
})
if (!result) {
- log.info("create() tools() returned nothing, closing client", { key })
await mcpClient.close().catch((error) => {
log.error("Failed to close MCP client", {
error,
@@ -258,18 +257,14 @@ export namespace MCP {
}
export async function clients() {
- const s = await state()
- log.info("clients() called", { clientCount: Object.keys(s.clients).length })
- return s.clients
+ return state().then((state) => state.clients)
}
export async function tools() {
const result: Record<string, Tool> = {}
const s = await state()
- log.info("tools() called", { clientCount: Object.keys(s.clients).length })
const clientsSnapshot = await clients()
for (const [clientName, client] of Object.entries(clientsSnapshot)) {
- log.info("tools() fetching tools for client", { clientName })
const tools = await client.tools().catch((e) => {
log.error("failed to get tools", { clientName, error: e.message })
const failedStatus = {
@@ -280,17 +275,14 @@ export namespace MCP {
delete s.clients[clientName]
})
if (!tools) {
- log.info("tools() no tools returned for client", { clientName })
continue
}
- log.info("tools() got tools for client", { clientName, toolCount: Object.keys(tools).length })
for (const [toolName, tool] of Object.entries(tools)) {
const sanitizedClientName = clientName.replace(/[^a-zA-Z0-9_-]/g, "_")
const sanitizedToolName = toolName.replace(/[^a-zA-Z0-9_-]/g, "_")
result[sanitizedClientName + "_" + sanitizedToolName] = tool
}
}
- log.info("tools() final result", { toolCount: Object.keys(result).length })
return result
}
}