fix(exec): suggest increasing timeout on timeouts

This commit is contained in:
AaronWander
2026-03-03 09:50:49 +08:00
committed by Peter Steinberger
parent 91cdb703bd
commit 4c32411bee
3 changed files with 8 additions and 2 deletions

View File

@@ -29,6 +29,9 @@ Generate a handful of “random but structured” prompts and render them via th
## Run ## Run
Note: Image generation can take longer than common exec timeouts (for example 30 seconds).
When invoking this skill via OpenClaws exec tool, set a higher timeout to avoid premature termination/retries (e.g., exec timeout=300).
```bash ```bash
python3 {baseDir}/scripts/gen.py python3 {baseDir}/scripts/gen.py
open ~/Projects/tmp/openai-image-gen-*/index.html # if ~/Projects/tmp exists; else ./tmp/... open ~/Projects/tmp/openai-image-gen-*/index.html # if ~/Projects/tmp exists; else ./tmp/...

View File

@@ -535,8 +535,8 @@ export async function runExecProcess(opts: {
: "Command not executable (permission denied)" : "Command not executable (permission denied)"
: exit.reason === "overall-timeout" : exit.reason === "overall-timeout"
? typeof opts.timeoutSec === "number" && opts.timeoutSec > 0 ? typeof opts.timeoutSec === "number" && opts.timeoutSec > 0
? `Command timed out after ${opts.timeoutSec} seconds` ? `Command timed out after ${opts.timeoutSec} seconds. If this command is expected to take longer, re-run with a higher timeout (e.g., exec timeout=300).`
: "Command timed out" : "Command timed out. If this command is expected to take longer, re-run with a higher timeout (e.g., exec timeout=300)."
: exit.reason === "no-output-timeout" : exit.reason === "no-output-timeout"
? "Command timed out waiting for output" ? "Command timed out waiting for output"
: exit.exitSignal != null : exit.exitSignal != null

View File

@@ -458,6 +458,9 @@ describe("exec tool backgrounding", () => {
allowBackground: false, allowBackground: false,
}); });
await expect(executeExecCommand(customBash, longDelayCmd)).rejects.toThrow(/timed out/i); await expect(executeExecCommand(customBash, longDelayCmd)).rejects.toThrow(/timed out/i);
await expect(executeExecCommand(customBash, longDelayCmd)).rejects.toThrow(
/re-run with a higher timeout/i,
);
}); });
it.each<DisallowedElevationCase>(DISALLOWED_ELEVATION_CASES)( it.each<DisallowedElevationCase>(DISALLOWED_ELEVATION_CASES)(