claudetool: replace timeout parameter with slow_ok boolean
Empirically, the agent doesn't set timeouts long enough,
and doesn't retry on failure.
Give it only one decision to make: Is this maybe a slow command?
If, horror of horrors, your project can't accomplish tasks within the
default timeouts, there's a new command line flag to adjust them.
Co-Authored-By: sketch <hello@sketch.dev>
Change-ID: sc26e3516f28c22d4k
diff --git a/loop/testdata/agent_loop.httprr b/loop/testdata/agent_loop.httprr
index 49e76da..25aca32 100644
--- a/loop/testdata/agent_loop.httprr
+++ b/loop/testdata/agent_loop.httprr
@@ -1,9 +1,9 @@
httprr trace v1
-20692 2587
+20567 2526
POST https://api.anthropic.com/v1/messages HTTP/1.1
Host: api.anthropic.com
User-Agent: Go-http-client/1.1
-Content-Length: 20494
+Content-Length: 20369
Anthropic-Version: 2023-06-01
Content-Type: application/json
@@ -27,7 +27,7 @@
"tools": [
{
"name": "bash",
- "description": "Executes a shell command using bash -c with an optional timeout, returning combined stdout and stderr.\nWhen run with background flag, the process may keep running after the tool call returns, and\nthe agent can inspect the output by reading the output files. Use the background task when, for example,\nstarting a server to test something. Be sure to kill the process group when done.",
+ "description": "Executes shell commands via bash -c, returning combined stdout/stderr.\n\nWith background=true, returns immediately while process continues running\nwith output redirected to files. Kill process group when done.\nUse background for servers/demos that need to stay running.\n\nMUST set slow_ok=true for potentially slow commands: builds, downloads,\ninstalls, tests, or any other substantive operation.",
"input_schema": {
"type": "object",
"required": [
@@ -36,15 +36,15 @@
"properties": {
"command": {
"type": "string",
- "description": "Shell script to execute"
+ "description": "Shell to execute"
},
- "timeout": {
- "type": "string",
- "description": "Timeout as a Go duration string, defaults to 10s if background is false; 10m if background is true"
+ "slow_ok": {
+ "type": "boolean",
+ "description": "Use extended timeout"
},
"background": {
"type": "boolean",
- "description": "If true, executes the command in the background without waiting for completion"
+ "description": "Execute in background"
}
}
}
@@ -602,25 +602,25 @@
}HTTP/2.0 200 OK
Anthropic-Organization-Id: 3c473a21-7208-450a-a9f8-80aebda45c1b
Anthropic-Ratelimit-Input-Tokens-Limit: 200000
-Anthropic-Ratelimit-Input-Tokens-Remaining: 200000
-Anthropic-Ratelimit-Input-Tokens-Reset: 2025-07-02T22:43:53Z
+Anthropic-Ratelimit-Input-Tokens-Remaining: 184000
+Anthropic-Ratelimit-Input-Tokens-Reset: 2025-07-11T01:09:41Z
Anthropic-Ratelimit-Output-Tokens-Limit: 80000
Anthropic-Ratelimit-Output-Tokens-Remaining: 80000
-Anthropic-Ratelimit-Output-Tokens-Reset: 2025-07-02T22:44:03Z
+Anthropic-Ratelimit-Output-Tokens-Reset: 2025-07-11T01:09:42Z
Anthropic-Ratelimit-Requests-Limit: 4000
Anthropic-Ratelimit-Requests-Remaining: 3999
-Anthropic-Ratelimit-Requests-Reset: 2025-07-02T22:43:47Z
+Anthropic-Ratelimit-Requests-Reset: 2025-07-11T01:09:33Z
Anthropic-Ratelimit-Tokens-Limit: 280000
-Anthropic-Ratelimit-Tokens-Remaining: 280000
-Anthropic-Ratelimit-Tokens-Reset: 2025-07-02T22:43:53Z
+Anthropic-Ratelimit-Tokens-Remaining: 264000
+Anthropic-Ratelimit-Tokens-Reset: 2025-07-11T01:09:41Z
Cf-Cache-Status: DYNAMIC
-Cf-Ray: 9591a9fb9af39e58-SJC
+Cf-Ray: 95d46a83bdfc16a2-SJC
Content-Type: application/json
-Date: Wed, 02 Jul 2025 22:44:03 GMT
-Request-Id: req_011CQj12QtwdhXutWELw6Xs3
+Date: Fri, 11 Jul 2025 01:09:42 GMT
+Request-Id: req_011CQzLcTmJPByqxoE27HKVH
Server: cloudflare
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
Via: 1.1 google
X-Robots-Tag: none
-{"id":"msg_01UtTaMqbCD6qFYqz7s8w1Yi","type":"message","role":"assistant","model":"claude-sonnet-4-20250514","content":[{"type":"text","text":"Here are the tools available to me:\n\n**File & Code Management:**\n- `bash` - Execute shell commands\n- `patch` - Modify files with precise text edits\n- `keyword_search` - Search codebase by keywords\n\n**Task Management:**\n- `todo_read` - Read current todo list\n- `todo_write` - Create and manage task lists\n- `think` - Record thoughts and plans\n\n**Git & Code Quality:**\n- `commit-message-style` - Get git commit message guidance\n- `codereview` - Run automated code review\n- `done` - Complete work with verification checklist\n\n**Browser Automation:**\n- `browser_navigate` - Navigate to URLs\n- `browser_click` - Click elements\n- `browser_type` - Type text into inputs\n- `browser_wait_for` - Wait for elements\n- `browser_get_text` - Read element text\n- `browser_eval` - Execute JavaScript\n- `browser_scroll_into_view` - Scroll to elements\n- `browser_resize` - Resize browser window\n- `browser_take_screenshot` - Capture screenshots\n- `browser_recent_console_logs` - Get console logs\n- `browser_clear_console_logs` - Clear console logs\n\n**Utility:**\n- `set-slug` - Set conversation identifier\n- `about_sketch` - Get Sketch platform help\n- `multiplechoice` - Present multiple choice questions\n- `read_image` - Read and encode image files"}],"stop_reason":"end_turn","stop_sequence":null,"usage":{"input_tokens":3,"cache_creation_input_tokens":4740,"cache_read_input_tokens":0,"output_tokens":342,"service_tier":"standard"}}
\ No newline at end of file
+{"id":"msg_019kDFP5RwG2yYoYeTuPLXzZ","type":"message","role":"assistant","model":"claude-sonnet-4-20250514","content":[{"type":"text","text":"Here are the tools available to me:\n\n**File & Code Management:**\n- `bash` - Execute shell commands\n- `patch` - Modify files with precise text edits\n- `keyword_search` - Search for files in unfamiliar codebases\n\n**Planning & Organization:**\n- `think` - Take notes and form plans\n- `todo_read` / `todo_write` - Manage task lists\n- `done` - Complete work with verification checklist\n\n**Git & Code Review:**\n- `commit-message-style` - Get commit message guidance\n- `codereview` - Run automated code review\n\n**Browser Automation:**\n- `browser_navigate` - Navigate to URLs\n- `browser_click` - Click elements\n- `browser_type` - Type into inputs\n- `browser_wait_for` - Wait for elements\n- `browser_get_text` - Read page text\n- `browser_eval` - Execute JavaScript\n- `browser_scroll_into_view` - Scroll to elements\n- `browser_resize` - Resize browser window\n- `browser_take_screenshot` - Capture screenshots\n- `browser_recent_console_logs` - Get console logs\n- `browser_clear_console_logs` - Clear console logs\n\n**Utilities:**\n- `read_image` - Read and encode image files\n- `about_sketch` - Get help with Sketch functionality\n- `multiplechoice` - Present multiple choice questions"}],"stop_reason":"end_turn","stop_sequence":null,"usage":{"input_tokens":3,"cache_creation_input_tokens":4719,"cache_read_input_tokens":0,"output_tokens":329,"service_tier":"standard"}}
\ No newline at end of file