summaryrefslogtreecommitdiffhomepage
path: root/packages
diff options
context:
space:
mode:
authorChristian Stewart <[email protected]>2025-12-10 15:12:49 -0800
committerGitHub <[email protected]>2025-12-10 17:12:49 -0600
commitcbb591eb7dfe8e27298945f10e5d6cfff4405630 (patch)
treebede7db1bbca3afc6efede3924f836665becea17 /packages
parente36c3492221cf8c225bddb6a74431254de8d54a3 (diff)
downloadopencode-cbb591eb7dfe8e27298945f10e5d6cfff4405630.tar.gz
opencode-cbb591eb7dfe8e27298945f10e5d6cfff4405630.zip
fix: more descriptive tool or subtask execution failed error (#5337)
Signed-off-by: Christian Stewart <[email protected]>
Diffstat (limited to 'packages')
-rw-r--r--packages/opencode/src/session/prompt.ts9
1 files changed, 7 insertions, 2 deletions
diff --git a/packages/opencode/src/session/prompt.ts b/packages/opencode/src/session/prompt.ts
index 71b99ab0d..76c702982 100644
--- a/packages/opencode/src/session/prompt.ts
+++ b/packages/opencode/src/session/prompt.ts
@@ -338,6 +338,7 @@ export namespace SessionPrompt {
},
},
})) as MessageV2.ToolPart
+ let executionError: Error | undefined
const result = await taskTool
.execute(
{
@@ -362,7 +363,11 @@ export namespace SessionPrompt {
},
},
)
- .catch(() => {})
+ .catch((error) => {
+ executionError = error
+ log.error("subtask execution failed", { error, agent: task.agent, description: task.description })
+ return undefined
+ })
assistantMessage.finish = "tool-calls"
assistantMessage.time.completed = Date.now()
await Session.updateMessage(assistantMessage)
@@ -388,7 +393,7 @@ export namespace SessionPrompt {
...part,
state: {
status: "error",
- error: "Tool execution failed",
+ error: executionError ? `Tool execution failed: ${executionError.message}` : "Tool execution failed",
time: {
start: part.state.status === "running" ? part.state.time.start : Date.now(),
end: Date.now(),