mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-20 01:12:15 +00:00
improve bash timeout retry hint (#22390)
This commit is contained in:
parent
ff60859e36
commit
4f967d5bc0
2 changed files with 6 additions and 1 deletions
|
|
@ -437,7 +437,11 @@ export const BashTool = Tool.define(
|
|||
).pipe(Effect.orDie)
|
||||
|
||||
const meta: string[] = []
|
||||
if (expired) meta.push(`bash tool terminated command after exceeding timeout ${input.timeout} ms`)
|
||||
if (expired) {
|
||||
meta.push(
|
||||
`bash tool terminated command after exceeding timeout ${input.timeout} ms. If this command is expected to take longer and is not waiting for interactive input, retry with a larger timeout value in milliseconds.`,
|
||||
)
|
||||
}
|
||||
if (aborted) meta.push("User aborted the command")
|
||||
if (meta.length > 0) {
|
||||
output += "\n\n<bash_metadata>\n" + meta.join("\n") + "\n</bash_metadata>"
|
||||
|
|
|
|||
|
|
@ -1024,6 +1024,7 @@ describe("tool.bash abort", () => {
|
|||
)
|
||||
expect(result.output).toContain("started")
|
||||
expect(result.output).toContain("bash tool terminated command after exceeding timeout")
|
||||
expect(result.output).toContain("retry with a larger timeout value in milliseconds")
|
||||
},
|
||||
})
|
||||
}, 15_000)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue