Skip to content

Commit b9c3fe6

Browse files
authored
🤖 Update bash sleep error to permit <10s sleeps in busy loops (#311)
Observed many agents polling without sleep, draining resources. The error message now explicitly encourages the use of short sleeps in busy loops while discouraging standalone sleep commands. **Changes:** - Updated error message from "sleep commands are blocked" to "do not start commands with sleep; prefer <10s sleeps in busy loops" - More permissive framing that validates sleep when used properly in polling loops - Maintains blocking of standalone sleep commands at script start _Generated with `cmux`_
1 parent 83bb6de commit b9c3fe6

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/services/tools/bash.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -894,8 +894,8 @@ describe("bash tool", () => {
894894

895895
expect(result.success).toBe(false);
896896
if (!result.success) {
897-
expect(result.error).toContain("sleep commands are blocked");
898-
expect(result.error).toContain("polling loops");
897+
expect(result.error).toContain("do not start commands with sleep");
898+
expect(result.error).toContain("prefer <10s sleeps in busy loops");
899899
expect(result.error).toContain("while ! condition");
900900
expect(result.exitCode).toBe(-1);
901901
expect(result.wall_duration_ms).toBe(0);

src/services/tools/bash.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export const createBashTool: ToolFactory = (config: ToolConfiguration) => {
7979
return {
8080
success: false,
8181
error:
82-
"sleep commands are blocked to minimize waiting time. Instead, use polling loops to check conditions repeatedly (e.g., 'while ! condition; do sleep 1; done' or 'until condition; do sleep 1; done').",
82+
"do not start commands with sleep; prefer <10s sleeps in busy loops (e.g., 'while ! condition; do sleep 1; done' or 'until condition; do sleep 1; done').",
8383
exitCode: -1,
8484
wall_duration_ms: 0,
8585
};

0 commit comments

Comments
 (0)