mirror of
https://github.com/sst/opencode.git
synced 2025-12-23 10:11:41 +00:00
fix: more descriptive tool or subtask execution failed error (#5337)
Signed-off-by: Christian Stewart <christian@aperture.us>
This commit is contained in:
parent
e36c349222
commit
cbb591eb7d
1 changed files with 7 additions and 2 deletions
|
|
@ -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(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue