fix: add node tool failure context

This commit is contained in:
Peter Steinberger
2026-01-21 09:54:58 +00:00
parent 40646c73af
commit 63d017c3af
2 changed files with 327 additions and 311 deletions

View File

@@ -9,6 +9,7 @@ Docs: https://docs.clawd.bot
- Exec approvals: support wildcard agent allowlists (`*`) across all agents.
### Fixes
- Nodes tool: include agent/node/gateway context in tool failure logs to speed approval debugging.
- UI: remove the chat stop button and keep the composer aligned to the bottom edge.
## 2026.1.20

View File

@@ -112,6 +112,7 @@ export function createNodesTool(options?: {
timeoutMs: typeof params.timeoutMs === "number" ? params.timeoutMs : undefined,
};
try {
switch (action) {
case "status":
return jsonResult(await callGatewayTool("node.list", gatewayOpts, {}));
@@ -262,7 +263,8 @@ export function createNodesTool(options?: {
case "camera_clip": {
const node = readStringParam(params, "node", { required: true });
const nodeId = await resolveNodeId(gatewayOpts, node);
const facing = typeof params.facing === "string" ? params.facing.toLowerCase() : "front";
const facing =
typeof params.facing === "string" ? params.facing.toLowerCase() : "front";
if (facing !== "front" && facing !== "back") {
throw new Error("invalid facing (front|back)");
}
@@ -441,6 +443,19 @@ export function createNodesTool(options?: {
default:
throw new Error(`Unknown action: ${action}`);
}
} catch (err) {
const nodeLabel =
typeof params.node === "string" && params.node.trim() ? params.node.trim() : "auto";
const gatewayLabel =
gatewayOpts.gatewayUrl && gatewayOpts.gatewayUrl.trim()
? gatewayOpts.gatewayUrl.trim()
: "default";
const agentLabel = agentId ?? "unknown";
const message = err instanceof Error ? err.message : String(err);
throw new Error(
`agent=${agentLabel} node=${nodeLabel} gateway=${gatewayLabel} action=${action}: ${message}`,
);
}
},
};
}