mirror of
https://github.com/clawdbot/clawdbot.git
synced 2026-02-01 03:47:45 +01:00
fix: add node tool failure context
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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}`,
|
||||
);
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user