diff --git a/internal/agent/common_test.go b/internal/agent/common_test.go index 3c8e1bef4565f4340fceafca2801dcaef282c5c3..2a0781ce6eac12bca0f65beb34f86403023109db 100644 --- a/internal/agent/common_test.go +++ b/internal/agent/common_test.go @@ -159,7 +159,7 @@ func coderAgent(r *recorder.Recorder, env env, large, small ai.LanguageModel) (S tools.NewFetchTool(env.permissions, env.workingDir, r.GetDefaultClient()), tools.NewGlobTool(env.workingDir), tools.NewGrepTool(env.workingDir), - tools.NewLsTool(env.permissions, env.workingDir), + tools.NewLsTool(env.permissions, env.workingDir, cfg.Tools.Ls), tools.NewSourcegraphTool(r.GetDefaultClient()), tools.NewViewTool(env.lspClients, env.permissions, env.workingDir), tools.NewWriteTool(env.lspClients, env.permissions, env.history, env.workingDir), diff --git a/internal/agent/testdata/TestCoderAgent/anthropic-sonnet/bash_tool.yaml b/internal/agent/testdata/TestCoderAgent/anthropic-sonnet/bash_tool.yaml index 81581a4d4e91883bd040880b28bb9c2243f0b39e..3bf3bb5f4c8e43f3273323b61837cc33ccc75d06 100644 --- a/internal/agent/testdata/TestCoderAgent/anthropic-sonnet/bash_tool.yaml +++ b/internal/agent/testdata/TestCoderAgent/anthropic-sonnet/bash_tool.yaml @@ -25,49 +25,52 @@ interactions: content_length: -1 body: |+ event: message_start - data: {"type":"message_start","message":{"id":"msg_01TmVYrcSPfeEpJxXS6bxwbA","type":"message","role":"assistant","model":"claude-3-5-haiku-20241022","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":124,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":3,"service_tier":"standard"}} } + data: {"type":"message_start","message":{"id":"msg_01LqaQeaFnWb1d24ZpBd3GDz","type":"message","role":"assistant","model":"claude-3-5-haiku-20241022","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":124,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":2,"service_tier":"standard"}} } event: content_block_start - data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } + data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Bash File"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Bash"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Creation"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" File"} } event: ping data: {"type": "ping"} event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Comman"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Creation"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"d"}} + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Comman"} } + + event: content_block_delta + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"d"} } event: content_block_stop data: {"type":"content_block_stop","index":0 } event: message_delta - data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":124,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":8} } + data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":124,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":8} } event: message_stop - data: {"type":"message_stop" } + data: {"type":"message_stop" } headers: Content-Type: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 529.228917ms + duration: 565.49875ms - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 31961 + content_length: 32034 host: "" - body: "{\"max_tokens\":10000,\"messages\":[{\"content\":[{\"text\":\"use bash to create a file named test.txt with content 'hello bash'\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"role\":\"user\"}],\"model\":\"claude-sonnet-4-5-20250929\",\"system\":[{\"text\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\u003cmemory_instructions\\u003e\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\u003c/memory_instructions\\u003e\\n\\u003ccommunication_style\\u003e\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\u003cexample\\u003e\\nuser: 2 + 2\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what is 2+2?\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: is 11 a prime number?\\nassistant: true\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\u003c/example\\u003e\\n\\u003c/communication_style\\u003e\\n\\n\\u003cproactiveness\\u003e\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\u003c/proactiveness\\u003e\\n\\n\\u003cfollowing_conversations\\u003e\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\u003c/following_conversations\\u003e\\n\\n\\u003ccode_style\\u003e\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\u003c/code_style\\u003e\\n\\n\\u003cdoing_tasks\\u003e\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\u003c/doing_tasks\\u003e\\n\\n\\u003ctool_use\\u003e\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\u003c/tool_use\\u003e\\n\\n\\u003cenv\\u003e\\nWorking directory: /tmp/crush-test/TestCoderAgent/anthropic-sonnet/bash_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\u003c/env\\u003e\\n\\u003cmemory\\u003e\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\u003c/memory\\u003e\\n\\n\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"tool_choice\":{\"disable_parallel_tool_use\":false,\"type\":\"auto\"},\"tools\":[{\"input_schema\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"},\"name\":\"bash\",\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\u003ccross_platform\\u003e\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\u003c/cross_platform\\u003e\\n\\n\\u003cexecution_steps\\u003e\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with \\u003ccwd\\u003e\\u003c/cwd\\u003e tags\\n\\u003c/execution_steps\\u003e\\n\\n\\u003cusage_notes\\u003e\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '\\u0026\\u0026', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\u003c/usage_notes\\u003e\\n\\n\\u003cgit_commits\\u003e\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in \\u003ccommit_analysis\\u003e tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\u003ccrush@charm.land\\u003e\\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\u003c/git_commits\\u003e\\n\\n\\u003cpull_requests\\u003e\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in \\u003cpr_analysis\\u003e tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n\\n ## Summary\\n\\n \\u0026lt;1-3 bullet points\\u003e\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\u003c/pull_requests\\u003e\\n\\n\\u003cexamples\\u003e\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar \\u0026\\u0026 pytest tests\\n\\u003c/examples\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"},\"name\":\"download\",\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\u003cusage\\u003e\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"},\"name\":\"edit\",\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\u003c/parameters\\u003e\\n\\n\\u003cspecial_cases\\u003e\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\u003c/special_cases\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\u003c/best_practices\\u003e\\n\\n\\u003cwindows_notes\\u003e\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\u003c/windows_notes\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"},\"name\":\"multiedit\",\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\u003c/parameters\\u003e\\n\\n\\u003coperation\\u003e\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\u003c/operation\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\u003c/best_practices\\u003e\\n\\n\\u003cnew_file_creation\\u003e\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\u003c/new_file_creation\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"},\"name\":\"fetch\",\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\u003cusage\\u003e\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"glob\",\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cpattern_syntax\\u003e\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\u003c/pattern_syntax\\u003e\\n\\n\\u003cexamples\\u003e\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\u003c/examples\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"grep\",\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cregex_syntax\\u003e\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\u003c/regex_syntax\\u003e\\n\\n\\u003cinclude_patterns\\u003e\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\u003c/include_patterns\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003cignore_support\\u003e\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\u003c/ignore_support\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"name\":\"ls\",\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\u003cusage\\u003e\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"},\"name\":\"sourcegraph\",\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\u003cusage\\u003e\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cbasic_syntax\\u003e\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\u003c/basic_syntax\\u003e\\n\\n\\u003ckey_filters\\u003e\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\u003c/key_filters\\u003e\\n\\n\\u003cexamples\\u003e\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\u003c/examples\\u003e\\n\\n\\u003cboolean_operators\\u003e\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\u003c/boolean_operators\\u003e\\n\\n\\u003climitations\\u003e\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"},\"name\":\"view\",\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\u003cusage\\u003e\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines \\u003e2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"},\"name\":\"write\",\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\u003cusage\\u003e\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\u003c/tips\\u003e\\n\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"stream\":true}" + body: "{\"max_tokens\":10000,\"messages\":[{\"content\":[{\"text\":\"use bash to create a file named test.txt with content 'hello bash'\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"role\":\"user\"}],\"model\":\"claude-sonnet-4-5-20250929\",\"system\":[{\"text\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\u003cmemory_instructions\\u003e\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\u003c/memory_instructions\\u003e\\n\\u003ccommunication_style\\u003e\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\u003cexample\\u003e\\nuser: 2 + 2\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what is 2+2?\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: is 11 a prime number?\\nassistant: true\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\u003c/example\\u003e\\n\\u003c/communication_style\\u003e\\n\\n\\u003cproactiveness\\u003e\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\u003c/proactiveness\\u003e\\n\\n\\u003cfollowing_conversations\\u003e\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\u003c/following_conversations\\u003e\\n\\n\\u003ccode_style\\u003e\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\u003c/code_style\\u003e\\n\\n\\u003cdoing_tasks\\u003e\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\u003c/doing_tasks\\u003e\\n\\n\\u003ctool_use\\u003e\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\u003c/tool_use\\u003e\\n\\n\\u003cenv\\u003e\\nWorking directory: /tmp/crush-test/TestCoderAgent/anthropic-sonnet/bash_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\u003c/env\\u003e\\n\\u003cmemory\\u003e\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\u003c/memory\\u003e\\n\\n\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"tool_choice\":{\"disable_parallel_tool_use\":false,\"type\":\"auto\"},\"tools\":[{\"input_schema\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"},\"name\":\"bash\",\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\u003ccross_platform\\u003e\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\u003c/cross_platform\\u003e\\n\\n\\u003cexecution_steps\\u003e\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with \\u003ccwd\\u003e\\u003c/cwd\\u003e tags\\n\\u003c/execution_steps\\u003e\\n\\n\\u003cusage_notes\\u003e\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '\\u0026\\u0026', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\u003c/usage_notes\\u003e\\n\\n\\u003cgit_commits\\u003e\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in \\u003ccommit_analysis\\u003e tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\u003ccrush@charm.land\\u003e\\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\u003c/git_commits\\u003e\\n\\n\\u003cpull_requests\\u003e\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in \\u003cpr_analysis\\u003e tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n\\n ## Summary\\n\\n \\u0026lt;1-3 bullet points\\u003e\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\u003c/pull_requests\\u003e\\n\\n\\u003cexamples\\u003e\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar \\u0026\\u0026 pytest tests\\n\\u003c/examples\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"},\"name\":\"download\",\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\u003cusage\\u003e\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"},\"name\":\"edit\",\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\u003c/parameters\\u003e\\n\\n\\u003cspecial_cases\\u003e\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\u003c/special_cases\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\u003c/best_practices\\u003e\\n\\n\\u003cwindows_notes\\u003e\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\u003c/windows_notes\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"},\"name\":\"multiedit\",\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\u003c/parameters\\u003e\\n\\n\\u003coperation\\u003e\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\u003c/operation\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\u003c/best_practices\\u003e\\n\\n\\u003cnew_file_creation\\u003e\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\u003c/new_file_creation\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"},\"name\":\"fetch\",\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\u003cusage\\u003e\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"glob\",\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cpattern_syntax\\u003e\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\u003c/pattern_syntax\\u003e\\n\\n\\u003cexamples\\u003e\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\u003c/examples\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"grep\",\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cregex_syntax\\u003e\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\u003c/regex_syntax\\u003e\\n\\n\\u003cinclude_patterns\\u003e\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\u003c/include_patterns\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003cignore_support\\u003e\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\u003c/ignore_support\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"name\":\"ls\",\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\u003cusage\\u003e\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"},\"name\":\"sourcegraph\",\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\u003cusage\\u003e\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cbasic_syntax\\u003e\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\u003c/basic_syntax\\u003e\\n\\n\\u003ckey_filters\\u003e\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\u003c/key_filters\\u003e\\n\\n\\u003cexamples\\u003e\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\u003c/examples\\u003e\\n\\n\\u003cboolean_operators\\u003e\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\u003c/boolean_operators\\u003e\\n\\n\\u003climitations\\u003e\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"},\"name\":\"view\",\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\u003cusage\\u003e\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines \\u003e2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"},\"name\":\"write\",\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\u003cusage\\u003e\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\u003c/tips\\u003e\\n\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"stream\":true}" headers: Accept: - application/json @@ -84,70 +87,82 @@ interactions: content_length: -1 body: |+ event: message_start - data: {"type":"message_start","message":{"id":"msg_01DmcmwbEscKmZ57py3fZ8qw","type":"message","role":"assistant","model":"claude-sonnet-4-5-20250929","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":3,"cache_creation_input_tokens":1777,"cache_read_input_tokens":6884,"cache_creation":{"ephemeral_5m_input_tokens":1777,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard"}} } + data: {"type":"message_start","message":{"id":"msg_01585etxsJGdbemm7JphQZB9","type":"message","role":"assistant","model":"claude-sonnet-4-5-20250929","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":3,"cache_creation_input_tokens":1777,"cache_read_input_tokens":6904,"cache_creation":{"ephemeral_5m_input_tokens":1777,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard"}} } event: content_block_start - data: {"type":"content_block_start","index":0,"content_block":{"type":"tool_use","id":"toolu_01TsuX3QMwYZxVXuokrsTNRu","name":"bash","input":{}} } + data: {"type":"content_block_start","index":0,"content_block":{"type":"tool_use","id":"toolu_01CkHmg2W8cV7xzY63vkVMjR","name":"bash","input":{}} } + + event: content_block_delta + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":""} } + + event: content_block_delta + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"{\"command\":"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":""} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":" \"echo '"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"{\"comma"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"hello bas"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"nd\":"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"h' > test"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":" \"echo 'hell"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":".txt\""} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"o bash' >"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":", \"descrip"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":" test.txt\""} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"tio"}} event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":", \"descripti"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"n\": \"Cr"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"on\": \"Cre"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"eate"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"ate test.tx"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":" test"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"t with cont"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":".txt with "} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"ent 'hell"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"cont"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"o bash'\"}"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"en"} } + + event: content_block_delta + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"t 'hello "} } + + event: content_block_delta + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"bash'\"}"} } event: content_block_stop - data: {"type":"content_block_stop","index":0 } + data: {"type":"content_block_stop","index":0 } event: message_delta - data: {"type":"message_delta","delta":{"stop_reason":"tool_use","stop_sequence":null},"usage":{"input_tokens":3,"cache_creation_input_tokens":1777,"cache_read_input_tokens":6884,"output_tokens":87} } + data: {"type":"message_delta","delta":{"stop_reason":"tool_use","stop_sequence":null},"usage":{"input_tokens":3,"cache_creation_input_tokens":1777,"cache_read_input_tokens":6904,"output_tokens":87} } event: message_stop - data: {"type":"message_stop" } + data: {"type":"message_stop"} headers: Content-Type: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 2.312060458s + duration: 2.373974458s - id: 2 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 32362 + content_length: 32435 host: "" - body: "{\"max_tokens\":10000,\"messages\":[{\"content\":[{\"text\":\"use bash to create a file named test.txt with content 'hello bash'\",\"type\":\"text\"}],\"role\":\"user\"},{\"content\":[{\"id\":\"toolu_01TsuX3QMwYZxVXuokrsTNRu\",\"input\":{\"command\":\"echo 'hello bash' \\u003e test.txt\",\"description\":\"Create test.txt with content 'hello bash'\"},\"name\":\"bash\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"tool_use\"}],\"role\":\"assistant\"},{\"content\":[{\"tool_use_id\":\"toolu_01TsuX3QMwYZxVXuokrsTNRu\",\"cache_control\":{\"type\":\"ephemeral\"},\"content\":[{\"text\":\"no output\",\"type\":\"text\"}],\"type\":\"tool_result\"}],\"role\":\"user\"}],\"model\":\"claude-sonnet-4-5-20250929\",\"system\":[{\"text\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\u003cmemory_instructions\\u003e\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\u003c/memory_instructions\\u003e\\n\\u003ccommunication_style\\u003e\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\u003cexample\\u003e\\nuser: 2 + 2\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what is 2+2?\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: is 11 a prime number?\\nassistant: true\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\u003c/example\\u003e\\n\\u003c/communication_style\\u003e\\n\\n\\u003cproactiveness\\u003e\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\u003c/proactiveness\\u003e\\n\\n\\u003cfollowing_conversations\\u003e\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\u003c/following_conversations\\u003e\\n\\n\\u003ccode_style\\u003e\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\u003c/code_style\\u003e\\n\\n\\u003cdoing_tasks\\u003e\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\u003c/doing_tasks\\u003e\\n\\n\\u003ctool_use\\u003e\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\u003c/tool_use\\u003e\\n\\n\\u003cenv\\u003e\\nWorking directory: /tmp/crush-test/TestCoderAgent/anthropic-sonnet/bash_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\u003c/env\\u003e\\n\\u003cmemory\\u003e\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\u003c/memory\\u003e\\n\\n\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"tool_choice\":{\"disable_parallel_tool_use\":false,\"type\":\"auto\"},\"tools\":[{\"input_schema\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"},\"name\":\"bash\",\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\u003ccross_platform\\u003e\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\u003c/cross_platform\\u003e\\n\\n\\u003cexecution_steps\\u003e\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with \\u003ccwd\\u003e\\u003c/cwd\\u003e tags\\n\\u003c/execution_steps\\u003e\\n\\n\\u003cusage_notes\\u003e\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '\\u0026\\u0026', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\u003c/usage_notes\\u003e\\n\\n\\u003cgit_commits\\u003e\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in \\u003ccommit_analysis\\u003e tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\u003ccrush@charm.land\\u003e\\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\u003c/git_commits\\u003e\\n\\n\\u003cpull_requests\\u003e\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in \\u003cpr_analysis\\u003e tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n\\n ## Summary\\n\\n \\u0026lt;1-3 bullet points\\u003e\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\u003c/pull_requests\\u003e\\n\\n\\u003cexamples\\u003e\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar \\u0026\\u0026 pytest tests\\n\\u003c/examples\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"},\"name\":\"download\",\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\u003cusage\\u003e\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"},\"name\":\"edit\",\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\u003c/parameters\\u003e\\n\\n\\u003cspecial_cases\\u003e\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\u003c/special_cases\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\u003c/best_practices\\u003e\\n\\n\\u003cwindows_notes\\u003e\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\u003c/windows_notes\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"},\"name\":\"multiedit\",\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\u003c/parameters\\u003e\\n\\n\\u003coperation\\u003e\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\u003c/operation\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\u003c/best_practices\\u003e\\n\\n\\u003cnew_file_creation\\u003e\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\u003c/new_file_creation\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"},\"name\":\"fetch\",\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\u003cusage\\u003e\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"glob\",\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cpattern_syntax\\u003e\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\u003c/pattern_syntax\\u003e\\n\\n\\u003cexamples\\u003e\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\u003c/examples\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"grep\",\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cregex_syntax\\u003e\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\u003c/regex_syntax\\u003e\\n\\n\\u003cinclude_patterns\\u003e\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\u003c/include_patterns\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003cignore_support\\u003e\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\u003c/ignore_support\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"name\":\"ls\",\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\u003cusage\\u003e\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"},\"name\":\"sourcegraph\",\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\u003cusage\\u003e\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cbasic_syntax\\u003e\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\u003c/basic_syntax\\u003e\\n\\n\\u003ckey_filters\\u003e\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\u003c/key_filters\\u003e\\n\\n\\u003cexamples\\u003e\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\u003c/examples\\u003e\\n\\n\\u003cboolean_operators\\u003e\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\u003c/boolean_operators\\u003e\\n\\n\\u003climitations\\u003e\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"},\"name\":\"view\",\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\u003cusage\\u003e\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines \\u003e2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"},\"name\":\"write\",\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\u003cusage\\u003e\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\u003c/tips\\u003e\\n\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"stream\":true}" + body: "{\"max_tokens\":10000,\"messages\":[{\"content\":[{\"text\":\"use bash to create a file named test.txt with content 'hello bash'\",\"type\":\"text\"}],\"role\":\"user\"},{\"content\":[{\"id\":\"toolu_01CkHmg2W8cV7xzY63vkVMjR\",\"input\":{\"command\":\"echo 'hello bash' \\u003e test.txt\",\"description\":\"Create test.txt with content 'hello bash'\"},\"name\":\"bash\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"tool_use\"}],\"role\":\"assistant\"},{\"content\":[{\"tool_use_id\":\"toolu_01CkHmg2W8cV7xzY63vkVMjR\",\"cache_control\":{\"type\":\"ephemeral\"},\"content\":[{\"text\":\"no output\",\"type\":\"text\"}],\"type\":\"tool_result\"}],\"role\":\"user\"}],\"model\":\"claude-sonnet-4-5-20250929\",\"system\":[{\"text\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\u003cmemory_instructions\\u003e\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\u003c/memory_instructions\\u003e\\n\\u003ccommunication_style\\u003e\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\u003cexample\\u003e\\nuser: 2 + 2\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what is 2+2?\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: is 11 a prime number?\\nassistant: true\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\u003c/example\\u003e\\n\\u003c/communication_style\\u003e\\n\\n\\u003cproactiveness\\u003e\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\u003c/proactiveness\\u003e\\n\\n\\u003cfollowing_conversations\\u003e\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\u003c/following_conversations\\u003e\\n\\n\\u003ccode_style\\u003e\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\u003c/code_style\\u003e\\n\\n\\u003cdoing_tasks\\u003e\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\u003c/doing_tasks\\u003e\\n\\n\\u003ctool_use\\u003e\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\u003c/tool_use\\u003e\\n\\n\\u003cenv\\u003e\\nWorking directory: /tmp/crush-test/TestCoderAgent/anthropic-sonnet/bash_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\u003c/env\\u003e\\n\\u003cmemory\\u003e\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\u003c/memory\\u003e\\n\\n\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"tool_choice\":{\"disable_parallel_tool_use\":false,\"type\":\"auto\"},\"tools\":[{\"input_schema\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"},\"name\":\"bash\",\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\u003ccross_platform\\u003e\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\u003c/cross_platform\\u003e\\n\\n\\u003cexecution_steps\\u003e\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with \\u003ccwd\\u003e\\u003c/cwd\\u003e tags\\n\\u003c/execution_steps\\u003e\\n\\n\\u003cusage_notes\\u003e\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '\\u0026\\u0026', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\u003c/usage_notes\\u003e\\n\\n\\u003cgit_commits\\u003e\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in \\u003ccommit_analysis\\u003e tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\u003ccrush@charm.land\\u003e\\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\u003c/git_commits\\u003e\\n\\n\\u003cpull_requests\\u003e\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in \\u003cpr_analysis\\u003e tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n\\n ## Summary\\n\\n \\u0026lt;1-3 bullet points\\u003e\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\u003c/pull_requests\\u003e\\n\\n\\u003cexamples\\u003e\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar \\u0026\\u0026 pytest tests\\n\\u003c/examples\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"},\"name\":\"download\",\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\u003cusage\\u003e\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"},\"name\":\"edit\",\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\u003c/parameters\\u003e\\n\\n\\u003cspecial_cases\\u003e\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\u003c/special_cases\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\u003c/best_practices\\u003e\\n\\n\\u003cwindows_notes\\u003e\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\u003c/windows_notes\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"},\"name\":\"multiedit\",\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\u003c/parameters\\u003e\\n\\n\\u003coperation\\u003e\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\u003c/operation\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\u003c/best_practices\\u003e\\n\\n\\u003cnew_file_creation\\u003e\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\u003c/new_file_creation\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"},\"name\":\"fetch\",\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\u003cusage\\u003e\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"glob\",\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cpattern_syntax\\u003e\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\u003c/pattern_syntax\\u003e\\n\\n\\u003cexamples\\u003e\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\u003c/examples\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"grep\",\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cregex_syntax\\u003e\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\u003c/regex_syntax\\u003e\\n\\n\\u003cinclude_patterns\\u003e\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\u003c/include_patterns\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003cignore_support\\u003e\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\u003c/ignore_support\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"name\":\"ls\",\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\u003cusage\\u003e\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"},\"name\":\"sourcegraph\",\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\u003cusage\\u003e\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cbasic_syntax\\u003e\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\u003c/basic_syntax\\u003e\\n\\n\\u003ckey_filters\\u003e\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\u003c/key_filters\\u003e\\n\\n\\u003cexamples\\u003e\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\u003c/examples\\u003e\\n\\n\\u003cboolean_operators\\u003e\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\u003c/boolean_operators\\u003e\\n\\n\\u003climitations\\u003e\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"},\"name\":\"view\",\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\u003cusage\\u003e\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines \\u003e2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"},\"name\":\"write\",\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\u003cusage\\u003e\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\u003c/tips\\u003e\\n\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"stream\":true}" headers: Accept: - application/json @@ -164,44 +179,38 @@ interactions: content_length: -1 body: |+ event: message_start - data: {"type":"message_start","message":{"id":"msg_01LmwbdgMfrQjDMRpBxVpAWU","type":"message","role":"assistant","model":"claude-sonnet-4-5-20250929","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":4,"cache_creation_input_tokens":99,"cache_read_input_tokens":8661,"cache_creation":{"ephemeral_5m_input_tokens":99,"ephemeral_1h_input_tokens":0},"output_tokens":2,"service_tier":"standard"}} } + data: {"type":"message_start","message":{"id":"msg_01GgLgzSXCNG3GrKH5RPbZjh","type":"message","role":"assistant","model":"claude-sonnet-4-5-20250929","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":4,"cache_creation_input_tokens":99,"cache_read_input_tokens":8681,"cache_creation":{"ephemeral_5m_input_tokens":99,"ephemeral_1h_input_tokens":0},"output_tokens":2,"service_tier":"standard"}} } event: content_block_start - data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } + data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } event: content_block_delta data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"\n\nDone"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":". File created at test.txt with content 'hello bash"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":". File `"} } event: ping data: {"type": "ping"} event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"'."}} + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"test.txt` created with content "} } - event: ping - data: {"type": "ping"} + event: content_block_delta + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"'hello bash'."} } event: content_block_stop - data: {"type":"content_block_stop","index":0} - - event: ping - data: {"type": "ping"} - - event: ping - data: {"type": "ping"} + data: {"type":"content_block_stop","index":0 } event: message_delta - data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":4,"cache_creation_input_tokens":99,"cache_read_input_tokens":8661,"output_tokens":19} } + data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":4,"cache_creation_input_tokens":99,"cache_read_input_tokens":8681,"output_tokens":20} } event: message_stop - data: {"type":"message_stop"} + data: {"type":"message_stop" } headers: Content-Type: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 2.107503334s + duration: 2.204739208s diff --git a/internal/agent/testdata/TestCoderAgent/anthropic-sonnet/download_tool.yaml b/internal/agent/testdata/TestCoderAgent/anthropic-sonnet/download_tool.yaml index 95778293130d944f0ba61712de9b87fe3314bb1c..c6ed1d7bdb4736bf552d24a3e5b265489cd42fd5 100644 --- a/internal/agent/testdata/TestCoderAgent/anthropic-sonnet/download_tool.yaml +++ b/internal/agent/testdata/TestCoderAgent/anthropic-sonnet/download_tool.yaml @@ -25,52 +25,52 @@ interactions: content_length: -1 body: |+ event: message_start - data: {"type":"message_start","message":{"id":"msg_01U7QrbATa1NWpKKBu2yg92K","type":"message","role":"assistant","model":"claude-3-5-haiku-20241022","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":128,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard"}} } + data: {"type":"message_start","message":{"id":"msg_01TY7oeeeBKZx8Q3z4Tido4x","type":"message","role":"assistant","model":"claude-3-5-haiku-20241022","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":128,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard"}} } event: content_block_start - data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } + data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } event: content_block_delta data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Downloa"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"d robots"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"d robots"} } event: ping data: {"type": "ping"} event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":".txt from"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":".txt from"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" http"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" http"}} event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"bin.org"}} + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"bin.org"} } event: content_block_stop - data: {"type":"content_block_stop","index":0 } + data: {"type":"content_block_stop","index":0 } event: message_delta - data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":128,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":12} } + data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":128,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":12} } event: message_stop - data: {"type":"message_stop" } + data: {"type":"message_stop" } headers: Content-Type: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 671.618084ms + duration: 600.751416ms - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 31978 + content_length: 32051 host: "" - body: "{\"max_tokens\":10000,\"messages\":[{\"content\":[{\"text\":\"download the file from https://httpbin.org/robots.txt and save it as robots.txt\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"role\":\"user\"}],\"model\":\"claude-sonnet-4-5-20250929\",\"system\":[{\"text\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\u003cmemory_instructions\\u003e\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\u003c/memory_instructions\\u003e\\n\\u003ccommunication_style\\u003e\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\u003cexample\\u003e\\nuser: 2 + 2\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what is 2+2?\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: is 11 a prime number?\\nassistant: true\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\u003c/example\\u003e\\n\\u003c/communication_style\\u003e\\n\\n\\u003cproactiveness\\u003e\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\u003c/proactiveness\\u003e\\n\\n\\u003cfollowing_conversations\\u003e\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\u003c/following_conversations\\u003e\\n\\n\\u003ccode_style\\u003e\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\u003c/code_style\\u003e\\n\\n\\u003cdoing_tasks\\u003e\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\u003c/doing_tasks\\u003e\\n\\n\\u003ctool_use\\u003e\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\u003c/tool_use\\u003e\\n\\n\\u003cenv\\u003e\\nWorking directory: /tmp/crush-test/TestCoderAgent/anthropic-sonnet/download_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\u003c/env\\u003e\\n\\u003cmemory\\u003e\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\u003c/memory\\u003e\\n\\n\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"tool_choice\":{\"disable_parallel_tool_use\":false,\"type\":\"auto\"},\"tools\":[{\"input_schema\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"},\"name\":\"bash\",\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\u003ccross_platform\\u003e\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\u003c/cross_platform\\u003e\\n\\n\\u003cexecution_steps\\u003e\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with \\u003ccwd\\u003e\\u003c/cwd\\u003e tags\\n\\u003c/execution_steps\\u003e\\n\\n\\u003cusage_notes\\u003e\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '\\u0026\\u0026', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\u003c/usage_notes\\u003e\\n\\n\\u003cgit_commits\\u003e\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in \\u003ccommit_analysis\\u003e tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\u003ccrush@charm.land\\u003e\\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\u003c/git_commits\\u003e\\n\\n\\u003cpull_requests\\u003e\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in \\u003cpr_analysis\\u003e tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n\\n ## Summary\\n\\n \\u0026lt;1-3 bullet points\\u003e\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\u003c/pull_requests\\u003e\\n\\n\\u003cexamples\\u003e\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar \\u0026\\u0026 pytest tests\\n\\u003c/examples\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"},\"name\":\"download\",\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\u003cusage\\u003e\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"},\"name\":\"edit\",\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\u003c/parameters\\u003e\\n\\n\\u003cspecial_cases\\u003e\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\u003c/special_cases\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\u003c/best_practices\\u003e\\n\\n\\u003cwindows_notes\\u003e\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\u003c/windows_notes\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"},\"name\":\"multiedit\",\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\u003c/parameters\\u003e\\n\\n\\u003coperation\\u003e\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\u003c/operation\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\u003c/best_practices\\u003e\\n\\n\\u003cnew_file_creation\\u003e\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\u003c/new_file_creation\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"},\"name\":\"fetch\",\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\u003cusage\\u003e\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"glob\",\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cpattern_syntax\\u003e\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\u003c/pattern_syntax\\u003e\\n\\n\\u003cexamples\\u003e\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\u003c/examples\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"grep\",\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cregex_syntax\\u003e\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\u003c/regex_syntax\\u003e\\n\\n\\u003cinclude_patterns\\u003e\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\u003c/include_patterns\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003cignore_support\\u003e\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\u003c/ignore_support\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"name\":\"ls\",\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\u003cusage\\u003e\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"},\"name\":\"sourcegraph\",\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\u003cusage\\u003e\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cbasic_syntax\\u003e\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\u003c/basic_syntax\\u003e\\n\\n\\u003ckey_filters\\u003e\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\u003c/key_filters\\u003e\\n\\n\\u003cexamples\\u003e\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\u003c/examples\\u003e\\n\\n\\u003cboolean_operators\\u003e\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\u003c/boolean_operators\\u003e\\n\\n\\u003climitations\\u003e\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"},\"name\":\"view\",\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\u003cusage\\u003e\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines \\u003e2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"},\"name\":\"write\",\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\u003cusage\\u003e\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\u003c/tips\\u003e\\n\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"stream\":true}" + body: "{\"max_tokens\":10000,\"messages\":[{\"content\":[{\"text\":\"download the file from https://httpbin.org/robots.txt and save it as robots.txt\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"role\":\"user\"}],\"model\":\"claude-sonnet-4-5-20250929\",\"system\":[{\"text\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\u003cmemory_instructions\\u003e\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\u003c/memory_instructions\\u003e\\n\\u003ccommunication_style\\u003e\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\u003cexample\\u003e\\nuser: 2 + 2\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what is 2+2?\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: is 11 a prime number?\\nassistant: true\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\u003c/example\\u003e\\n\\u003c/communication_style\\u003e\\n\\n\\u003cproactiveness\\u003e\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\u003c/proactiveness\\u003e\\n\\n\\u003cfollowing_conversations\\u003e\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\u003c/following_conversations\\u003e\\n\\n\\u003ccode_style\\u003e\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\u003c/code_style\\u003e\\n\\n\\u003cdoing_tasks\\u003e\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\u003c/doing_tasks\\u003e\\n\\n\\u003ctool_use\\u003e\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\u003c/tool_use\\u003e\\n\\n\\u003cenv\\u003e\\nWorking directory: /tmp/crush-test/TestCoderAgent/anthropic-sonnet/download_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\u003c/env\\u003e\\n\\u003cmemory\\u003e\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\u003c/memory\\u003e\\n\\n\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"tool_choice\":{\"disable_parallel_tool_use\":false,\"type\":\"auto\"},\"tools\":[{\"input_schema\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"},\"name\":\"bash\",\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\u003ccross_platform\\u003e\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\u003c/cross_platform\\u003e\\n\\n\\u003cexecution_steps\\u003e\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with \\u003ccwd\\u003e\\u003c/cwd\\u003e tags\\n\\u003c/execution_steps\\u003e\\n\\n\\u003cusage_notes\\u003e\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '\\u0026\\u0026', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\u003c/usage_notes\\u003e\\n\\n\\u003cgit_commits\\u003e\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in \\u003ccommit_analysis\\u003e tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\u003ccrush@charm.land\\u003e\\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\u003c/git_commits\\u003e\\n\\n\\u003cpull_requests\\u003e\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in \\u003cpr_analysis\\u003e tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n\\n ## Summary\\n\\n \\u0026lt;1-3 bullet points\\u003e\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\u003c/pull_requests\\u003e\\n\\n\\u003cexamples\\u003e\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar \\u0026\\u0026 pytest tests\\n\\u003c/examples\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"},\"name\":\"download\",\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\u003cusage\\u003e\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"},\"name\":\"edit\",\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\u003c/parameters\\u003e\\n\\n\\u003cspecial_cases\\u003e\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\u003c/special_cases\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\u003c/best_practices\\u003e\\n\\n\\u003cwindows_notes\\u003e\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\u003c/windows_notes\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"},\"name\":\"multiedit\",\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\u003c/parameters\\u003e\\n\\n\\u003coperation\\u003e\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\u003c/operation\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\u003c/best_practices\\u003e\\n\\n\\u003cnew_file_creation\\u003e\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\u003c/new_file_creation\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"},\"name\":\"fetch\",\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\u003cusage\\u003e\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"glob\",\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cpattern_syntax\\u003e\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\u003c/pattern_syntax\\u003e\\n\\n\\u003cexamples\\u003e\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\u003c/examples\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"grep\",\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cregex_syntax\\u003e\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\u003c/regex_syntax\\u003e\\n\\n\\u003cinclude_patterns\\u003e\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\u003c/include_patterns\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003cignore_support\\u003e\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\u003c/ignore_support\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"name\":\"ls\",\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\u003cusage\\u003e\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"},\"name\":\"sourcegraph\",\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\u003cusage\\u003e\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cbasic_syntax\\u003e\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\u003c/basic_syntax\\u003e\\n\\n\\u003ckey_filters\\u003e\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\u003c/key_filters\\u003e\\n\\n\\u003cexamples\\u003e\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\u003c/examples\\u003e\\n\\n\\u003cboolean_operators\\u003e\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\u003c/boolean_operators\\u003e\\n\\n\\u003climitations\\u003e\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"},\"name\":\"view\",\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\u003cusage\\u003e\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines \\u003e2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"},\"name\":\"write\",\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\u003cusage\\u003e\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\u003c/tips\\u003e\\n\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"stream\":true}" headers: Accept: - application/json @@ -87,56 +87,59 @@ interactions: content_length: -1 body: |+ event: message_start - data: {"type":"message_start","message":{"id":"msg_01C35s73wgmJninTEMW9Wo7d","type":"message","role":"assistant","model":"claude-sonnet-4-5-20250929","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":3,"cache_creation_input_tokens":1781,"cache_read_input_tokens":6884,"cache_creation":{"ephemeral_5m_input_tokens":1781,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard"}} } + data: {"type":"message_start","message":{"id":"msg_0199cBM5cDLywMgGA61X42wf","type":"message","role":"assistant","model":"claude-sonnet-4-5-20250929","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":3,"cache_creation_input_tokens":1781,"cache_read_input_tokens":6904,"cache_creation":{"ephemeral_5m_input_tokens":1781,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard"}} } event: content_block_start - data: {"type":"content_block_start","index":0,"content_block":{"type":"tool_use","id":"toolu_01FbRijA4FwZhGzu8kBc2pDC","name":"download","input":{}} } + data: {"type":"content_block_start","index":0,"content_block":{"type":"tool_use","id":"toolu_01CEsZ8AEbiRNWg3qHVNLaLE","name":"download","input":{}} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":""} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":""} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"{\"url\": \"h"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"{\"url\": \"htt"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"ttps:/"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"ps://httpbin"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"/httpbin."} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":".org/ro"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"org/robots."} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"bo"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"txt\""} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"ts.tx"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":", \"file_p"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"t\""} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"ath"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":", \"fil"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"\": \"rob"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"e_path\": \"r"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"ots.txt\"}"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"obots.t"} } + + event: content_block_delta + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"xt\"}"} } event: content_block_stop - data: {"type":"content_block_stop","index":0 } + data: {"type":"content_block_stop","index":0 } event: message_delta - data: {"type":"message_delta","delta":{"stop_reason":"tool_use","stop_sequence":null},"usage":{"input_tokens":3,"cache_creation_input_tokens":1781,"cache_read_input_tokens":6884,"output_tokens":81} } + data: {"type":"message_delta","delta":{"stop_reason":"tool_use","stop_sequence":null},"usage":{"input_tokens":3,"cache_creation_input_tokens":1781,"cache_read_input_tokens":6904,"output_tokens":81} } event: message_stop - data: {"type":"message_stop" } + data: {"type":"message_stop" } headers: Content-Type: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 2.29654575s + duration: 2.349591875s - id: 2 request: proto: HTTP/1.1 @@ -162,15 +165,15 @@ interactions: - text/plain status: 200 OK code: 200 - duration: 1.776605959s + duration: 2.187819167s - id: 3 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 32469 + content_length: 32542 host: "" - body: "{\"max_tokens\":10000,\"messages\":[{\"content\":[{\"text\":\"download the file from https://httpbin.org/robots.txt and save it as robots.txt\",\"type\":\"text\"}],\"role\":\"user\"},{\"content\":[{\"id\":\"toolu_01FbRijA4FwZhGzu8kBc2pDC\",\"input\":{\"file_path\":\"robots.txt\",\"url\":\"https://httpbin.org/robots.txt\"},\"name\":\"download\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"tool_use\"}],\"role\":\"assistant\"},{\"content\":[{\"tool_use_id\":\"toolu_01FbRijA4FwZhGzu8kBc2pDC\",\"cache_control\":{\"type\":\"ephemeral\"},\"content\":[{\"text\":\"Successfully downloaded 30 bytes to /tmp/crush-test/TestCoderAgent/anthropic-sonnet/download_tool/robots.txt (Content-Type: text/plain)\",\"type\":\"text\"}],\"type\":\"tool_result\"}],\"role\":\"user\"}],\"model\":\"claude-sonnet-4-5-20250929\",\"system\":[{\"text\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\u003cmemory_instructions\\u003e\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\u003c/memory_instructions\\u003e\\n\\u003ccommunication_style\\u003e\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\u003cexample\\u003e\\nuser: 2 + 2\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what is 2+2?\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: is 11 a prime number?\\nassistant: true\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\u003c/example\\u003e\\n\\u003c/communication_style\\u003e\\n\\n\\u003cproactiveness\\u003e\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\u003c/proactiveness\\u003e\\n\\n\\u003cfollowing_conversations\\u003e\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\u003c/following_conversations\\u003e\\n\\n\\u003ccode_style\\u003e\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\u003c/code_style\\u003e\\n\\n\\u003cdoing_tasks\\u003e\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\u003c/doing_tasks\\u003e\\n\\n\\u003ctool_use\\u003e\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\u003c/tool_use\\u003e\\n\\n\\u003cenv\\u003e\\nWorking directory: /tmp/crush-test/TestCoderAgent/anthropic-sonnet/download_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\u003c/env\\u003e\\n\\u003cmemory\\u003e\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\u003c/memory\\u003e\\n\\n\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"tool_choice\":{\"disable_parallel_tool_use\":false,\"type\":\"auto\"},\"tools\":[{\"input_schema\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"},\"name\":\"bash\",\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\u003ccross_platform\\u003e\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\u003c/cross_platform\\u003e\\n\\n\\u003cexecution_steps\\u003e\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with \\u003ccwd\\u003e\\u003c/cwd\\u003e tags\\n\\u003c/execution_steps\\u003e\\n\\n\\u003cusage_notes\\u003e\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '\\u0026\\u0026', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\u003c/usage_notes\\u003e\\n\\n\\u003cgit_commits\\u003e\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in \\u003ccommit_analysis\\u003e tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\u003ccrush@charm.land\\u003e\\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\u003c/git_commits\\u003e\\n\\n\\u003cpull_requests\\u003e\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in \\u003cpr_analysis\\u003e tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n\\n ## Summary\\n\\n \\u0026lt;1-3 bullet points\\u003e\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\u003c/pull_requests\\u003e\\n\\n\\u003cexamples\\u003e\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar \\u0026\\u0026 pytest tests\\n\\u003c/examples\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"},\"name\":\"download\",\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\u003cusage\\u003e\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"},\"name\":\"edit\",\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\u003c/parameters\\u003e\\n\\n\\u003cspecial_cases\\u003e\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\u003c/special_cases\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\u003c/best_practices\\u003e\\n\\n\\u003cwindows_notes\\u003e\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\u003c/windows_notes\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"},\"name\":\"multiedit\",\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\u003c/parameters\\u003e\\n\\n\\u003coperation\\u003e\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\u003c/operation\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\u003c/best_practices\\u003e\\n\\n\\u003cnew_file_creation\\u003e\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\u003c/new_file_creation\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"},\"name\":\"fetch\",\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\u003cusage\\u003e\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"glob\",\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cpattern_syntax\\u003e\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\u003c/pattern_syntax\\u003e\\n\\n\\u003cexamples\\u003e\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\u003c/examples\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"grep\",\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cregex_syntax\\u003e\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\u003c/regex_syntax\\u003e\\n\\n\\u003cinclude_patterns\\u003e\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\u003c/include_patterns\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003cignore_support\\u003e\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\u003c/ignore_support\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"name\":\"ls\",\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\u003cusage\\u003e\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"},\"name\":\"sourcegraph\",\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\u003cusage\\u003e\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cbasic_syntax\\u003e\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\u003c/basic_syntax\\u003e\\n\\n\\u003ckey_filters\\u003e\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\u003c/key_filters\\u003e\\n\\n\\u003cexamples\\u003e\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\u003c/examples\\u003e\\n\\n\\u003cboolean_operators\\u003e\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\u003c/boolean_operators\\u003e\\n\\n\\u003climitations\\u003e\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"},\"name\":\"view\",\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\u003cusage\\u003e\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines \\u003e2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"},\"name\":\"write\",\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\u003cusage\\u003e\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\u003c/tips\\u003e\\n\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"stream\":true}" + body: "{\"max_tokens\":10000,\"messages\":[{\"content\":[{\"text\":\"download the file from https://httpbin.org/robots.txt and save it as robots.txt\",\"type\":\"text\"}],\"role\":\"user\"},{\"content\":[{\"id\":\"toolu_01CEsZ8AEbiRNWg3qHVNLaLE\",\"input\":{\"file_path\":\"robots.txt\",\"url\":\"https://httpbin.org/robots.txt\"},\"name\":\"download\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"tool_use\"}],\"role\":\"assistant\"},{\"content\":[{\"tool_use_id\":\"toolu_01CEsZ8AEbiRNWg3qHVNLaLE\",\"cache_control\":{\"type\":\"ephemeral\"},\"content\":[{\"text\":\"Successfully downloaded 30 bytes to /tmp/crush-test/TestCoderAgent/anthropic-sonnet/download_tool/robots.txt (Content-Type: text/plain)\",\"type\":\"text\"}],\"type\":\"tool_result\"}],\"role\":\"user\"}],\"model\":\"claude-sonnet-4-5-20250929\",\"system\":[{\"text\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\u003cmemory_instructions\\u003e\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\u003c/memory_instructions\\u003e\\n\\u003ccommunication_style\\u003e\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\u003cexample\\u003e\\nuser: 2 + 2\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what is 2+2?\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: is 11 a prime number?\\nassistant: true\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\u003c/example\\u003e\\n\\u003c/communication_style\\u003e\\n\\n\\u003cproactiveness\\u003e\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\u003c/proactiveness\\u003e\\n\\n\\u003cfollowing_conversations\\u003e\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\u003c/following_conversations\\u003e\\n\\n\\u003ccode_style\\u003e\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\u003c/code_style\\u003e\\n\\n\\u003cdoing_tasks\\u003e\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\u003c/doing_tasks\\u003e\\n\\n\\u003ctool_use\\u003e\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\u003c/tool_use\\u003e\\n\\n\\u003cenv\\u003e\\nWorking directory: /tmp/crush-test/TestCoderAgent/anthropic-sonnet/download_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\u003c/env\\u003e\\n\\u003cmemory\\u003e\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\u003c/memory\\u003e\\n\\n\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"tool_choice\":{\"disable_parallel_tool_use\":false,\"type\":\"auto\"},\"tools\":[{\"input_schema\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"},\"name\":\"bash\",\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\u003ccross_platform\\u003e\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\u003c/cross_platform\\u003e\\n\\n\\u003cexecution_steps\\u003e\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with \\u003ccwd\\u003e\\u003c/cwd\\u003e tags\\n\\u003c/execution_steps\\u003e\\n\\n\\u003cusage_notes\\u003e\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '\\u0026\\u0026', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\u003c/usage_notes\\u003e\\n\\n\\u003cgit_commits\\u003e\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in \\u003ccommit_analysis\\u003e tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\u003ccrush@charm.land\\u003e\\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\u003c/git_commits\\u003e\\n\\n\\u003cpull_requests\\u003e\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in \\u003cpr_analysis\\u003e tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n\\n ## Summary\\n\\n \\u0026lt;1-3 bullet points\\u003e\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\u003c/pull_requests\\u003e\\n\\n\\u003cexamples\\u003e\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar \\u0026\\u0026 pytest tests\\n\\u003c/examples\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"},\"name\":\"download\",\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\u003cusage\\u003e\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"},\"name\":\"edit\",\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\u003c/parameters\\u003e\\n\\n\\u003cspecial_cases\\u003e\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\u003c/special_cases\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\u003c/best_practices\\u003e\\n\\n\\u003cwindows_notes\\u003e\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\u003c/windows_notes\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"},\"name\":\"multiedit\",\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\u003c/parameters\\u003e\\n\\n\\u003coperation\\u003e\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\u003c/operation\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\u003c/best_practices\\u003e\\n\\n\\u003cnew_file_creation\\u003e\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\u003c/new_file_creation\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"},\"name\":\"fetch\",\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\u003cusage\\u003e\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"glob\",\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cpattern_syntax\\u003e\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\u003c/pattern_syntax\\u003e\\n\\n\\u003cexamples\\u003e\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\u003c/examples\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"grep\",\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cregex_syntax\\u003e\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\u003c/regex_syntax\\u003e\\n\\n\\u003cinclude_patterns\\u003e\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\u003c/include_patterns\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003cignore_support\\u003e\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\u003c/ignore_support\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"name\":\"ls\",\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\u003cusage\\u003e\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"},\"name\":\"sourcegraph\",\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\u003cusage\\u003e\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cbasic_syntax\\u003e\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\u003c/basic_syntax\\u003e\\n\\n\\u003ckey_filters\\u003e\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\u003c/key_filters\\u003e\\n\\n\\u003cexamples\\u003e\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\u003c/examples\\u003e\\n\\n\\u003cboolean_operators\\u003e\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\u003c/boolean_operators\\u003e\\n\\n\\u003climitations\\u003e\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"},\"name\":\"view\",\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\u003cusage\\u003e\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines \\u003e2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"},\"name\":\"write\",\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\u003cusage\\u003e\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\u003c/tips\\u003e\\n\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"stream\":true}" headers: Accept: - application/json @@ -187,29 +190,38 @@ interactions: content_length: -1 body: |+ event: message_start - data: {"type":"message_start","message":{"id":"msg_01AFzwN7gLGSdJMqmF6nWFiC","type":"message","role":"assistant","model":"claude-sonnet-4-5-20250929","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":3,"cache_creation_input_tokens":132,"cache_read_input_tokens":8665,"cache_creation":{"ephemeral_5m_input_tokens":132,"ephemeral_1h_input_tokens":0},"output_tokens":2,"service_tier":"standard"}}} + data: {"type":"message_start","message":{"id":"msg_01J8GSz6WMbPPRamKrJTjW4r","type":"message","role":"assistant","model":"claude-sonnet-4-5-20250929","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":3,"cache_creation_input_tokens":132,"cache_read_input_tokens":8685,"cache_creation":{"ephemeral_5m_input_tokens":132,"ephemeral_1h_input_tokens":0},"output_tokens":2,"service_tier":"standard"}} } event: content_block_start - data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } + data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"\n\nDownloade"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"\n\nDownloade"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"d to `robots.txt`"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"d to `robots.txt`"} } + + event: ping + data: {"type": "ping"} event: content_block_stop - data: {"type":"content_block_stop","index":0 } + data: {"type":"content_block_stop","index":0 } + + event: ping + data: {"type": "ping"} + + event: ping + data: {"type": "ping"} event: message_delta - data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":3,"cache_creation_input_tokens":132,"cache_read_input_tokens":8665,"output_tokens":11} } + data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":3,"cache_creation_input_tokens":132,"cache_read_input_tokens":8685,"output_tokens":11} } event: message_stop - data: {"type":"message_stop" } + data: {"type":"message_stop" } headers: Content-Type: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 2.061355416s + duration: 2.273767917s diff --git a/internal/agent/testdata/TestCoderAgent/anthropic-sonnet/fetch_tool.yaml b/internal/agent/testdata/TestCoderAgent/anthropic-sonnet/fetch_tool.yaml index af1b498557945fced89c53fb015126aa51855e7b..cdf7fcd5f7a8ca759bb2e4856da42023aeaf5de4 100644 --- a/internal/agent/testdata/TestCoderAgent/anthropic-sonnet/fetch_tool.yaml +++ b/internal/agent/testdata/TestCoderAgent/anthropic-sonnet/fetch_tool.yaml @@ -25,49 +25,49 @@ interactions: content_length: -1 body: |+ event: message_start - data: {"type":"message_start","message":{"id":"msg_01NtNJUp6S5AoB7jc6EPLen2","type":"message","role":"assistant","model":"claude-3-5-haiku-20241022","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":131,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":3,"service_tier":"standard"}} } + data: {"type":"message_start","message":{"id":"msg_01CJaBVohy3QnSt6fTTq13Ye","type":"message","role":"assistant","model":"claude-3-5-haiku-20241022","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":131,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":3,"service_tier":"standard"}} } event: content_block_start - data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } + data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Fetch HTML"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Fetch HTML"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" an"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" an"} } event: ping data: {"type": "ping"} event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"d Search"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"d Search"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" for Herman"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" for Herman"} } event: content_block_stop - data: {"type":"content_block_stop","index":0 } + data: {"type":"content_block_stop","index":0 } event: message_delta - data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":131,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":10} } + data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":131,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":10} } event: message_stop - data: {"type":"message_stop" } + data: {"type":"message_stop" } headers: Content-Type: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 684.653208ms + duration: 613.788916ms - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 31988 + content_length: 32061 host: "" - body: "{\"max_tokens\":10000,\"messages\":[{\"content\":[{\"text\":\"fetch the content from https://httpbin.org/html and tell me if it contains the word 'Herman'\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"role\":\"user\"}],\"model\":\"claude-sonnet-4-5-20250929\",\"system\":[{\"text\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\u003cmemory_instructions\\u003e\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\u003c/memory_instructions\\u003e\\n\\u003ccommunication_style\\u003e\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\u003cexample\\u003e\\nuser: 2 + 2\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what is 2+2?\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: is 11 a prime number?\\nassistant: true\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\u003c/example\\u003e\\n\\u003c/communication_style\\u003e\\n\\n\\u003cproactiveness\\u003e\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\u003c/proactiveness\\u003e\\n\\n\\u003cfollowing_conversations\\u003e\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\u003c/following_conversations\\u003e\\n\\n\\u003ccode_style\\u003e\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\u003c/code_style\\u003e\\n\\n\\u003cdoing_tasks\\u003e\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\u003c/doing_tasks\\u003e\\n\\n\\u003ctool_use\\u003e\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\u003c/tool_use\\u003e\\n\\n\\u003cenv\\u003e\\nWorking directory: /tmp/crush-test/TestCoderAgent/anthropic-sonnet/fetch_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\u003c/env\\u003e\\n\\u003cmemory\\u003e\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\u003c/memory\\u003e\\n\\n\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"tool_choice\":{\"disable_parallel_tool_use\":false,\"type\":\"auto\"},\"tools\":[{\"input_schema\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"},\"name\":\"bash\",\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\u003ccross_platform\\u003e\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\u003c/cross_platform\\u003e\\n\\n\\u003cexecution_steps\\u003e\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with \\u003ccwd\\u003e\\u003c/cwd\\u003e tags\\n\\u003c/execution_steps\\u003e\\n\\n\\u003cusage_notes\\u003e\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '\\u0026\\u0026', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\u003c/usage_notes\\u003e\\n\\n\\u003cgit_commits\\u003e\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in \\u003ccommit_analysis\\u003e tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\u003ccrush@charm.land\\u003e\\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\u003c/git_commits\\u003e\\n\\n\\u003cpull_requests\\u003e\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in \\u003cpr_analysis\\u003e tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n\\n ## Summary\\n\\n \\u0026lt;1-3 bullet points\\u003e\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\u003c/pull_requests\\u003e\\n\\n\\u003cexamples\\u003e\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar \\u0026\\u0026 pytest tests\\n\\u003c/examples\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"},\"name\":\"download\",\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\u003cusage\\u003e\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"},\"name\":\"edit\",\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\u003c/parameters\\u003e\\n\\n\\u003cspecial_cases\\u003e\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\u003c/special_cases\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\u003c/best_practices\\u003e\\n\\n\\u003cwindows_notes\\u003e\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\u003c/windows_notes\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"},\"name\":\"multiedit\",\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\u003c/parameters\\u003e\\n\\n\\u003coperation\\u003e\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\u003c/operation\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\u003c/best_practices\\u003e\\n\\n\\u003cnew_file_creation\\u003e\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\u003c/new_file_creation\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"},\"name\":\"fetch\",\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\u003cusage\\u003e\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"glob\",\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cpattern_syntax\\u003e\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\u003c/pattern_syntax\\u003e\\n\\n\\u003cexamples\\u003e\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\u003c/examples\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"grep\",\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cregex_syntax\\u003e\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\u003c/regex_syntax\\u003e\\n\\n\\u003cinclude_patterns\\u003e\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\u003c/include_patterns\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003cignore_support\\u003e\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\u003c/ignore_support\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"name\":\"ls\",\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\u003cusage\\u003e\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"},\"name\":\"sourcegraph\",\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\u003cusage\\u003e\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cbasic_syntax\\u003e\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\u003c/basic_syntax\\u003e\\n\\n\\u003ckey_filters\\u003e\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\u003c/key_filters\\u003e\\n\\n\\u003cexamples\\u003e\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\u003c/examples\\u003e\\n\\n\\u003cboolean_operators\\u003e\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\u003c/boolean_operators\\u003e\\n\\n\\u003climitations\\u003e\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"},\"name\":\"view\",\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\u003cusage\\u003e\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines \\u003e2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"},\"name\":\"write\",\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\u003cusage\\u003e\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\u003c/tips\\u003e\\n\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"stream\":true}" + body: "{\"max_tokens\":10000,\"messages\":[{\"content\":[{\"text\":\"fetch the content from https://httpbin.org/html and tell me if it contains the word 'Herman'\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"role\":\"user\"}],\"model\":\"claude-sonnet-4-5-20250929\",\"system\":[{\"text\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\u003cmemory_instructions\\u003e\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\u003c/memory_instructions\\u003e\\n\\u003ccommunication_style\\u003e\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\u003cexample\\u003e\\nuser: 2 + 2\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what is 2+2?\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: is 11 a prime number?\\nassistant: true\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\u003c/example\\u003e\\n\\u003c/communication_style\\u003e\\n\\n\\u003cproactiveness\\u003e\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\u003c/proactiveness\\u003e\\n\\n\\u003cfollowing_conversations\\u003e\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\u003c/following_conversations\\u003e\\n\\n\\u003ccode_style\\u003e\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\u003c/code_style\\u003e\\n\\n\\u003cdoing_tasks\\u003e\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\u003c/doing_tasks\\u003e\\n\\n\\u003ctool_use\\u003e\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\u003c/tool_use\\u003e\\n\\n\\u003cenv\\u003e\\nWorking directory: /tmp/crush-test/TestCoderAgent/anthropic-sonnet/fetch_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\u003c/env\\u003e\\n\\u003cmemory\\u003e\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\u003c/memory\\u003e\\n\\n\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"tool_choice\":{\"disable_parallel_tool_use\":false,\"type\":\"auto\"},\"tools\":[{\"input_schema\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"},\"name\":\"bash\",\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\u003ccross_platform\\u003e\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\u003c/cross_platform\\u003e\\n\\n\\u003cexecution_steps\\u003e\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with \\u003ccwd\\u003e\\u003c/cwd\\u003e tags\\n\\u003c/execution_steps\\u003e\\n\\n\\u003cusage_notes\\u003e\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '\\u0026\\u0026', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\u003c/usage_notes\\u003e\\n\\n\\u003cgit_commits\\u003e\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in \\u003ccommit_analysis\\u003e tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\u003ccrush@charm.land\\u003e\\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\u003c/git_commits\\u003e\\n\\n\\u003cpull_requests\\u003e\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in \\u003cpr_analysis\\u003e tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n\\n ## Summary\\n\\n \\u0026lt;1-3 bullet points\\u003e\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\u003c/pull_requests\\u003e\\n\\n\\u003cexamples\\u003e\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar \\u0026\\u0026 pytest tests\\n\\u003c/examples\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"},\"name\":\"download\",\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\u003cusage\\u003e\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"},\"name\":\"edit\",\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\u003c/parameters\\u003e\\n\\n\\u003cspecial_cases\\u003e\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\u003c/special_cases\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\u003c/best_practices\\u003e\\n\\n\\u003cwindows_notes\\u003e\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\u003c/windows_notes\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"},\"name\":\"multiedit\",\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\u003c/parameters\\u003e\\n\\n\\u003coperation\\u003e\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\u003c/operation\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\u003c/best_practices\\u003e\\n\\n\\u003cnew_file_creation\\u003e\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\u003c/new_file_creation\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"},\"name\":\"fetch\",\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\u003cusage\\u003e\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"glob\",\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cpattern_syntax\\u003e\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\u003c/pattern_syntax\\u003e\\n\\n\\u003cexamples\\u003e\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\u003c/examples\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"grep\",\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cregex_syntax\\u003e\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\u003c/regex_syntax\\u003e\\n\\n\\u003cinclude_patterns\\u003e\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\u003c/include_patterns\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003cignore_support\\u003e\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\u003c/ignore_support\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"name\":\"ls\",\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\u003cusage\\u003e\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"},\"name\":\"sourcegraph\",\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\u003cusage\\u003e\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cbasic_syntax\\u003e\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\u003c/basic_syntax\\u003e\\n\\n\\u003ckey_filters\\u003e\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\u003c/key_filters\\u003e\\n\\n\\u003cexamples\\u003e\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\u003c/examples\\u003e\\n\\n\\u003cboolean_operators\\u003e\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\u003c/boolean_operators\\u003e\\n\\n\\u003climitations\\u003e\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"},\"name\":\"view\",\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\u003cusage\\u003e\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines \\u003e2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"},\"name\":\"write\",\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\u003cusage\\u003e\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\u003c/tips\\u003e\\n\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"stream\":true}" headers: Accept: - application/json @@ -84,53 +84,56 @@ interactions: content_length: -1 body: |+ event: message_start - data: {"type":"message_start","message":{"id":"msg_01Y6UpzGeuWqxH6jofvrJGJG","type":"message","role":"assistant","model":"claude-sonnet-4-5-20250929","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":3,"cache_creation_input_tokens":1784,"cache_read_input_tokens":6884,"cache_creation":{"ephemeral_5m_input_tokens":1784,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard"}} } + data: {"type":"message_start","message":{"id":"msg_01X23kvdJNaoozEfxkZrK4Ru","type":"message","role":"assistant","model":"claude-sonnet-4-5-20250929","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":3,"cache_creation_input_tokens":1784,"cache_read_input_tokens":6904,"cache_creation":{"ephemeral_5m_input_tokens":1784,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard"}}} event: content_block_start - data: {"type":"content_block_start","index":0,"content_block":{"type":"tool_use","id":"toolu_01J8QBHWy4Vr3APGNgJoYGTw","name":"fetch","input":{}} } + data: {"type":"content_block_start","index":0,"content_block":{"type":"tool_use","id":"toolu_01Ecoytx8xsxXc8FEPWMQN9u","name":"fetch","input":{}} } + + event: content_block_delta + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":""} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":""} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"{\"url\": "} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"{\"url\": \"htt"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"\"htt"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"ps://httpb"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"ps:/"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"in.org"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"/h"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"/html\""} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"ttpbin.org"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":", \"for"}} + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"/html\""} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"mat\""} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":", \"f"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":": \"tex"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"ormat\": "} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"t\"}"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"\"text\"}"} } event: content_block_stop - data: {"type":"content_block_stop","index":0 } + data: {"type":"content_block_stop","index":0 } event: message_delta - data: {"type":"message_delta","delta":{"stop_reason":"tool_use","stop_sequence":null},"usage":{"input_tokens":3,"cache_creation_input_tokens":1784,"cache_read_input_tokens":6884,"output_tokens":75} } + data: {"type":"message_delta","delta":{"stop_reason":"tool_use","stop_sequence":null},"usage":{"input_tokens":3,"cache_creation_input_tokens":1784,"cache_read_input_tokens":6904,"output_tokens":75} } event: message_stop - data: {"type":"message_stop" } + data: {"type":"message_stop" } headers: Content-Type: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 2.416710666s + duration: 2.324134125s - id: 2 request: proto: HTTP/1.1 @@ -168,15 +171,15 @@ interactions: - text/html; charset=utf-8 status: 200 OK code: 200 - duration: 1.289104875s + duration: 720.916167ms - id: 3 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 35922 + content_length: 35995 host: "" - body: "{\"max_tokens\":10000,\"messages\":[{\"content\":[{\"text\":\"fetch the content from https://httpbin.org/html and tell me if it contains the word 'Herman'\",\"type\":\"text\"}],\"role\":\"user\"},{\"content\":[{\"id\":\"toolu_01J8QBHWy4Vr3APGNgJoYGTw\",\"input\":{\"format\":\"text\",\"url\":\"https://httpbin.org/html\"},\"name\":\"fetch\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"tool_use\"}],\"role\":\"assistant\"},{\"content\":[{\"tool_use_id\":\"toolu_01J8QBHWy4Vr3APGNgJoYGTw\",\"cache_control\":{\"type\":\"ephemeral\"},\"content\":[{\"text\":\"Herman Melville - Moby-Dick Availing himself of the mild, summer-cool weather that now reigned in these latitudes, and in preparation for the peculiarly active pursuits shortly to be anticipated, Perth, the begrimed, blistered old blacksmith, had not removed his portable forge to the hold again, after concluding his contributory work for Ahab's leg, but still retained it on deck, fast lashed to ringbolts by the foremast; being now almost incessantly invoked by the headsmen, and harpooneers, and bowsmen to do some little job for them; altering, or repairing, or new shaping their various weapons and boat furniture. Often he would be surrounded by an eager circle, all waiting to be served; holding boat-spades, pike-heads, harpoons, and lances, and jealously watching his every sooty movement, as he toiled. Nevertheless, this old man's was a patient hammer wielded by a patient arm. No murmur, no impatience, no petulance did come from him. Silent, slow, and solemn; bowing over still further his chronically broken back, he toiled away, as if toil were life itself, and the heavy beating of his hammer the heavy beating of his heart. And so it was.—Most miserable! A peculiar walk in this old man, a certain slight but painful appearing yawing in his gait, had at an early period of the voyage excited the curiosity of the mariners. And to the importunity of their persisted questionings he had finally given in; and so it came to pass that every one now knew the shameful story of his wretched fate. Belated, and not innocently, one bitter winter's midnight, on the road running between two country towns, the blacksmith half-stupidly felt the deadly numbness stealing over him, and sought refuge in a leaning, dilapidated barn. The issue was, the loss of the extremities of both feet. Out of this revelation, part by part, at last came out the four acts of the gladness, and the one long, and as yet uncatastrophied fifth act of the grief of his life's drama. He was an old man, who, at the age of nearly sixty, had postponedly encountered that thing in sorrow's technicals called ruin. He had been an artisan of famed excellence, and with plenty to do; owned a house and garden; embraced a youthful, daughter-like, loving wife, and three blithe, ruddy children; every Sunday went to a cheerful-looking church, planted in a grove. But one night, under cover of darkness, and further concealed in a most cunning disguisement, a desperate burglar slid into his happy home, and robbed them all of everything. And darker yet to tell, the blacksmith himself did ignorantly conduct this burglar into his family's heart. It was the Bottle Conjuror! Upon the opening of that fatal cork, forth flew the fiend, and shrivelled up his home. Now, for prudent, most wise, and economic reasons, the blacksmith's shop was in the basement of his dwelling, but with a separate entrance to it; so that always had the young and loving healthy wife listened with no unhappy nervousness, but with vigorous pleasure, to the stout ringing of her young-armed old husband's hammer; whose reverberations, muffled by passing through the floors and walls, came up to her, not unsweetly, in her nursery; and so, to stout Labor's iron lullaby, the blacksmith's infants were rocked to slumber. Oh, woe on woe! Oh, Death, why canst thou not sometimes be timely? Hadst thou taken this old blacksmith to thyself ere his full ruin came upon him, then had the young widow had a delicious grief, and her orphans a truly venerable, legendary sire to dream of in their after years; and all of them a care-killing competency.\",\"type\":\"text\"}],\"type\":\"tool_result\"}],\"role\":\"user\"}],\"model\":\"claude-sonnet-4-5-20250929\",\"system\":[{\"text\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\u003cmemory_instructions\\u003e\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\u003c/memory_instructions\\u003e\\n\\u003ccommunication_style\\u003e\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\u003cexample\\u003e\\nuser: 2 + 2\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what is 2+2?\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: is 11 a prime number?\\nassistant: true\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\u003c/example\\u003e\\n\\u003c/communication_style\\u003e\\n\\n\\u003cproactiveness\\u003e\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\u003c/proactiveness\\u003e\\n\\n\\u003cfollowing_conversations\\u003e\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\u003c/following_conversations\\u003e\\n\\n\\u003ccode_style\\u003e\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\u003c/code_style\\u003e\\n\\n\\u003cdoing_tasks\\u003e\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\u003c/doing_tasks\\u003e\\n\\n\\u003ctool_use\\u003e\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\u003c/tool_use\\u003e\\n\\n\\u003cenv\\u003e\\nWorking directory: /tmp/crush-test/TestCoderAgent/anthropic-sonnet/fetch_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\u003c/env\\u003e\\n\\u003cmemory\\u003e\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\u003c/memory\\u003e\\n\\n\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"tool_choice\":{\"disable_parallel_tool_use\":false,\"type\":\"auto\"},\"tools\":[{\"input_schema\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"},\"name\":\"bash\",\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\u003ccross_platform\\u003e\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\u003c/cross_platform\\u003e\\n\\n\\u003cexecution_steps\\u003e\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with \\u003ccwd\\u003e\\u003c/cwd\\u003e tags\\n\\u003c/execution_steps\\u003e\\n\\n\\u003cusage_notes\\u003e\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '\\u0026\\u0026', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\u003c/usage_notes\\u003e\\n\\n\\u003cgit_commits\\u003e\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in \\u003ccommit_analysis\\u003e tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\u003ccrush@charm.land\\u003e\\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\u003c/git_commits\\u003e\\n\\n\\u003cpull_requests\\u003e\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in \\u003cpr_analysis\\u003e tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n\\n ## Summary\\n\\n \\u0026lt;1-3 bullet points\\u003e\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\u003c/pull_requests\\u003e\\n\\n\\u003cexamples\\u003e\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar \\u0026\\u0026 pytest tests\\n\\u003c/examples\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"},\"name\":\"download\",\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\u003cusage\\u003e\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"},\"name\":\"edit\",\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\u003c/parameters\\u003e\\n\\n\\u003cspecial_cases\\u003e\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\u003c/special_cases\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\u003c/best_practices\\u003e\\n\\n\\u003cwindows_notes\\u003e\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\u003c/windows_notes\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"},\"name\":\"multiedit\",\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\u003c/parameters\\u003e\\n\\n\\u003coperation\\u003e\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\u003c/operation\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\u003c/best_practices\\u003e\\n\\n\\u003cnew_file_creation\\u003e\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\u003c/new_file_creation\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"},\"name\":\"fetch\",\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\u003cusage\\u003e\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"glob\",\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cpattern_syntax\\u003e\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\u003c/pattern_syntax\\u003e\\n\\n\\u003cexamples\\u003e\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\u003c/examples\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"grep\",\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cregex_syntax\\u003e\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\u003c/regex_syntax\\u003e\\n\\n\\u003cinclude_patterns\\u003e\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\u003c/include_patterns\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003cignore_support\\u003e\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\u003c/ignore_support\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"name\":\"ls\",\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\u003cusage\\u003e\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"},\"name\":\"sourcegraph\",\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\u003cusage\\u003e\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cbasic_syntax\\u003e\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\u003c/basic_syntax\\u003e\\n\\n\\u003ckey_filters\\u003e\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\u003c/key_filters\\u003e\\n\\n\\u003cexamples\\u003e\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\u003c/examples\\u003e\\n\\n\\u003cboolean_operators\\u003e\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\u003c/boolean_operators\\u003e\\n\\n\\u003climitations\\u003e\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"},\"name\":\"view\",\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\u003cusage\\u003e\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines \\u003e2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"},\"name\":\"write\",\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\u003cusage\\u003e\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\u003c/tips\\u003e\\n\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"stream\":true}" + body: "{\"max_tokens\":10000,\"messages\":[{\"content\":[{\"text\":\"fetch the content from https://httpbin.org/html and tell me if it contains the word 'Herman'\",\"type\":\"text\"}],\"role\":\"user\"},{\"content\":[{\"id\":\"toolu_01Ecoytx8xsxXc8FEPWMQN9u\",\"input\":{\"format\":\"text\",\"url\":\"https://httpbin.org/html\"},\"name\":\"fetch\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"tool_use\"}],\"role\":\"assistant\"},{\"content\":[{\"tool_use_id\":\"toolu_01Ecoytx8xsxXc8FEPWMQN9u\",\"cache_control\":{\"type\":\"ephemeral\"},\"content\":[{\"text\":\"Herman Melville - Moby-Dick Availing himself of the mild, summer-cool weather that now reigned in these latitudes, and in preparation for the peculiarly active pursuits shortly to be anticipated, Perth, the begrimed, blistered old blacksmith, had not removed his portable forge to the hold again, after concluding his contributory work for Ahab's leg, but still retained it on deck, fast lashed to ringbolts by the foremast; being now almost incessantly invoked by the headsmen, and harpooneers, and bowsmen to do some little job for them; altering, or repairing, or new shaping their various weapons and boat furniture. Often he would be surrounded by an eager circle, all waiting to be served; holding boat-spades, pike-heads, harpoons, and lances, and jealously watching his every sooty movement, as he toiled. Nevertheless, this old man's was a patient hammer wielded by a patient arm. No murmur, no impatience, no petulance did come from him. Silent, slow, and solemn; bowing over still further his chronically broken back, he toiled away, as if toil were life itself, and the heavy beating of his hammer the heavy beating of his heart. And so it was.—Most miserable! A peculiar walk in this old man, a certain slight but painful appearing yawing in his gait, had at an early period of the voyage excited the curiosity of the mariners. And to the importunity of their persisted questionings he had finally given in; and so it came to pass that every one now knew the shameful story of his wretched fate. Belated, and not innocently, one bitter winter's midnight, on the road running between two country towns, the blacksmith half-stupidly felt the deadly numbness stealing over him, and sought refuge in a leaning, dilapidated barn. The issue was, the loss of the extremities of both feet. Out of this revelation, part by part, at last came out the four acts of the gladness, and the one long, and as yet uncatastrophied fifth act of the grief of his life's drama. He was an old man, who, at the age of nearly sixty, had postponedly encountered that thing in sorrow's technicals called ruin. He had been an artisan of famed excellence, and with plenty to do; owned a house and garden; embraced a youthful, daughter-like, loving wife, and three blithe, ruddy children; every Sunday went to a cheerful-looking church, planted in a grove. But one night, under cover of darkness, and further concealed in a most cunning disguisement, a desperate burglar slid into his happy home, and robbed them all of everything. And darker yet to tell, the blacksmith himself did ignorantly conduct this burglar into his family's heart. It was the Bottle Conjuror! Upon the opening of that fatal cork, forth flew the fiend, and shrivelled up his home. Now, for prudent, most wise, and economic reasons, the blacksmith's shop was in the basement of his dwelling, but with a separate entrance to it; so that always had the young and loving healthy wife listened with no unhappy nervousness, but with vigorous pleasure, to the stout ringing of her young-armed old husband's hammer; whose reverberations, muffled by passing through the floors and walls, came up to her, not unsweetly, in her nursery; and so, to stout Labor's iron lullaby, the blacksmith's infants were rocked to slumber. Oh, woe on woe! Oh, Death, why canst thou not sometimes be timely? Hadst thou taken this old blacksmith to thyself ere his full ruin came upon him, then had the young widow had a delicious grief, and her orphans a truly venerable, legendary sire to dream of in their after years; and all of them a care-killing competency.\",\"type\":\"text\"}],\"type\":\"tool_result\"}],\"role\":\"user\"}],\"model\":\"claude-sonnet-4-5-20250929\",\"system\":[{\"text\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\u003cmemory_instructions\\u003e\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\u003c/memory_instructions\\u003e\\n\\u003ccommunication_style\\u003e\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\u003cexample\\u003e\\nuser: 2 + 2\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what is 2+2?\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: is 11 a prime number?\\nassistant: true\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\u003c/example\\u003e\\n\\u003c/communication_style\\u003e\\n\\n\\u003cproactiveness\\u003e\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\u003c/proactiveness\\u003e\\n\\n\\u003cfollowing_conversations\\u003e\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\u003c/following_conversations\\u003e\\n\\n\\u003ccode_style\\u003e\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\u003c/code_style\\u003e\\n\\n\\u003cdoing_tasks\\u003e\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\u003c/doing_tasks\\u003e\\n\\n\\u003ctool_use\\u003e\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\u003c/tool_use\\u003e\\n\\n\\u003cenv\\u003e\\nWorking directory: /tmp/crush-test/TestCoderAgent/anthropic-sonnet/fetch_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\u003c/env\\u003e\\n\\u003cmemory\\u003e\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\u003c/memory\\u003e\\n\\n\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"tool_choice\":{\"disable_parallel_tool_use\":false,\"type\":\"auto\"},\"tools\":[{\"input_schema\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"},\"name\":\"bash\",\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\u003ccross_platform\\u003e\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\u003c/cross_platform\\u003e\\n\\n\\u003cexecution_steps\\u003e\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with \\u003ccwd\\u003e\\u003c/cwd\\u003e tags\\n\\u003c/execution_steps\\u003e\\n\\n\\u003cusage_notes\\u003e\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '\\u0026\\u0026', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\u003c/usage_notes\\u003e\\n\\n\\u003cgit_commits\\u003e\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in \\u003ccommit_analysis\\u003e tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\u003ccrush@charm.land\\u003e\\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\u003c/git_commits\\u003e\\n\\n\\u003cpull_requests\\u003e\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in \\u003cpr_analysis\\u003e tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n\\n ## Summary\\n\\n \\u0026lt;1-3 bullet points\\u003e\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\u003c/pull_requests\\u003e\\n\\n\\u003cexamples\\u003e\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar \\u0026\\u0026 pytest tests\\n\\u003c/examples\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"},\"name\":\"download\",\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\u003cusage\\u003e\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"},\"name\":\"edit\",\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\u003c/parameters\\u003e\\n\\n\\u003cspecial_cases\\u003e\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\u003c/special_cases\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\u003c/best_practices\\u003e\\n\\n\\u003cwindows_notes\\u003e\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\u003c/windows_notes\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"},\"name\":\"multiedit\",\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\u003c/parameters\\u003e\\n\\n\\u003coperation\\u003e\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\u003c/operation\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\u003c/best_practices\\u003e\\n\\n\\u003cnew_file_creation\\u003e\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\u003c/new_file_creation\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"},\"name\":\"fetch\",\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\u003cusage\\u003e\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"glob\",\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cpattern_syntax\\u003e\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\u003c/pattern_syntax\\u003e\\n\\n\\u003cexamples\\u003e\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\u003c/examples\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"grep\",\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cregex_syntax\\u003e\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\u003c/regex_syntax\\u003e\\n\\n\\u003cinclude_patterns\\u003e\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\u003c/include_patterns\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003cignore_support\\u003e\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\u003c/ignore_support\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"name\":\"ls\",\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\u003cusage\\u003e\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"},\"name\":\"sourcegraph\",\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\u003cusage\\u003e\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cbasic_syntax\\u003e\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\u003c/basic_syntax\\u003e\\n\\n\\u003ckey_filters\\u003e\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\u003c/key_filters\\u003e\\n\\n\\u003cexamples\\u003e\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\u003c/examples\\u003e\\n\\n\\u003cboolean_operators\\u003e\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\u003c/boolean_operators\\u003e\\n\\n\\u003climitations\\u003e\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"},\"name\":\"view\",\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\u003cusage\\u003e\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines \\u003e2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"},\"name\":\"write\",\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\u003cusage\\u003e\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\u003c/tips\\u003e\\n\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"stream\":true}" headers: Accept: - application/json @@ -193,47 +196,41 @@ interactions: content_length: -1 body: |+ event: message_start - data: {"type":"message_start","message":{"id":"msg_01Rb2Hx5yRLy44gfRsju7ZSa","type":"message","role":"assistant","model":"claude-sonnet-4-5-20250929","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":3,"cache_creation_input_tokens":980,"cache_read_input_tokens":8668,"cache_creation":{"ephemeral_5m_input_tokens":980,"ephemeral_1h_input_tokens":0},"output_tokens":2,"service_tier":"standard"}} } + data: {"type":"message_start","message":{"id":"msg_01GaRucxiAsZDvNBFkyJDcLz","type":"message","role":"assistant","model":"claude-sonnet-4-5-20250929","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":3,"cache_creation_input_tokens":980,"cache_read_input_tokens":8688,"cache_creation":{"ephemeral_5m_input_tokens":980,"ephemeral_1h_input_tokens":0},"output_tokens":2,"service_tier":"standard"}} } event: content_block_start - data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } + data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"\n\nYes"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"\n\nYes"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":", the content"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":", it contains \""} } event: ping data: {"type": "ping"} event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" contains \"Herman\""} } - - event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" - specifically \"Herman"} } - - event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Melville -"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Herman\" - it"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Moby-Dick\" at"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"'s from Herman Melville's"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" the beginning."} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Moby-Dick."} } event: content_block_stop - data: {"type":"content_block_stop","index":0 } + data: {"type":"content_block_stop","index":0 } event: message_delta - data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":3,"cache_creation_input_tokens":980,"cache_read_input_tokens":8668,"output_tokens":30} } + data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":3,"cache_creation_input_tokens":980,"cache_read_input_tokens":8688,"output_tokens":26} } event: message_stop - data: {"type":"message_stop" } + data: {"type":"message_stop" } headers: Content-Type: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 2.24787125s + duration: 2.328552709s diff --git a/internal/agent/testdata/TestCoderAgent/anthropic-sonnet/glob_tool.yaml b/internal/agent/testdata/TestCoderAgent/anthropic-sonnet/glob_tool.yaml index 6acdd23fc85ec591a97d4ef4d18fba952347d2de..95ad22fa4c0bdbf377bd07d58c7b582278e30afb 100644 --- a/internal/agent/testdata/TestCoderAgent/anthropic-sonnet/glob_tool.yaml +++ b/internal/agent/testdata/TestCoderAgent/anthropic-sonnet/glob_tool.yaml @@ -25,31 +25,31 @@ interactions: content_length: -1 body: |+ event: message_start - data: {"type":"message_start","message":{"id":"msg_01WwaUg4XieW6yqSW7w39k5r","type":"message","role":"assistant","model":"claude-3-5-haiku-20241022","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":119,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard"}} } + data: {"type":"message_start","message":{"id":"msg_01DfEsKzksKF1iW3v1d8Uz14","type":"message","role":"assistant","model":"claude-3-5-haiku-20241022","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":119,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard"}} } event: content_block_start - data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } + data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Finding"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Fin"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Go"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"d Go"} } event: ping data: {"type": "ping"} event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" files with glob"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Files"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" pattern"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" in Current Directory"} } event: content_block_stop data: {"type":"content_block_stop","index":0 } event: message_delta - data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":119,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":9} } + data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":119,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":9} } event: message_stop data: {"type":"message_stop" } @@ -59,15 +59,15 @@ interactions: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 590.105791ms + duration: 642.710375ms - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 31950 + content_length: 32023 host: "" - body: "{\"max_tokens\":10000,\"messages\":[{\"content\":[{\"text\":\"use glob to find all .go files in the current directory\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"role\":\"user\"}],\"model\":\"claude-sonnet-4-5-20250929\",\"system\":[{\"text\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\u003cmemory_instructions\\u003e\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\u003c/memory_instructions\\u003e\\n\\u003ccommunication_style\\u003e\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\u003cexample\\u003e\\nuser: 2 + 2\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what is 2+2?\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: is 11 a prime number?\\nassistant: true\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\u003c/example\\u003e\\n\\u003c/communication_style\\u003e\\n\\n\\u003cproactiveness\\u003e\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\u003c/proactiveness\\u003e\\n\\n\\u003cfollowing_conversations\\u003e\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\u003c/following_conversations\\u003e\\n\\n\\u003ccode_style\\u003e\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\u003c/code_style\\u003e\\n\\n\\u003cdoing_tasks\\u003e\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\u003c/doing_tasks\\u003e\\n\\n\\u003ctool_use\\u003e\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\u003c/tool_use\\u003e\\n\\n\\u003cenv\\u003e\\nWorking directory: /tmp/crush-test/TestCoderAgent/anthropic-sonnet/glob_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\u003c/env\\u003e\\n\\u003cmemory\\u003e\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\u003c/memory\\u003e\\n\\n\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"tool_choice\":{\"disable_parallel_tool_use\":false,\"type\":\"auto\"},\"tools\":[{\"input_schema\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"},\"name\":\"bash\",\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\u003ccross_platform\\u003e\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\u003c/cross_platform\\u003e\\n\\n\\u003cexecution_steps\\u003e\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with \\u003ccwd\\u003e\\u003c/cwd\\u003e tags\\n\\u003c/execution_steps\\u003e\\n\\n\\u003cusage_notes\\u003e\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '\\u0026\\u0026', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\u003c/usage_notes\\u003e\\n\\n\\u003cgit_commits\\u003e\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in \\u003ccommit_analysis\\u003e tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\u003ccrush@charm.land\\u003e\\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\u003c/git_commits\\u003e\\n\\n\\u003cpull_requests\\u003e\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in \\u003cpr_analysis\\u003e tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n\\n ## Summary\\n\\n \\u0026lt;1-3 bullet points\\u003e\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\u003c/pull_requests\\u003e\\n\\n\\u003cexamples\\u003e\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar \\u0026\\u0026 pytest tests\\n\\u003c/examples\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"},\"name\":\"download\",\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\u003cusage\\u003e\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"},\"name\":\"edit\",\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\u003c/parameters\\u003e\\n\\n\\u003cspecial_cases\\u003e\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\u003c/special_cases\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\u003c/best_practices\\u003e\\n\\n\\u003cwindows_notes\\u003e\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\u003c/windows_notes\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"},\"name\":\"multiedit\",\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\u003c/parameters\\u003e\\n\\n\\u003coperation\\u003e\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\u003c/operation\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\u003c/best_practices\\u003e\\n\\n\\u003cnew_file_creation\\u003e\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\u003c/new_file_creation\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"},\"name\":\"fetch\",\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\u003cusage\\u003e\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"glob\",\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cpattern_syntax\\u003e\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\u003c/pattern_syntax\\u003e\\n\\n\\u003cexamples\\u003e\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\u003c/examples\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"grep\",\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cregex_syntax\\u003e\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\u003c/regex_syntax\\u003e\\n\\n\\u003cinclude_patterns\\u003e\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\u003c/include_patterns\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003cignore_support\\u003e\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\u003c/ignore_support\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"name\":\"ls\",\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\u003cusage\\u003e\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"},\"name\":\"sourcegraph\",\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\u003cusage\\u003e\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cbasic_syntax\\u003e\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\u003c/basic_syntax\\u003e\\n\\n\\u003ckey_filters\\u003e\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\u003c/key_filters\\u003e\\n\\n\\u003cexamples\\u003e\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\u003c/examples\\u003e\\n\\n\\u003cboolean_operators\\u003e\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\u003c/boolean_operators\\u003e\\n\\n\\u003climitations\\u003e\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"},\"name\":\"view\",\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\u003cusage\\u003e\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines \\u003e2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"},\"name\":\"write\",\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\u003cusage\\u003e\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\u003c/tips\\u003e\\n\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"stream\":true}" + body: "{\"max_tokens\":10000,\"messages\":[{\"content\":[{\"text\":\"use glob to find all .go files in the current directory\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"role\":\"user\"}],\"model\":\"claude-sonnet-4-5-20250929\",\"system\":[{\"text\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\u003cmemory_instructions\\u003e\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\u003c/memory_instructions\\u003e\\n\\u003ccommunication_style\\u003e\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\u003cexample\\u003e\\nuser: 2 + 2\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what is 2+2?\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: is 11 a prime number?\\nassistant: true\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\u003c/example\\u003e\\n\\u003c/communication_style\\u003e\\n\\n\\u003cproactiveness\\u003e\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\u003c/proactiveness\\u003e\\n\\n\\u003cfollowing_conversations\\u003e\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\u003c/following_conversations\\u003e\\n\\n\\u003ccode_style\\u003e\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\u003c/code_style\\u003e\\n\\n\\u003cdoing_tasks\\u003e\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\u003c/doing_tasks\\u003e\\n\\n\\u003ctool_use\\u003e\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\u003c/tool_use\\u003e\\n\\n\\u003cenv\\u003e\\nWorking directory: /tmp/crush-test/TestCoderAgent/anthropic-sonnet/glob_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\u003c/env\\u003e\\n\\u003cmemory\\u003e\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\u003c/memory\\u003e\\n\\n\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"tool_choice\":{\"disable_parallel_tool_use\":false,\"type\":\"auto\"},\"tools\":[{\"input_schema\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"},\"name\":\"bash\",\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\u003ccross_platform\\u003e\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\u003c/cross_platform\\u003e\\n\\n\\u003cexecution_steps\\u003e\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with \\u003ccwd\\u003e\\u003c/cwd\\u003e tags\\n\\u003c/execution_steps\\u003e\\n\\n\\u003cusage_notes\\u003e\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '\\u0026\\u0026', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\u003c/usage_notes\\u003e\\n\\n\\u003cgit_commits\\u003e\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in \\u003ccommit_analysis\\u003e tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\u003ccrush@charm.land\\u003e\\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\u003c/git_commits\\u003e\\n\\n\\u003cpull_requests\\u003e\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in \\u003cpr_analysis\\u003e tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n\\n ## Summary\\n\\n \\u0026lt;1-3 bullet points\\u003e\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\u003c/pull_requests\\u003e\\n\\n\\u003cexamples\\u003e\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar \\u0026\\u0026 pytest tests\\n\\u003c/examples\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"},\"name\":\"download\",\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\u003cusage\\u003e\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"},\"name\":\"edit\",\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\u003c/parameters\\u003e\\n\\n\\u003cspecial_cases\\u003e\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\u003c/special_cases\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\u003c/best_practices\\u003e\\n\\n\\u003cwindows_notes\\u003e\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\u003c/windows_notes\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"},\"name\":\"multiedit\",\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\u003c/parameters\\u003e\\n\\n\\u003coperation\\u003e\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\u003c/operation\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\u003c/best_practices\\u003e\\n\\n\\u003cnew_file_creation\\u003e\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\u003c/new_file_creation\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"},\"name\":\"fetch\",\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\u003cusage\\u003e\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"glob\",\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cpattern_syntax\\u003e\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\u003c/pattern_syntax\\u003e\\n\\n\\u003cexamples\\u003e\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\u003c/examples\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"grep\",\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cregex_syntax\\u003e\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\u003c/regex_syntax\\u003e\\n\\n\\u003cinclude_patterns\\u003e\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\u003c/include_patterns\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003cignore_support\\u003e\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\u003c/ignore_support\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"name\":\"ls\",\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\u003cusage\\u003e\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"},\"name\":\"sourcegraph\",\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\u003cusage\\u003e\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cbasic_syntax\\u003e\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\u003c/basic_syntax\\u003e\\n\\n\\u003ckey_filters\\u003e\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\u003c/key_filters\\u003e\\n\\n\\u003cexamples\\u003e\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\u003c/examples\\u003e\\n\\n\\u003cboolean_operators\\u003e\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\u003c/boolean_operators\\u003e\\n\\n\\u003climitations\\u003e\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"},\"name\":\"view\",\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\u003cusage\\u003e\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines \\u003e2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"},\"name\":\"write\",\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\u003cusage\\u003e\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\u003c/tips\\u003e\\n\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"stream\":true}" headers: Accept: - application/json @@ -84,46 +84,49 @@ interactions: content_length: -1 body: |+ event: message_start - data: {"type":"message_start","message":{"id":"msg_01VYvTZ5s3b9umjyTg1bgZTe","type":"message","role":"assistant","model":"claude-sonnet-4-5-20250929","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":3,"cache_creation_input_tokens":1772,"cache_read_input_tokens":6884,"cache_creation":{"ephemeral_5m_input_tokens":1772,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard"}} } + data: {"type":"message_start","message":{"id":"msg_016nYXF2j1rPksw22yQv8G8m","type":"message","role":"assistant","model":"claude-sonnet-4-5-20250929","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":3,"cache_creation_input_tokens":1772,"cache_read_input_tokens":6904,"cache_creation":{"ephemeral_5m_input_tokens":1772,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard"}} } event: content_block_start - data: {"type":"content_block_start","index":0,"content_block":{"type":"tool_use","id":"toolu_01LS3gXs6acSkQ1Wrimv97Hj","name":"glob","input":{}} } + data: {"type":"content_block_start","index":0,"content_block":{"type":"tool_use","id":"toolu_01E2Q5HYmjsEgvfPKfXZbWiq","name":"glob","input":{}} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":""} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":""} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"{\"pattern\": "} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"{\"pattern"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"\"*.go"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"\": \"*"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"\"}"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":".g"} } + + event: content_block_delta + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"o\"}"}} event: content_block_stop - data: {"type":"content_block_stop","index":0 } + data: {"type":"content_block_stop","index":0 } event: message_delta - data: {"type":"message_delta","delta":{"stop_reason":"tool_use","stop_sequence":null},"usage":{"input_tokens":3,"cache_creation_input_tokens":1772,"cache_read_input_tokens":6884,"output_tokens":52} } + data: {"type":"message_delta","delta":{"stop_reason":"tool_use","stop_sequence":null},"usage":{"input_tokens":3,"cache_creation_input_tokens":1772,"cache_read_input_tokens":6904,"output_tokens":52} } event: message_stop - data: {"type":"message_stop" } + data: {"type":"message_stop" } headers: Content-Type: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 2.741230375s + duration: 1.8509865s - id: 2 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 32320 + content_length: 32393 host: "" - body: "{\"max_tokens\":10000,\"messages\":[{\"content\":[{\"text\":\"use glob to find all .go files in the current directory\",\"type\":\"text\"}],\"role\":\"user\"},{\"content\":[{\"id\":\"toolu_01LS3gXs6acSkQ1Wrimv97Hj\",\"input\":{\"pattern\":\"*.go\"},\"name\":\"glob\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"tool_use\"}],\"role\":\"assistant\"},{\"content\":[{\"tool_use_id\":\"toolu_01LS3gXs6acSkQ1Wrimv97Hj\",\"cache_control\":{\"type\":\"ephemeral\"},\"content\":[{\"text\":\"/tmp/crush-test/TestCoderAgent/anthropic-sonnet/glob_tool/main.go\",\"type\":\"text\"}],\"type\":\"tool_result\"}],\"role\":\"user\"}],\"model\":\"claude-sonnet-4-5-20250929\",\"system\":[{\"text\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\u003cmemory_instructions\\u003e\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\u003c/memory_instructions\\u003e\\n\\u003ccommunication_style\\u003e\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\u003cexample\\u003e\\nuser: 2 + 2\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what is 2+2?\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: is 11 a prime number?\\nassistant: true\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\u003c/example\\u003e\\n\\u003c/communication_style\\u003e\\n\\n\\u003cproactiveness\\u003e\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\u003c/proactiveness\\u003e\\n\\n\\u003cfollowing_conversations\\u003e\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\u003c/following_conversations\\u003e\\n\\n\\u003ccode_style\\u003e\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\u003c/code_style\\u003e\\n\\n\\u003cdoing_tasks\\u003e\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\u003c/doing_tasks\\u003e\\n\\n\\u003ctool_use\\u003e\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\u003c/tool_use\\u003e\\n\\n\\u003cenv\\u003e\\nWorking directory: /tmp/crush-test/TestCoderAgent/anthropic-sonnet/glob_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\u003c/env\\u003e\\n\\u003cmemory\\u003e\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\u003c/memory\\u003e\\n\\n\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"tool_choice\":{\"disable_parallel_tool_use\":false,\"type\":\"auto\"},\"tools\":[{\"input_schema\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"},\"name\":\"bash\",\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\u003ccross_platform\\u003e\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\u003c/cross_platform\\u003e\\n\\n\\u003cexecution_steps\\u003e\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with \\u003ccwd\\u003e\\u003c/cwd\\u003e tags\\n\\u003c/execution_steps\\u003e\\n\\n\\u003cusage_notes\\u003e\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '\\u0026\\u0026', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\u003c/usage_notes\\u003e\\n\\n\\u003cgit_commits\\u003e\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in \\u003ccommit_analysis\\u003e tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\u003ccrush@charm.land\\u003e\\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\u003c/git_commits\\u003e\\n\\n\\u003cpull_requests\\u003e\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in \\u003cpr_analysis\\u003e tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n\\n ## Summary\\n\\n \\u0026lt;1-3 bullet points\\u003e\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\u003c/pull_requests\\u003e\\n\\n\\u003cexamples\\u003e\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar \\u0026\\u0026 pytest tests\\n\\u003c/examples\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"},\"name\":\"download\",\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\u003cusage\\u003e\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"},\"name\":\"edit\",\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\u003c/parameters\\u003e\\n\\n\\u003cspecial_cases\\u003e\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\u003c/special_cases\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\u003c/best_practices\\u003e\\n\\n\\u003cwindows_notes\\u003e\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\u003c/windows_notes\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"},\"name\":\"multiedit\",\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\u003c/parameters\\u003e\\n\\n\\u003coperation\\u003e\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\u003c/operation\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\u003c/best_practices\\u003e\\n\\n\\u003cnew_file_creation\\u003e\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\u003c/new_file_creation\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"},\"name\":\"fetch\",\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\u003cusage\\u003e\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"glob\",\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cpattern_syntax\\u003e\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\u003c/pattern_syntax\\u003e\\n\\n\\u003cexamples\\u003e\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\u003c/examples\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"grep\",\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cregex_syntax\\u003e\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\u003c/regex_syntax\\u003e\\n\\n\\u003cinclude_patterns\\u003e\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\u003c/include_patterns\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003cignore_support\\u003e\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\u003c/ignore_support\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"name\":\"ls\",\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\u003cusage\\u003e\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"},\"name\":\"sourcegraph\",\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\u003cusage\\u003e\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cbasic_syntax\\u003e\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\u003c/basic_syntax\\u003e\\n\\n\\u003ckey_filters\\u003e\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\u003c/key_filters\\u003e\\n\\n\\u003cexamples\\u003e\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\u003c/examples\\u003e\\n\\n\\u003cboolean_operators\\u003e\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\u003c/boolean_operators\\u003e\\n\\n\\u003climitations\\u003e\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"},\"name\":\"view\",\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\u003cusage\\u003e\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines \\u003e2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"},\"name\":\"write\",\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\u003cusage\\u003e\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\u003c/tips\\u003e\\n\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"stream\":true}" + body: "{\"max_tokens\":10000,\"messages\":[{\"content\":[{\"text\":\"use glob to find all .go files in the current directory\",\"type\":\"text\"}],\"role\":\"user\"},{\"content\":[{\"id\":\"toolu_01E2Q5HYmjsEgvfPKfXZbWiq\",\"input\":{\"pattern\":\"*.go\"},\"name\":\"glob\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"tool_use\"}],\"role\":\"assistant\"},{\"content\":[{\"tool_use_id\":\"toolu_01E2Q5HYmjsEgvfPKfXZbWiq\",\"cache_control\":{\"type\":\"ephemeral\"},\"content\":[{\"text\":\"/tmp/crush-test/TestCoderAgent/anthropic-sonnet/glob_tool/main.go\",\"type\":\"text\"}],\"type\":\"tool_result\"}],\"role\":\"user\"}],\"model\":\"claude-sonnet-4-5-20250929\",\"system\":[{\"text\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\u003cmemory_instructions\\u003e\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\u003c/memory_instructions\\u003e\\n\\u003ccommunication_style\\u003e\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\u003cexample\\u003e\\nuser: 2 + 2\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what is 2+2?\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: is 11 a prime number?\\nassistant: true\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\u003c/example\\u003e\\n\\u003c/communication_style\\u003e\\n\\n\\u003cproactiveness\\u003e\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\u003c/proactiveness\\u003e\\n\\n\\u003cfollowing_conversations\\u003e\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\u003c/following_conversations\\u003e\\n\\n\\u003ccode_style\\u003e\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\u003c/code_style\\u003e\\n\\n\\u003cdoing_tasks\\u003e\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\u003c/doing_tasks\\u003e\\n\\n\\u003ctool_use\\u003e\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\u003c/tool_use\\u003e\\n\\n\\u003cenv\\u003e\\nWorking directory: /tmp/crush-test/TestCoderAgent/anthropic-sonnet/glob_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\u003c/env\\u003e\\n\\u003cmemory\\u003e\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\u003c/memory\\u003e\\n\\n\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"tool_choice\":{\"disable_parallel_tool_use\":false,\"type\":\"auto\"},\"tools\":[{\"input_schema\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"},\"name\":\"bash\",\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\u003ccross_platform\\u003e\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\u003c/cross_platform\\u003e\\n\\n\\u003cexecution_steps\\u003e\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with \\u003ccwd\\u003e\\u003c/cwd\\u003e tags\\n\\u003c/execution_steps\\u003e\\n\\n\\u003cusage_notes\\u003e\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '\\u0026\\u0026', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\u003c/usage_notes\\u003e\\n\\n\\u003cgit_commits\\u003e\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in \\u003ccommit_analysis\\u003e tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\u003ccrush@charm.land\\u003e\\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\u003c/git_commits\\u003e\\n\\n\\u003cpull_requests\\u003e\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in \\u003cpr_analysis\\u003e tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n\\n ## Summary\\n\\n \\u0026lt;1-3 bullet points\\u003e\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\u003c/pull_requests\\u003e\\n\\n\\u003cexamples\\u003e\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar \\u0026\\u0026 pytest tests\\n\\u003c/examples\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"},\"name\":\"download\",\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\u003cusage\\u003e\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"},\"name\":\"edit\",\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\u003c/parameters\\u003e\\n\\n\\u003cspecial_cases\\u003e\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\u003c/special_cases\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\u003c/best_practices\\u003e\\n\\n\\u003cwindows_notes\\u003e\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\u003c/windows_notes\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"},\"name\":\"multiedit\",\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\u003c/parameters\\u003e\\n\\n\\u003coperation\\u003e\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\u003c/operation\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\u003c/best_practices\\u003e\\n\\n\\u003cnew_file_creation\\u003e\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\u003c/new_file_creation\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"},\"name\":\"fetch\",\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\u003cusage\\u003e\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"glob\",\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cpattern_syntax\\u003e\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\u003c/pattern_syntax\\u003e\\n\\n\\u003cexamples\\u003e\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\u003c/examples\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"grep\",\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cregex_syntax\\u003e\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\u003c/regex_syntax\\u003e\\n\\n\\u003cinclude_patterns\\u003e\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\u003c/include_patterns\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003cignore_support\\u003e\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\u003c/ignore_support\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"name\":\"ls\",\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\u003cusage\\u003e\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"},\"name\":\"sourcegraph\",\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\u003cusage\\u003e\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cbasic_syntax\\u003e\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\u003c/basic_syntax\\u003e\\n\\n\\u003ckey_filters\\u003e\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\u003c/key_filters\\u003e\\n\\n\\u003cexamples\\u003e\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\u003c/examples\\u003e\\n\\n\\u003cboolean_operators\\u003e\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\u003c/boolean_operators\\u003e\\n\\n\\u003climitations\\u003e\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"},\"name\":\"view\",\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\u003cusage\\u003e\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines \\u003e2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"},\"name\":\"write\",\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\u003cusage\\u003e\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\u003c/tips\\u003e\\n\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"stream\":true}" headers: Accept: - application/json @@ -140,22 +143,22 @@ interactions: content_length: -1 body: |+ event: message_start - data: {"type":"message_start","message":{"id":"msg_01BpXjAubV4riAwFw1EnWg3f","type":"message","role":"assistant","model":"claude-sonnet-4-5-20250929","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":4,"cache_creation_input_tokens":86,"cache_read_input_tokens":8656,"cache_creation":{"ephemeral_5m_input_tokens":86,"ephemeral_1h_input_tokens":0},"output_tokens":2,"service_tier":"standard"}} } + data: {"type":"message_start","message":{"id":"msg_01GUwykdLpxqfjNjoa4fpvEF","type":"message","role":"assistant","model":"claude-sonnet-4-5-20250929","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":4,"cache_creation_input_tokens":86,"cache_read_input_tokens":8676,"cache_creation":{"ephemeral_5m_input_tokens":86,"ephemeral_1h_input_tokens":0},"output_tokens":2,"service_tier":"standard"}} } event: content_block_start - data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } + data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"\n\nmain"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"\n\n`"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":".go"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"main.go`"} } event: ping data: {"type": "ping"} event: content_block_stop - data: {"type":"content_block_stop","index":0 } + data: {"type":"content_block_stop","index":0} event: ping data: {"type": "ping"} @@ -164,14 +167,14 @@ interactions: data: {"type": "ping"} event: message_delta - data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":4,"cache_creation_input_tokens":86,"cache_read_input_tokens":8656,"output_tokens":7}} + data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":4,"cache_creation_input_tokens":86,"cache_read_input_tokens":8676,"output_tokens":9} } event: message_stop - data: {"type":"message_stop" } + data: {"type":"message_stop" } headers: Content-Type: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 2.701019083s + duration: 2.214405334s diff --git a/internal/agent/testdata/TestCoderAgent/anthropic-sonnet/grep_tool.yaml b/internal/agent/testdata/TestCoderAgent/anthropic-sonnet/grep_tool.yaml index d7ae5fa8395e3fa1f95aa9543ee62c3fc40c551e..5c61180279a2464a1ed512d0f6847d3d279aac45 100644 --- a/internal/agent/testdata/TestCoderAgent/anthropic-sonnet/grep_tool.yaml +++ b/internal/agent/testdata/TestCoderAgent/anthropic-sonnet/grep_tool.yaml @@ -25,46 +25,49 @@ interactions: content_length: -1 body: |+ event: message_start - data: {"type":"message_start","message":{"id":"msg_01J38RteGBbXWmXWyG82CoSd","type":"message","role":"assistant","model":"claude-3-5-haiku-20241022","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":121,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":3,"service_tier":"standard"}} } + data: {"type":"message_start","message":{"id":"msg_01P5KzdPQFQJt2KXiM1sE2LA","type":"message","role":"assistant","model":"claude-3-5-haiku-20241022","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":121,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":6,"service_tier":"standard"}} } event: content_block_start - data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } + data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Searching Package"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Searching for 'package"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" References"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"' in Go Files"} } event: ping data: {"type": "ping"} - event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" in Go Files"} } - event: content_block_stop - data: {"type":"content_block_stop","index":0 } + data: {"type":"content_block_stop","index":0 } + + event: ping + data: {"type": "ping"} + + event: ping + data: {"type": "ping"} event: message_delta - data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":121,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":10} } + data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":121,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":13} } event: message_stop - data: {"type":"message_stop" } + data: {"type":"message_stop" } headers: Content-Type: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 606.941292ms + duration: 576.391708ms - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 31948 + content_length: 32021 host: "" - body: "{\"max_tokens\":10000,\"messages\":[{\"content\":[{\"text\":\"use grep to search for the word 'package' in go files\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"role\":\"user\"}],\"model\":\"claude-sonnet-4-5-20250929\",\"system\":[{\"text\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\u003cmemory_instructions\\u003e\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\u003c/memory_instructions\\u003e\\n\\u003ccommunication_style\\u003e\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\u003cexample\\u003e\\nuser: 2 + 2\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what is 2+2?\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: is 11 a prime number?\\nassistant: true\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\u003c/example\\u003e\\n\\u003c/communication_style\\u003e\\n\\n\\u003cproactiveness\\u003e\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\u003c/proactiveness\\u003e\\n\\n\\u003cfollowing_conversations\\u003e\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\u003c/following_conversations\\u003e\\n\\n\\u003ccode_style\\u003e\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\u003c/code_style\\u003e\\n\\n\\u003cdoing_tasks\\u003e\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\u003c/doing_tasks\\u003e\\n\\n\\u003ctool_use\\u003e\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\u003c/tool_use\\u003e\\n\\n\\u003cenv\\u003e\\nWorking directory: /tmp/crush-test/TestCoderAgent/anthropic-sonnet/grep_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\u003c/env\\u003e\\n\\u003cmemory\\u003e\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\u003c/memory\\u003e\\n\\n\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"tool_choice\":{\"disable_parallel_tool_use\":false,\"type\":\"auto\"},\"tools\":[{\"input_schema\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"},\"name\":\"bash\",\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\u003ccross_platform\\u003e\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\u003c/cross_platform\\u003e\\n\\n\\u003cexecution_steps\\u003e\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with \\u003ccwd\\u003e\\u003c/cwd\\u003e tags\\n\\u003c/execution_steps\\u003e\\n\\n\\u003cusage_notes\\u003e\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '\\u0026\\u0026', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\u003c/usage_notes\\u003e\\n\\n\\u003cgit_commits\\u003e\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in \\u003ccommit_analysis\\u003e tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\u003ccrush@charm.land\\u003e\\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\u003c/git_commits\\u003e\\n\\n\\u003cpull_requests\\u003e\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in \\u003cpr_analysis\\u003e tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n\\n ## Summary\\n\\n \\u0026lt;1-3 bullet points\\u003e\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\u003c/pull_requests\\u003e\\n\\n\\u003cexamples\\u003e\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar \\u0026\\u0026 pytest tests\\n\\u003c/examples\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"},\"name\":\"download\",\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\u003cusage\\u003e\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"},\"name\":\"edit\",\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\u003c/parameters\\u003e\\n\\n\\u003cspecial_cases\\u003e\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\u003c/special_cases\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\u003c/best_practices\\u003e\\n\\n\\u003cwindows_notes\\u003e\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\u003c/windows_notes\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"},\"name\":\"multiedit\",\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\u003c/parameters\\u003e\\n\\n\\u003coperation\\u003e\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\u003c/operation\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\u003c/best_practices\\u003e\\n\\n\\u003cnew_file_creation\\u003e\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\u003c/new_file_creation\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"},\"name\":\"fetch\",\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\u003cusage\\u003e\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"glob\",\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cpattern_syntax\\u003e\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\u003c/pattern_syntax\\u003e\\n\\n\\u003cexamples\\u003e\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\u003c/examples\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"grep\",\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cregex_syntax\\u003e\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\u003c/regex_syntax\\u003e\\n\\n\\u003cinclude_patterns\\u003e\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\u003c/include_patterns\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003cignore_support\\u003e\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\u003c/ignore_support\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"name\":\"ls\",\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\u003cusage\\u003e\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"},\"name\":\"sourcegraph\",\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\u003cusage\\u003e\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cbasic_syntax\\u003e\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\u003c/basic_syntax\\u003e\\n\\n\\u003ckey_filters\\u003e\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\u003c/key_filters\\u003e\\n\\n\\u003cexamples\\u003e\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\u003c/examples\\u003e\\n\\n\\u003cboolean_operators\\u003e\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\u003c/boolean_operators\\u003e\\n\\n\\u003climitations\\u003e\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"},\"name\":\"view\",\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\u003cusage\\u003e\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines \\u003e2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"},\"name\":\"write\",\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\u003cusage\\u003e\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\u003c/tips\\u003e\\n\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"stream\":true}" + body: "{\"max_tokens\":10000,\"messages\":[{\"content\":[{\"text\":\"use grep to search for the word 'package' in go files\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"role\":\"user\"}],\"model\":\"claude-sonnet-4-5-20250929\",\"system\":[{\"text\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\u003cmemory_instructions\\u003e\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\u003c/memory_instructions\\u003e\\n\\u003ccommunication_style\\u003e\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\u003cexample\\u003e\\nuser: 2 + 2\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what is 2+2?\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: is 11 a prime number?\\nassistant: true\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\u003c/example\\u003e\\n\\u003c/communication_style\\u003e\\n\\n\\u003cproactiveness\\u003e\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\u003c/proactiveness\\u003e\\n\\n\\u003cfollowing_conversations\\u003e\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\u003c/following_conversations\\u003e\\n\\n\\u003ccode_style\\u003e\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\u003c/code_style\\u003e\\n\\n\\u003cdoing_tasks\\u003e\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\u003c/doing_tasks\\u003e\\n\\n\\u003ctool_use\\u003e\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\u003c/tool_use\\u003e\\n\\n\\u003cenv\\u003e\\nWorking directory: /tmp/crush-test/TestCoderAgent/anthropic-sonnet/grep_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\u003c/env\\u003e\\n\\u003cmemory\\u003e\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\u003c/memory\\u003e\\n\\n\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"tool_choice\":{\"disable_parallel_tool_use\":false,\"type\":\"auto\"},\"tools\":[{\"input_schema\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"},\"name\":\"bash\",\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\u003ccross_platform\\u003e\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\u003c/cross_platform\\u003e\\n\\n\\u003cexecution_steps\\u003e\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with \\u003ccwd\\u003e\\u003c/cwd\\u003e tags\\n\\u003c/execution_steps\\u003e\\n\\n\\u003cusage_notes\\u003e\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '\\u0026\\u0026', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\u003c/usage_notes\\u003e\\n\\n\\u003cgit_commits\\u003e\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in \\u003ccommit_analysis\\u003e tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\u003ccrush@charm.land\\u003e\\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\u003c/git_commits\\u003e\\n\\n\\u003cpull_requests\\u003e\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in \\u003cpr_analysis\\u003e tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n\\n ## Summary\\n\\n \\u0026lt;1-3 bullet points\\u003e\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\u003c/pull_requests\\u003e\\n\\n\\u003cexamples\\u003e\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar \\u0026\\u0026 pytest tests\\n\\u003c/examples\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"},\"name\":\"download\",\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\u003cusage\\u003e\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"},\"name\":\"edit\",\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\u003c/parameters\\u003e\\n\\n\\u003cspecial_cases\\u003e\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\u003c/special_cases\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\u003c/best_practices\\u003e\\n\\n\\u003cwindows_notes\\u003e\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\u003c/windows_notes\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"},\"name\":\"multiedit\",\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\u003c/parameters\\u003e\\n\\n\\u003coperation\\u003e\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\u003c/operation\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\u003c/best_practices\\u003e\\n\\n\\u003cnew_file_creation\\u003e\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\u003c/new_file_creation\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"},\"name\":\"fetch\",\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\u003cusage\\u003e\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"glob\",\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cpattern_syntax\\u003e\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\u003c/pattern_syntax\\u003e\\n\\n\\u003cexamples\\u003e\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\u003c/examples\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"grep\",\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cregex_syntax\\u003e\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\u003c/regex_syntax\\u003e\\n\\n\\u003cinclude_patterns\\u003e\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\u003c/include_patterns\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003cignore_support\\u003e\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\u003c/ignore_support\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"name\":\"ls\",\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\u003cusage\\u003e\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"},\"name\":\"sourcegraph\",\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\u003cusage\\u003e\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cbasic_syntax\\u003e\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\u003c/basic_syntax\\u003e\\n\\n\\u003ckey_filters\\u003e\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\u003c/key_filters\\u003e\\n\\n\\u003cexamples\\u003e\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\u003c/examples\\u003e\\n\\n\\u003cboolean_operators\\u003e\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\u003c/boolean_operators\\u003e\\n\\n\\u003climitations\\u003e\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"},\"name\":\"view\",\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\u003cusage\\u003e\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines \\u003e2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"},\"name\":\"write\",\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\u003cusage\\u003e\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\u003c/tips\\u003e\\n\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"stream\":true}" headers: Accept: - application/json @@ -81,55 +84,55 @@ interactions: content_length: -1 body: |+ event: message_start - data: {"type":"message_start","message":{"id":"msg_01DthcFEACsyuSQhVb8RpYUo","type":"message","role":"assistant","model":"claude-sonnet-4-5-20250929","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":3,"cache_creation_input_tokens":1774,"cache_read_input_tokens":6884,"cache_creation":{"ephemeral_5m_input_tokens":1774,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard"}} } + data: {"type":"message_start","message":{"id":"msg_01VYfUxzDnHd62cCDLfojrCi","type":"message","role":"assistant","model":"claude-sonnet-4-5-20250929","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":3,"cache_creation_input_tokens":1774,"cache_read_input_tokens":6904,"cache_creation":{"ephemeral_5m_input_tokens":1774,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard"}}} event: content_block_start - data: {"type":"content_block_start","index":0,"content_block":{"type":"tool_use","id":"toolu_015waHM5Bfrp4SFSHj6gvP3d","name":"grep","input":{}} } + data: {"type":"content_block_start","index":0,"content_block":{"type":"tool_use","id":"toolu_01TWDeMQ2e1nGps4JEzJJRAB","name":"grep","input":{}} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":""} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":""} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"{\"patt"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"{\"pat"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"ern"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"tern\": \"p"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"\": \"package"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"ack"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"\""} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"age\""} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":", \"includ"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":", \"include\""} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"e\": \"*.go\"}"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":": \"*.go\"}"} } event: content_block_stop - data: {"type":"content_block_stop","index":0 } + data: {"type":"content_block_stop","index":0 } event: message_delta - data: {"type":"message_delta","delta":{"stop_reason":"tool_use","stop_sequence":null},"usage":{"input_tokens":3,"cache_creation_input_tokens":1774,"cache_read_input_tokens":6884,"output_tokens":69} } + data: {"type":"message_delta","delta":{"stop_reason":"tool_use","stop_sequence":null},"usage":{"input_tokens":3,"cache_creation_input_tokens":1774,"cache_read_input_tokens":6904,"output_tokens":69} } event: message_stop - data: {"type":"message_stop" } + data: {"type":"message_stop" } headers: Content-Type: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 2.140881709s + duration: 2.269266333s - id: 2 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 32382 + content_length: 32455 host: "" - body: "{\"max_tokens\":10000,\"messages\":[{\"content\":[{\"text\":\"use grep to search for the word 'package' in go files\",\"type\":\"text\"}],\"role\":\"user\"},{\"content\":[{\"id\":\"toolu_015waHM5Bfrp4SFSHj6gvP3d\",\"input\":{\"include\":\"*.go\",\"pattern\":\"package\"},\"name\":\"grep\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"tool_use\"}],\"role\":\"assistant\"},{\"content\":[{\"tool_use_id\":\"toolu_015waHM5Bfrp4SFSHj6gvP3d\",\"cache_control\":{\"type\":\"ephemeral\"},\"content\":[{\"text\":\"Found 1 matches\\n/tmp/crush-test/TestCoderAgent/anthropic-sonnet/grep_tool/main.go:\\n Line 1: package main\\n\",\"type\":\"text\"}],\"type\":\"tool_result\"}],\"role\":\"user\"}],\"model\":\"claude-sonnet-4-5-20250929\",\"system\":[{\"text\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\u003cmemory_instructions\\u003e\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\u003c/memory_instructions\\u003e\\n\\u003ccommunication_style\\u003e\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\u003cexample\\u003e\\nuser: 2 + 2\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what is 2+2?\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: is 11 a prime number?\\nassistant: true\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\u003c/example\\u003e\\n\\u003c/communication_style\\u003e\\n\\n\\u003cproactiveness\\u003e\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\u003c/proactiveness\\u003e\\n\\n\\u003cfollowing_conversations\\u003e\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\u003c/following_conversations\\u003e\\n\\n\\u003ccode_style\\u003e\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\u003c/code_style\\u003e\\n\\n\\u003cdoing_tasks\\u003e\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\u003c/doing_tasks\\u003e\\n\\n\\u003ctool_use\\u003e\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\u003c/tool_use\\u003e\\n\\n\\u003cenv\\u003e\\nWorking directory: /tmp/crush-test/TestCoderAgent/anthropic-sonnet/grep_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\u003c/env\\u003e\\n\\u003cmemory\\u003e\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\u003c/memory\\u003e\\n\\n\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"tool_choice\":{\"disable_parallel_tool_use\":false,\"type\":\"auto\"},\"tools\":[{\"input_schema\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"},\"name\":\"bash\",\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\u003ccross_platform\\u003e\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\u003c/cross_platform\\u003e\\n\\n\\u003cexecution_steps\\u003e\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with \\u003ccwd\\u003e\\u003c/cwd\\u003e tags\\n\\u003c/execution_steps\\u003e\\n\\n\\u003cusage_notes\\u003e\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '\\u0026\\u0026', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\u003c/usage_notes\\u003e\\n\\n\\u003cgit_commits\\u003e\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in \\u003ccommit_analysis\\u003e tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\u003ccrush@charm.land\\u003e\\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\u003c/git_commits\\u003e\\n\\n\\u003cpull_requests\\u003e\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in \\u003cpr_analysis\\u003e tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n\\n ## Summary\\n\\n \\u0026lt;1-3 bullet points\\u003e\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\u003c/pull_requests\\u003e\\n\\n\\u003cexamples\\u003e\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar \\u0026\\u0026 pytest tests\\n\\u003c/examples\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"},\"name\":\"download\",\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\u003cusage\\u003e\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"},\"name\":\"edit\",\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\u003c/parameters\\u003e\\n\\n\\u003cspecial_cases\\u003e\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\u003c/special_cases\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\u003c/best_practices\\u003e\\n\\n\\u003cwindows_notes\\u003e\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\u003c/windows_notes\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"},\"name\":\"multiedit\",\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\u003c/parameters\\u003e\\n\\n\\u003coperation\\u003e\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\u003c/operation\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\u003c/best_practices\\u003e\\n\\n\\u003cnew_file_creation\\u003e\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\u003c/new_file_creation\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"},\"name\":\"fetch\",\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\u003cusage\\u003e\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"glob\",\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cpattern_syntax\\u003e\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\u003c/pattern_syntax\\u003e\\n\\n\\u003cexamples\\u003e\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\u003c/examples\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"grep\",\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cregex_syntax\\u003e\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\u003c/regex_syntax\\u003e\\n\\n\\u003cinclude_patterns\\u003e\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\u003c/include_patterns\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003cignore_support\\u003e\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\u003c/ignore_support\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"name\":\"ls\",\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\u003cusage\\u003e\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"},\"name\":\"sourcegraph\",\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\u003cusage\\u003e\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cbasic_syntax\\u003e\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\u003c/basic_syntax\\u003e\\n\\n\\u003ckey_filters\\u003e\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\u003c/key_filters\\u003e\\n\\n\\u003cexamples\\u003e\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\u003c/examples\\u003e\\n\\n\\u003cboolean_operators\\u003e\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\u003c/boolean_operators\\u003e\\n\\n\\u003climitations\\u003e\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"},\"name\":\"view\",\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\u003cusage\\u003e\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines \\u003e2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"},\"name\":\"write\",\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\u003cusage\\u003e\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\u003c/tips\\u003e\\n\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"stream\":true}" + body: "{\"max_tokens\":10000,\"messages\":[{\"content\":[{\"text\":\"use grep to search for the word 'package' in go files\",\"type\":\"text\"}],\"role\":\"user\"},{\"content\":[{\"id\":\"toolu_01TWDeMQ2e1nGps4JEzJJRAB\",\"input\":{\"include\":\"*.go\",\"pattern\":\"package\"},\"name\":\"grep\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"tool_use\"}],\"role\":\"assistant\"},{\"content\":[{\"tool_use_id\":\"toolu_01TWDeMQ2e1nGps4JEzJJRAB\",\"cache_control\":{\"type\":\"ephemeral\"},\"content\":[{\"text\":\"Found 1 matches\\n/tmp/crush-test/TestCoderAgent/anthropic-sonnet/grep_tool/main.go:\\n Line 1: package main\\n\",\"type\":\"text\"}],\"type\":\"tool_result\"}],\"role\":\"user\"}],\"model\":\"claude-sonnet-4-5-20250929\",\"system\":[{\"text\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\u003cmemory_instructions\\u003e\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\u003c/memory_instructions\\u003e\\n\\u003ccommunication_style\\u003e\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\u003cexample\\u003e\\nuser: 2 + 2\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what is 2+2?\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: is 11 a prime number?\\nassistant: true\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\u003c/example\\u003e\\n\\u003c/communication_style\\u003e\\n\\n\\u003cproactiveness\\u003e\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\u003c/proactiveness\\u003e\\n\\n\\u003cfollowing_conversations\\u003e\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\u003c/following_conversations\\u003e\\n\\n\\u003ccode_style\\u003e\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\u003c/code_style\\u003e\\n\\n\\u003cdoing_tasks\\u003e\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\u003c/doing_tasks\\u003e\\n\\n\\u003ctool_use\\u003e\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\u003c/tool_use\\u003e\\n\\n\\u003cenv\\u003e\\nWorking directory: /tmp/crush-test/TestCoderAgent/anthropic-sonnet/grep_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\u003c/env\\u003e\\n\\u003cmemory\\u003e\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\u003c/memory\\u003e\\n\\n\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"tool_choice\":{\"disable_parallel_tool_use\":false,\"type\":\"auto\"},\"tools\":[{\"input_schema\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"},\"name\":\"bash\",\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\u003ccross_platform\\u003e\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\u003c/cross_platform\\u003e\\n\\n\\u003cexecution_steps\\u003e\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with \\u003ccwd\\u003e\\u003c/cwd\\u003e tags\\n\\u003c/execution_steps\\u003e\\n\\n\\u003cusage_notes\\u003e\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '\\u0026\\u0026', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\u003c/usage_notes\\u003e\\n\\n\\u003cgit_commits\\u003e\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in \\u003ccommit_analysis\\u003e tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\u003ccrush@charm.land\\u003e\\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\u003c/git_commits\\u003e\\n\\n\\u003cpull_requests\\u003e\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in \\u003cpr_analysis\\u003e tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n\\n ## Summary\\n\\n \\u0026lt;1-3 bullet points\\u003e\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\u003c/pull_requests\\u003e\\n\\n\\u003cexamples\\u003e\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar \\u0026\\u0026 pytest tests\\n\\u003c/examples\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"},\"name\":\"download\",\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\u003cusage\\u003e\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"},\"name\":\"edit\",\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\u003c/parameters\\u003e\\n\\n\\u003cspecial_cases\\u003e\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\u003c/special_cases\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\u003c/best_practices\\u003e\\n\\n\\u003cwindows_notes\\u003e\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\u003c/windows_notes\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"},\"name\":\"multiedit\",\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\u003c/parameters\\u003e\\n\\n\\u003coperation\\u003e\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\u003c/operation\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\u003c/best_practices\\u003e\\n\\n\\u003cnew_file_creation\\u003e\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\u003c/new_file_creation\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"},\"name\":\"fetch\",\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\u003cusage\\u003e\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"glob\",\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cpattern_syntax\\u003e\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\u003c/pattern_syntax\\u003e\\n\\n\\u003cexamples\\u003e\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\u003c/examples\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"grep\",\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cregex_syntax\\u003e\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\u003c/regex_syntax\\u003e\\n\\n\\u003cinclude_patterns\\u003e\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\u003c/include_patterns\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003cignore_support\\u003e\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\u003c/ignore_support\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"name\":\"ls\",\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\u003cusage\\u003e\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"},\"name\":\"sourcegraph\",\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\u003cusage\\u003e\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cbasic_syntax\\u003e\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\u003c/basic_syntax\\u003e\\n\\n\\u003ckey_filters\\u003e\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\u003c/key_filters\\u003e\\n\\n\\u003cexamples\\u003e\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\u003c/examples\\u003e\\n\\n\\u003cboolean_operators\\u003e\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\u003c/boolean_operators\\u003e\\n\\n\\u003climitations\\u003e\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"},\"name\":\"view\",\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\u003cusage\\u003e\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines \\u003e2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"},\"name\":\"write\",\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\u003cusage\\u003e\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\u003c/tips\\u003e\\n\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"stream\":true}" headers: Accept: - application/json @@ -146,44 +149,35 @@ interactions: content_length: -1 body: |+ event: message_start - data: {"type":"message_start","message":{"id":"msg_01NMXrb6HGzt9cpzgWZ8gaH5","type":"message","role":"assistant","model":"claude-sonnet-4-5-20250929","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":4,"cache_creation_input_tokens":120,"cache_read_input_tokens":8658,"cache_creation":{"ephemeral_5m_input_tokens":120,"ephemeral_1h_input_tokens":0},"output_tokens":2,"service_tier":"standard"}} } + data: {"type":"message_start","message":{"id":"msg_01Euw7y822J9Y1Kh9xEEkogY","type":"message","role":"assistant","model":"claude-sonnet-4-5-20250929","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":4,"cache_creation_input_tokens":120,"cache_read_input_tokens":8678,"cache_creation":{"ephemeral_5m_input_tokens":120,"ephemeral_1h_input_tokens":0},"output_tokens":2,"service_tier":"standard"}} } event: content_block_start - data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } + data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"\n\nFoun"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"\n\nFoun"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"d 1 match"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"d 1 match in"} } event: ping data: {"type": "ping"} event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" in `main"} } - - event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":".go` at"} } - - event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" line 1 with `package main"} } - - event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"`."} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" `main.go` at line 1."} } event: content_block_stop - data: {"type":"content_block_stop","index":0 } + data: {"type":"content_block_stop","index":0 } event: message_delta - data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":4,"cache_creation_input_tokens":120,"cache_read_input_tokens":8658,"output_tokens":25} } + data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":4,"cache_creation_input_tokens":120,"cache_read_input_tokens":8678,"output_tokens":20} } event: message_stop - data: {"type":"message_stop" } + data: {"type":"message_stop" } headers: Content-Type: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 2.030814167s + duration: 2.13041775s diff --git a/internal/agent/testdata/TestCoderAgent/anthropic-sonnet/ls_tool.yaml b/internal/agent/testdata/TestCoderAgent/anthropic-sonnet/ls_tool.yaml index 777d1a1db25a6d4bc286475af1d1d99e3181e46d..8b5b3060db5ea8b51b86e03868faef9b5151e06d 100644 --- a/internal/agent/testdata/TestCoderAgent/anthropic-sonnet/ls_tool.yaml +++ b/internal/agent/testdata/TestCoderAgent/anthropic-sonnet/ls_tool.yaml @@ -25,49 +25,49 @@ interactions: content_length: -1 body: |+ event: message_start - data: {"type":"message_start","message":{"id":"msg_01N9F5dFrZ7hWhfTckebnP44","type":"message","role":"assistant","model":"claude-3-5-haiku-20241022","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":117,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard"}} } + data: {"type":"message_start","message":{"id":"msg_01QH5MdoAQhjFKPFQT1CiZtv","type":"message","role":"assistant","model":"claude-3-5-haiku-20241022","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":117,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard"}} } event: content_block_start - data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } + data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"List"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"List"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Files"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Files"} } event: ping data: {"type": "ping"} event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" in"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" in"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Current Directory"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Current Directory"} } event: content_block_stop - data: {"type":"content_block_stop","index":0 } + data: {"type":"content_block_stop","index":0 } event: message_delta - data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":117,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":8} } + data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":117,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":8}} event: message_stop - data: {"type":"message_stop" } + data: {"type":"message_stop" } headers: Content-Type: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 609.700625ms + duration: 525.075666ms - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 31942 + content_length: 32015 host: "" - body: "{\"max_tokens\":10000,\"messages\":[{\"content\":[{\"text\":\"use ls to list the files in the current directory\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"role\":\"user\"}],\"model\":\"claude-sonnet-4-5-20250929\",\"system\":[{\"text\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\u003cmemory_instructions\\u003e\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\u003c/memory_instructions\\u003e\\n\\u003ccommunication_style\\u003e\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\u003cexample\\u003e\\nuser: 2 + 2\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what is 2+2?\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: is 11 a prime number?\\nassistant: true\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\u003c/example\\u003e\\n\\u003c/communication_style\\u003e\\n\\n\\u003cproactiveness\\u003e\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\u003c/proactiveness\\u003e\\n\\n\\u003cfollowing_conversations\\u003e\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\u003c/following_conversations\\u003e\\n\\n\\u003ccode_style\\u003e\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\u003c/code_style\\u003e\\n\\n\\u003cdoing_tasks\\u003e\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\u003c/doing_tasks\\u003e\\n\\n\\u003ctool_use\\u003e\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\u003c/tool_use\\u003e\\n\\n\\u003cenv\\u003e\\nWorking directory: /tmp/crush-test/TestCoderAgent/anthropic-sonnet/ls_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\u003c/env\\u003e\\n\\u003cmemory\\u003e\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\u003c/memory\\u003e\\n\\n\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"tool_choice\":{\"disable_parallel_tool_use\":false,\"type\":\"auto\"},\"tools\":[{\"input_schema\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"},\"name\":\"bash\",\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\u003ccross_platform\\u003e\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\u003c/cross_platform\\u003e\\n\\n\\u003cexecution_steps\\u003e\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with \\u003ccwd\\u003e\\u003c/cwd\\u003e tags\\n\\u003c/execution_steps\\u003e\\n\\n\\u003cusage_notes\\u003e\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '\\u0026\\u0026', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\u003c/usage_notes\\u003e\\n\\n\\u003cgit_commits\\u003e\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in \\u003ccommit_analysis\\u003e tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\u003ccrush@charm.land\\u003e\\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\u003c/git_commits\\u003e\\n\\n\\u003cpull_requests\\u003e\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in \\u003cpr_analysis\\u003e tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n\\n ## Summary\\n\\n \\u0026lt;1-3 bullet points\\u003e\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\u003c/pull_requests\\u003e\\n\\n\\u003cexamples\\u003e\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar \\u0026\\u0026 pytest tests\\n\\u003c/examples\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"},\"name\":\"download\",\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\u003cusage\\u003e\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"},\"name\":\"edit\",\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\u003c/parameters\\u003e\\n\\n\\u003cspecial_cases\\u003e\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\u003c/special_cases\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\u003c/best_practices\\u003e\\n\\n\\u003cwindows_notes\\u003e\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\u003c/windows_notes\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"},\"name\":\"multiedit\",\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\u003c/parameters\\u003e\\n\\n\\u003coperation\\u003e\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\u003c/operation\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\u003c/best_practices\\u003e\\n\\n\\u003cnew_file_creation\\u003e\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\u003c/new_file_creation\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"},\"name\":\"fetch\",\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\u003cusage\\u003e\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"glob\",\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cpattern_syntax\\u003e\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\u003c/pattern_syntax\\u003e\\n\\n\\u003cexamples\\u003e\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\u003c/examples\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"grep\",\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cregex_syntax\\u003e\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\u003c/regex_syntax\\u003e\\n\\n\\u003cinclude_patterns\\u003e\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\u003c/include_patterns\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003cignore_support\\u003e\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\u003c/ignore_support\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"name\":\"ls\",\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\u003cusage\\u003e\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"},\"name\":\"sourcegraph\",\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\u003cusage\\u003e\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cbasic_syntax\\u003e\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\u003c/basic_syntax\\u003e\\n\\n\\u003ckey_filters\\u003e\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\u003c/key_filters\\u003e\\n\\n\\u003cexamples\\u003e\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\u003c/examples\\u003e\\n\\n\\u003cboolean_operators\\u003e\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\u003c/boolean_operators\\u003e\\n\\n\\u003climitations\\u003e\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"},\"name\":\"view\",\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\u003cusage\\u003e\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines \\u003e2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"},\"name\":\"write\",\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\u003cusage\\u003e\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\u003c/tips\\u003e\\n\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"stream\":true}" + body: "{\"max_tokens\":10000,\"messages\":[{\"content\":[{\"text\":\"use ls to list the files in the current directory\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"role\":\"user\"}],\"model\":\"claude-sonnet-4-5-20250929\",\"system\":[{\"text\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\u003cmemory_instructions\\u003e\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\u003c/memory_instructions\\u003e\\n\\u003ccommunication_style\\u003e\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\u003cexample\\u003e\\nuser: 2 + 2\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what is 2+2?\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: is 11 a prime number?\\nassistant: true\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\u003c/example\\u003e\\n\\u003c/communication_style\\u003e\\n\\n\\u003cproactiveness\\u003e\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\u003c/proactiveness\\u003e\\n\\n\\u003cfollowing_conversations\\u003e\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\u003c/following_conversations\\u003e\\n\\n\\u003ccode_style\\u003e\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\u003c/code_style\\u003e\\n\\n\\u003cdoing_tasks\\u003e\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\u003c/doing_tasks\\u003e\\n\\n\\u003ctool_use\\u003e\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\u003c/tool_use\\u003e\\n\\n\\u003cenv\\u003e\\nWorking directory: /tmp/crush-test/TestCoderAgent/anthropic-sonnet/ls_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\u003c/env\\u003e\\n\\u003cmemory\\u003e\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\u003c/memory\\u003e\\n\\n\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"tool_choice\":{\"disable_parallel_tool_use\":false,\"type\":\"auto\"},\"tools\":[{\"input_schema\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"},\"name\":\"bash\",\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\u003ccross_platform\\u003e\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\u003c/cross_platform\\u003e\\n\\n\\u003cexecution_steps\\u003e\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with \\u003ccwd\\u003e\\u003c/cwd\\u003e tags\\n\\u003c/execution_steps\\u003e\\n\\n\\u003cusage_notes\\u003e\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '\\u0026\\u0026', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\u003c/usage_notes\\u003e\\n\\n\\u003cgit_commits\\u003e\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in \\u003ccommit_analysis\\u003e tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\u003ccrush@charm.land\\u003e\\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\u003c/git_commits\\u003e\\n\\n\\u003cpull_requests\\u003e\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in \\u003cpr_analysis\\u003e tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n\\n ## Summary\\n\\n \\u0026lt;1-3 bullet points\\u003e\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\u003c/pull_requests\\u003e\\n\\n\\u003cexamples\\u003e\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar \\u0026\\u0026 pytest tests\\n\\u003c/examples\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"},\"name\":\"download\",\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\u003cusage\\u003e\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"},\"name\":\"edit\",\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\u003c/parameters\\u003e\\n\\n\\u003cspecial_cases\\u003e\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\u003c/special_cases\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\u003c/best_practices\\u003e\\n\\n\\u003cwindows_notes\\u003e\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\u003c/windows_notes\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"},\"name\":\"multiedit\",\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\u003c/parameters\\u003e\\n\\n\\u003coperation\\u003e\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\u003c/operation\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\u003c/best_practices\\u003e\\n\\n\\u003cnew_file_creation\\u003e\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\u003c/new_file_creation\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"},\"name\":\"fetch\",\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\u003cusage\\u003e\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"glob\",\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cpattern_syntax\\u003e\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\u003c/pattern_syntax\\u003e\\n\\n\\u003cexamples\\u003e\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\u003c/examples\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"grep\",\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cregex_syntax\\u003e\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\u003c/regex_syntax\\u003e\\n\\n\\u003cinclude_patterns\\u003e\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\u003c/include_patterns\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003cignore_support\\u003e\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\u003c/ignore_support\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"name\":\"ls\",\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\u003cusage\\u003e\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"},\"name\":\"sourcegraph\",\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\u003cusage\\u003e\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cbasic_syntax\\u003e\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\u003c/basic_syntax\\u003e\\n\\n\\u003ckey_filters\\u003e\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\u003c/key_filters\\u003e\\n\\n\\u003cexamples\\u003e\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\u003c/examples\\u003e\\n\\n\\u003cboolean_operators\\u003e\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\u003c/boolean_operators\\u003e\\n\\n\\u003climitations\\u003e\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"},\"name\":\"view\",\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\u003cusage\\u003e\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines \\u003e2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"},\"name\":\"write\",\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\u003cusage\\u003e\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\u003c/tips\\u003e\\n\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"stream\":true}" headers: Accept: - application/json @@ -84,46 +84,43 @@ interactions: content_length: -1 body: |+ event: message_start - data: {"type":"message_start","message":{"id":"msg_017tQdpUetyXDpmQuyGBtooX","type":"message","role":"assistant","model":"claude-sonnet-4-5-20250929","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":3,"cache_creation_input_tokens":1770,"cache_read_input_tokens":6884,"cache_creation":{"ephemeral_5m_input_tokens":1770,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard"}} } + data: {"type":"message_start","message":{"id":"msg_01HzJjq7EnSDDqGfZffn91hF","type":"message","role":"assistant","model":"claude-sonnet-4-5-20250929","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":3,"cache_creation_input_tokens":1770,"cache_read_input_tokens":6904,"cache_creation":{"ephemeral_5m_input_tokens":1770,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard"}} } event: content_block_start - data: {"type":"content_block_start","index":0,"content_block":{"type":"tool_use","id":"toolu_015mV7Nqs7nmcQ9ejXVKTae6","name":"ls","input":{}} } + data: {"type":"content_block_start","index":0,"content_block":{"type":"tool_use","id":"toolu_01RWgq9XfPoSvnsCwYBsgXA2","name":"ls","input":{}} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":""} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":""} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"{\"pa"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"{\"path\": \"."} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"th\":"} } - - event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":" \".\"}"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"\"}"} } event: content_block_stop - data: {"type":"content_block_stop","index":0 } + data: {"type":"content_block_stop","index":0 } event: message_delta - data: {"type":"message_delta","delta":{"stop_reason":"tool_use","stop_sequence":null},"usage":{"input_tokens":3,"cache_creation_input_tokens":1770,"cache_read_input_tokens":6884,"output_tokens":50} } + data: {"type":"message_delta","delta":{"stop_reason":"tool_use","stop_sequence":null},"usage":{"input_tokens":3,"cache_creation_input_tokens":1770,"cache_read_input_tokens":6904,"output_tokens":50}} event: message_stop - data: {"type":"message_stop" } + data: {"type":"message_stop" } headers: Content-Type: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 2.739610833s + duration: 2.572502458s - id: 2 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 32324 + content_length: 32399 host: "" - body: "{\"max_tokens\":10000,\"messages\":[{\"content\":[{\"text\":\"use ls to list the files in the current directory\",\"type\":\"text\"}],\"role\":\"user\"},{\"content\":[{\"id\":\"toolu_015mV7Nqs7nmcQ9ejXVKTae6\",\"input\":{\"path\":\".\"},\"name\":\"ls\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"tool_use\"}],\"role\":\"assistant\"},{\"content\":[{\"tool_use_id\":\"toolu_015mV7Nqs7nmcQ9ejXVKTae6\",\"cache_control\":{\"type\":\"ephemeral\"},\"content\":[{\"text\":\"- /tmp/crush-test/TestCoderAgent/anthropic-sonnet/ls_tool/\\n - go.mod\\n - main.go\\n\",\"type\":\"text\"}],\"type\":\"tool_result\"}],\"role\":\"user\"}],\"model\":\"claude-sonnet-4-5-20250929\",\"system\":[{\"text\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\u003cmemory_instructions\\u003e\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\u003c/memory_instructions\\u003e\\n\\u003ccommunication_style\\u003e\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\u003cexample\\u003e\\nuser: 2 + 2\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what is 2+2?\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: is 11 a prime number?\\nassistant: true\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\u003c/example\\u003e\\n\\u003c/communication_style\\u003e\\n\\n\\u003cproactiveness\\u003e\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\u003c/proactiveness\\u003e\\n\\n\\u003cfollowing_conversations\\u003e\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\u003c/following_conversations\\u003e\\n\\n\\u003ccode_style\\u003e\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\u003c/code_style\\u003e\\n\\n\\u003cdoing_tasks\\u003e\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\u003c/doing_tasks\\u003e\\n\\n\\u003ctool_use\\u003e\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\u003c/tool_use\\u003e\\n\\n\\u003cenv\\u003e\\nWorking directory: /tmp/crush-test/TestCoderAgent/anthropic-sonnet/ls_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\u003c/env\\u003e\\n\\u003cmemory\\u003e\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\u003c/memory\\u003e\\n\\n\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"tool_choice\":{\"disable_parallel_tool_use\":false,\"type\":\"auto\"},\"tools\":[{\"input_schema\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"},\"name\":\"bash\",\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\u003ccross_platform\\u003e\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\u003c/cross_platform\\u003e\\n\\n\\u003cexecution_steps\\u003e\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with \\u003ccwd\\u003e\\u003c/cwd\\u003e tags\\n\\u003c/execution_steps\\u003e\\n\\n\\u003cusage_notes\\u003e\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '\\u0026\\u0026', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\u003c/usage_notes\\u003e\\n\\n\\u003cgit_commits\\u003e\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in \\u003ccommit_analysis\\u003e tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\u003ccrush@charm.land\\u003e\\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\u003c/git_commits\\u003e\\n\\n\\u003cpull_requests\\u003e\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in \\u003cpr_analysis\\u003e tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n\\n ## Summary\\n\\n \\u0026lt;1-3 bullet points\\u003e\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\u003c/pull_requests\\u003e\\n\\n\\u003cexamples\\u003e\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar \\u0026\\u0026 pytest tests\\n\\u003c/examples\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"},\"name\":\"download\",\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\u003cusage\\u003e\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"},\"name\":\"edit\",\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\u003c/parameters\\u003e\\n\\n\\u003cspecial_cases\\u003e\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\u003c/special_cases\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\u003c/best_practices\\u003e\\n\\n\\u003cwindows_notes\\u003e\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\u003c/windows_notes\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"},\"name\":\"multiedit\",\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\u003c/parameters\\u003e\\n\\n\\u003coperation\\u003e\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\u003c/operation\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\u003c/best_practices\\u003e\\n\\n\\u003cnew_file_creation\\u003e\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\u003c/new_file_creation\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"},\"name\":\"fetch\",\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\u003cusage\\u003e\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"glob\",\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cpattern_syntax\\u003e\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\u003c/pattern_syntax\\u003e\\n\\n\\u003cexamples\\u003e\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\u003c/examples\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"grep\",\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cregex_syntax\\u003e\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\u003c/regex_syntax\\u003e\\n\\n\\u003cinclude_patterns\\u003e\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\u003c/include_patterns\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003cignore_support\\u003e\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\u003c/ignore_support\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"name\":\"ls\",\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\u003cusage\\u003e\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"},\"name\":\"sourcegraph\",\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\u003cusage\\u003e\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cbasic_syntax\\u003e\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\u003c/basic_syntax\\u003e\\n\\n\\u003ckey_filters\\u003e\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\u003c/key_filters\\u003e\\n\\n\\u003cexamples\\u003e\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\u003c/examples\\u003e\\n\\n\\u003cboolean_operators\\u003e\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\u003c/boolean_operators\\u003e\\n\\n\\u003climitations\\u003e\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"},\"name\":\"view\",\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\u003cusage\\u003e\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines \\u003e2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"},\"name\":\"write\",\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\u003cusage\\u003e\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\u003c/tips\\u003e\\n\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"stream\":true}" + body: "{\"max_tokens\":10000,\"messages\":[{\"content\":[{\"text\":\"use ls to list the files in the current directory\",\"type\":\"text\"}],\"role\":\"user\"},{\"content\":[{\"id\":\"toolu_01RWgq9XfPoSvnsCwYBsgXA2\",\"input\":{\"path\":\".\"},\"name\":\"ls\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"tool_use\"}],\"role\":\"assistant\"},{\"content\":[{\"tool_use_id\":\"toolu_01RWgq9XfPoSvnsCwYBsgXA2\",\"cache_control\":{\"type\":\"ephemeral\"},\"content\":[{\"text\":\"\\n- /tmp/crush-test/TestCoderAgent/anthropic-sonnet/ls_tool/\\n - go.mod\\n - main.go\\n\",\"type\":\"text\"}],\"type\":\"tool_result\"}],\"role\":\"user\"}],\"model\":\"claude-sonnet-4-5-20250929\",\"system\":[{\"text\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\u003cmemory_instructions\\u003e\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\u003c/memory_instructions\\u003e\\n\\u003ccommunication_style\\u003e\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\u003cexample\\u003e\\nuser: 2 + 2\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what is 2+2?\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: is 11 a prime number?\\nassistant: true\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\u003c/example\\u003e\\n\\u003c/communication_style\\u003e\\n\\n\\u003cproactiveness\\u003e\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\u003c/proactiveness\\u003e\\n\\n\\u003cfollowing_conversations\\u003e\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\u003c/following_conversations\\u003e\\n\\n\\u003ccode_style\\u003e\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\u003c/code_style\\u003e\\n\\n\\u003cdoing_tasks\\u003e\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\u003c/doing_tasks\\u003e\\n\\n\\u003ctool_use\\u003e\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\u003c/tool_use\\u003e\\n\\n\\u003cenv\\u003e\\nWorking directory: /tmp/crush-test/TestCoderAgent/anthropic-sonnet/ls_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\u003c/env\\u003e\\n\\u003cmemory\\u003e\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\u003c/memory\\u003e\\n\\n\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"tool_choice\":{\"disable_parallel_tool_use\":false,\"type\":\"auto\"},\"tools\":[{\"input_schema\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"},\"name\":\"bash\",\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\u003ccross_platform\\u003e\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\u003c/cross_platform\\u003e\\n\\n\\u003cexecution_steps\\u003e\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with \\u003ccwd\\u003e\\u003c/cwd\\u003e tags\\n\\u003c/execution_steps\\u003e\\n\\n\\u003cusage_notes\\u003e\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '\\u0026\\u0026', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\u003c/usage_notes\\u003e\\n\\n\\u003cgit_commits\\u003e\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in \\u003ccommit_analysis\\u003e tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\u003ccrush@charm.land\\u003e\\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\u003c/git_commits\\u003e\\n\\n\\u003cpull_requests\\u003e\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in \\u003cpr_analysis\\u003e tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n\\n ## Summary\\n\\n \\u0026lt;1-3 bullet points\\u003e\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\u003c/pull_requests\\u003e\\n\\n\\u003cexamples\\u003e\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar \\u0026\\u0026 pytest tests\\n\\u003c/examples\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"},\"name\":\"download\",\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\u003cusage\\u003e\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"},\"name\":\"edit\",\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\u003c/parameters\\u003e\\n\\n\\u003cspecial_cases\\u003e\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\u003c/special_cases\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\u003c/best_practices\\u003e\\n\\n\\u003cwindows_notes\\u003e\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\u003c/windows_notes\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"},\"name\":\"multiedit\",\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\u003c/parameters\\u003e\\n\\n\\u003coperation\\u003e\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\u003c/operation\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\u003c/best_practices\\u003e\\n\\n\\u003cnew_file_creation\\u003e\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\u003c/new_file_creation\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"},\"name\":\"fetch\",\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\u003cusage\\u003e\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"glob\",\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cpattern_syntax\\u003e\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\u003c/pattern_syntax\\u003e\\n\\n\\u003cexamples\\u003e\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\u003c/examples\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"grep\",\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cregex_syntax\\u003e\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\u003c/regex_syntax\\u003e\\n\\n\\u003cinclude_patterns\\u003e\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\u003c/include_patterns\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003cignore_support\\u003e\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\u003c/ignore_support\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"name\":\"ls\",\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\u003cusage\\u003e\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"},\"name\":\"sourcegraph\",\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\u003cusage\\u003e\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cbasic_syntax\\u003e\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\u003c/basic_syntax\\u003e\\n\\n\\u003ckey_filters\\u003e\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\u003c/key_filters\\u003e\\n\\n\\u003cexamples\\u003e\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\u003c/examples\\u003e\\n\\n\\u003cboolean_operators\\u003e\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\u003c/boolean_operators\\u003e\\n\\n\\u003climitations\\u003e\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"},\"name\":\"view\",\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\u003cusage\\u003e\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines \\u003e2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"},\"name\":\"write\",\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\u003cusage\\u003e\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\u003c/tips\\u003e\\n\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"stream\":true}" headers: Accept: - application/json @@ -140,28 +137,28 @@ interactions: content_length: -1 body: |+ event: message_start - data: {"type":"message_start","message":{"id":"msg_01Ey9enFZDKC1RXVSZ1YHSUQ","type":"message","role":"assistant","model":"claude-sonnet-4-5-20250929","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":4,"cache_creation_input_tokens":96,"cache_read_input_tokens":8654,"cache_creation":{"ephemeral_5m_input_tokens":96,"ephemeral_1h_input_tokens":0},"output_tokens":3,"service_tier":"standard"}} } + data: {"type":"message_start","message":{"id":"msg_01UejrrwQMdGDjeRazh98LvE","type":"message","role":"assistant","model":"claude-sonnet-4-5-20250929","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":4,"cache_creation_input_tokens":97,"cache_read_input_tokens":8674,"cache_creation":{"ephemeral_5m_input_tokens":97,"ephemeral_1h_input_tokens":0},"output_tokens":2,"service_tier":"standard"}} } event: content_block_start - data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } + data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"\n\nThe current"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"\n\n```"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" directory contains:\n- `go.mod`"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"\ngo.mod"} } event: ping data: {"type": "ping"} event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"\n- `main.go`"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"\nmain.go\n```"} } event: content_block_stop - data: {"type":"content_block_stop","index":0} + data: {"type":"content_block_stop","index":0 } event: message_delta - data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":4,"cache_creation_input_tokens":96,"cache_read_input_tokens":8654,"output_tokens":23} } + data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":4,"cache_creation_input_tokens":97,"cache_read_input_tokens":8674,"output_tokens":15}} event: message_stop data: {"type":"message_stop" } @@ -171,4 +168,4 @@ interactions: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 2.19102425s + duration: 2.129947917s diff --git a/internal/agent/testdata/TestCoderAgent/anthropic-sonnet/multiedit_tool.yaml b/internal/agent/testdata/TestCoderAgent/anthropic-sonnet/multiedit_tool.yaml index 3a908db62a9c161e7301e44aff9866ff532a6405..af9551764b5d748d1088dd2366456fe47b716a12 100644 --- a/internal/agent/testdata/TestCoderAgent/anthropic-sonnet/multiedit_tool.yaml +++ b/internal/agent/testdata/TestCoderAgent/anthropic-sonnet/multiedit_tool.yaml @@ -25,34 +25,31 @@ interactions: content_length: -1 body: |+ event: message_start - data: {"type":"message_start","message":{"id":"msg_01P3otTW8FXT9iiJLzhrDeAS","type":"message","role":"assistant","model":"claude-3-5-haiku-20241022","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":147,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":2,"service_tier":"standard"}} } + data: {"type":"message_start","message":{"id":"msg_01CGqRQiPFCQQTcuhN8FBz5T","type":"message","role":"assistant","model":"claude-3-5-haiku-20241022","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":147,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard"}} } event: content_block_start - data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } + data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Modify"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Edit"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Greeting in"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Greeting in"} } event: ping data: {"type": "ping"} event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" main.go with"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Go"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Mult"} } - - event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"iedit"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Program"} } event: content_block_stop - data: {"type":"content_block_stop","index":0 } + data: {"type":"content_block_stop","index":0 } event: message_delta - data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":147,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":16} } + data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":147,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":9} } event: message_stop data: {"type":"message_stop" } @@ -62,15 +59,15 @@ interactions: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 594.465333ms + duration: 586.474166ms - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 32028 + content_length: 32101 host: "" - body: "{\"max_tokens\":10000,\"messages\":[{\"content\":[{\"text\":\"use multiedit to change 'Hello, World!' to 'Hello, Crush!' and add a comment '// Greeting' above the fmt.Println line in main.go\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"role\":\"user\"}],\"model\":\"claude-sonnet-4-5-20250929\",\"system\":[{\"text\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\u003cmemory_instructions\\u003e\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\u003c/memory_instructions\\u003e\\n\\u003ccommunication_style\\u003e\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\u003cexample\\u003e\\nuser: 2 + 2\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what is 2+2?\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: is 11 a prime number?\\nassistant: true\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\u003c/example\\u003e\\n\\u003c/communication_style\\u003e\\n\\n\\u003cproactiveness\\u003e\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\u003c/proactiveness\\u003e\\n\\n\\u003cfollowing_conversations\\u003e\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\u003c/following_conversations\\u003e\\n\\n\\u003ccode_style\\u003e\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\u003c/code_style\\u003e\\n\\n\\u003cdoing_tasks\\u003e\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\u003c/doing_tasks\\u003e\\n\\n\\u003ctool_use\\u003e\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\u003c/tool_use\\u003e\\n\\n\\u003cenv\\u003e\\nWorking directory: /tmp/crush-test/TestCoderAgent/anthropic-sonnet/multiedit_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\u003c/env\\u003e\\n\\u003cmemory\\u003e\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\u003c/memory\\u003e\\n\\n\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"tool_choice\":{\"disable_parallel_tool_use\":false,\"type\":\"auto\"},\"tools\":[{\"input_schema\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"},\"name\":\"bash\",\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\u003ccross_platform\\u003e\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\u003c/cross_platform\\u003e\\n\\n\\u003cexecution_steps\\u003e\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with \\u003ccwd\\u003e\\u003c/cwd\\u003e tags\\n\\u003c/execution_steps\\u003e\\n\\n\\u003cusage_notes\\u003e\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '\\u0026\\u0026', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\u003c/usage_notes\\u003e\\n\\n\\u003cgit_commits\\u003e\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in \\u003ccommit_analysis\\u003e tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\u003ccrush@charm.land\\u003e\\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\u003c/git_commits\\u003e\\n\\n\\u003cpull_requests\\u003e\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in \\u003cpr_analysis\\u003e tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n\\n ## Summary\\n\\n \\u0026lt;1-3 bullet points\\u003e\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\u003c/pull_requests\\u003e\\n\\n\\u003cexamples\\u003e\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar \\u0026\\u0026 pytest tests\\n\\u003c/examples\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"},\"name\":\"download\",\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\u003cusage\\u003e\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"},\"name\":\"edit\",\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\u003c/parameters\\u003e\\n\\n\\u003cspecial_cases\\u003e\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\u003c/special_cases\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\u003c/best_practices\\u003e\\n\\n\\u003cwindows_notes\\u003e\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\u003c/windows_notes\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"},\"name\":\"multiedit\",\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\u003c/parameters\\u003e\\n\\n\\u003coperation\\u003e\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\u003c/operation\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\u003c/best_practices\\u003e\\n\\n\\u003cnew_file_creation\\u003e\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\u003c/new_file_creation\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"},\"name\":\"fetch\",\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\u003cusage\\u003e\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"glob\",\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cpattern_syntax\\u003e\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\u003c/pattern_syntax\\u003e\\n\\n\\u003cexamples\\u003e\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\u003c/examples\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"grep\",\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cregex_syntax\\u003e\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\u003c/regex_syntax\\u003e\\n\\n\\u003cinclude_patterns\\u003e\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\u003c/include_patterns\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003cignore_support\\u003e\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\u003c/ignore_support\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"name\":\"ls\",\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\u003cusage\\u003e\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"},\"name\":\"sourcegraph\",\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\u003cusage\\u003e\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cbasic_syntax\\u003e\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\u003c/basic_syntax\\u003e\\n\\n\\u003ckey_filters\\u003e\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\u003c/key_filters\\u003e\\n\\n\\u003cexamples\\u003e\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\u003c/examples\\u003e\\n\\n\\u003cboolean_operators\\u003e\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\u003c/boolean_operators\\u003e\\n\\n\\u003climitations\\u003e\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"},\"name\":\"view\",\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\u003cusage\\u003e\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines \\u003e2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"},\"name\":\"write\",\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\u003cusage\\u003e\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\u003c/tips\\u003e\\n\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"stream\":true}" + body: "{\"max_tokens\":10000,\"messages\":[{\"content\":[{\"text\":\"use multiedit to change 'Hello, World!' to 'Hello, Crush!' and add a comment '// Greeting' above the fmt.Println line in main.go\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"role\":\"user\"}],\"model\":\"claude-sonnet-4-5-20250929\",\"system\":[{\"text\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\u003cmemory_instructions\\u003e\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\u003c/memory_instructions\\u003e\\n\\u003ccommunication_style\\u003e\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\u003cexample\\u003e\\nuser: 2 + 2\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what is 2+2?\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: is 11 a prime number?\\nassistant: true\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\u003c/example\\u003e\\n\\u003c/communication_style\\u003e\\n\\n\\u003cproactiveness\\u003e\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\u003c/proactiveness\\u003e\\n\\n\\u003cfollowing_conversations\\u003e\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\u003c/following_conversations\\u003e\\n\\n\\u003ccode_style\\u003e\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\u003c/code_style\\u003e\\n\\n\\u003cdoing_tasks\\u003e\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\u003c/doing_tasks\\u003e\\n\\n\\u003ctool_use\\u003e\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\u003c/tool_use\\u003e\\n\\n\\u003cenv\\u003e\\nWorking directory: /tmp/crush-test/TestCoderAgent/anthropic-sonnet/multiedit_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\u003c/env\\u003e\\n\\u003cmemory\\u003e\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\u003c/memory\\u003e\\n\\n\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"tool_choice\":{\"disable_parallel_tool_use\":false,\"type\":\"auto\"},\"tools\":[{\"input_schema\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"},\"name\":\"bash\",\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\u003ccross_platform\\u003e\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\u003c/cross_platform\\u003e\\n\\n\\u003cexecution_steps\\u003e\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with \\u003ccwd\\u003e\\u003c/cwd\\u003e tags\\n\\u003c/execution_steps\\u003e\\n\\n\\u003cusage_notes\\u003e\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '\\u0026\\u0026', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\u003c/usage_notes\\u003e\\n\\n\\u003cgit_commits\\u003e\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in \\u003ccommit_analysis\\u003e tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\u003ccrush@charm.land\\u003e\\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\u003c/git_commits\\u003e\\n\\n\\u003cpull_requests\\u003e\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in \\u003cpr_analysis\\u003e tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n\\n ## Summary\\n\\n \\u0026lt;1-3 bullet points\\u003e\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\u003c/pull_requests\\u003e\\n\\n\\u003cexamples\\u003e\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar \\u0026\\u0026 pytest tests\\n\\u003c/examples\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"},\"name\":\"download\",\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\u003cusage\\u003e\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"},\"name\":\"edit\",\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\u003c/parameters\\u003e\\n\\n\\u003cspecial_cases\\u003e\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\u003c/special_cases\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\u003c/best_practices\\u003e\\n\\n\\u003cwindows_notes\\u003e\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\u003c/windows_notes\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"},\"name\":\"multiedit\",\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\u003c/parameters\\u003e\\n\\n\\u003coperation\\u003e\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\u003c/operation\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\u003c/best_practices\\u003e\\n\\n\\u003cnew_file_creation\\u003e\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\u003c/new_file_creation\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"},\"name\":\"fetch\",\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\u003cusage\\u003e\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"glob\",\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cpattern_syntax\\u003e\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\u003c/pattern_syntax\\u003e\\n\\n\\u003cexamples\\u003e\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\u003c/examples\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"grep\",\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cregex_syntax\\u003e\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\u003c/regex_syntax\\u003e\\n\\n\\u003cinclude_patterns\\u003e\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\u003c/include_patterns\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003cignore_support\\u003e\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\u003c/ignore_support\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"name\":\"ls\",\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\u003cusage\\u003e\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"},\"name\":\"sourcegraph\",\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\u003cusage\\u003e\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cbasic_syntax\\u003e\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\u003c/basic_syntax\\u003e\\n\\n\\u003ckey_filters\\u003e\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\u003c/key_filters\\u003e\\n\\n\\u003cexamples\\u003e\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\u003c/examples\\u003e\\n\\n\\u003cboolean_operators\\u003e\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\u003c/boolean_operators\\u003e\\n\\n\\u003climitations\\u003e\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"},\"name\":\"view\",\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\u003cusage\\u003e\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines \\u003e2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"},\"name\":\"write\",\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\u003cusage\\u003e\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\u003c/tips\\u003e\\n\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"stream\":true}" headers: Accept: - application/json @@ -87,91 +84,97 @@ interactions: content_length: -1 body: |+ event: message_start - data: {"type":"message_start","message":{"id":"msg_01PLxMVZRpu5VCJKxdCMcoB8","type":"message","role":"assistant","model":"claude-sonnet-4-5-20250929","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":3,"cache_creation_input_tokens":1802,"cache_read_input_tokens":6884,"cache_creation":{"ephemeral_5m_input_tokens":1802,"ephemeral_1h_input_tokens":0},"output_tokens":3,"service_tier":"standard"}} } + data: {"type":"message_start","message":{"id":"msg_016R9zSPigx8GQ8AtnirYtd5","type":"message","role":"assistant","model":"claude-sonnet-4-5-20250929","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":3,"cache_creation_input_tokens":1802,"cache_read_input_tokens":6904,"cache_creation":{"ephemeral_5m_input_tokens":1802,"ephemeral_1h_input_tokens":0},"output_tokens":3,"service_tier":"standard"}} } event: content_block_start - data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } + data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"I'll first"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"I'll first"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" check the contents of main"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" check the current contents of main"} } event: ping data: {"type": "ping"} event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":".go, then use multiedit to make"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":".go, then use"} } + + event: content_block_delta + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" multiedit to make both"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" both changes."}} + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" changes."}} event: content_block_stop - data: {"type":"content_block_stop","index":0 } + data: {"type":"content_block_stop","index":0 } event: content_block_start - data: {"type":"content_block_start","index":1,"content_block":{"type":"tool_use","id":"toolu_01PTLgGTUeB7mJEwF1uK1tPt","name":"view","input":{}}} + data: {"type":"content_block_start","index":1,"content_block":{"type":"tool_use","id":"toolu_01KJenZ5txgGzY2PZdmbjVCY","name":"view","input":{}} } event: content_block_delta - data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":""} } + data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":""} } event: content_block_delta - data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"{\"file_pat"} } + data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"{\"file_"} } event: content_block_delta - data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"h\": \"/tmp/"} } + data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"pat"} } event: content_block_delta - data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"crush-test/"} } + data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"h\": \"/tmp/"} } event: content_block_delta - data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"TestCode"} } + data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"crush-test/T"} } event: content_block_delta - data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"rAgent/"} } + data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"estCoderAg"} } event: content_block_delta - data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"anthropic-"} } + data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"ent/ant"} } event: content_block_delta - data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"sonnet/m"} } + data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"hropic"} } event: content_block_delta - data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"ultiedit_too"} } + data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"-s"} } event: content_block_delta - data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"l/mai"} } + data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"onnet/mul"}} event: content_block_delta - data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"n.go"} } + data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"tiedit"} } event: content_block_delta - data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"\"}"} } + data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"_tool/mai"} } + + event: content_block_delta + data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"n.go\"}"} } event: content_block_stop - data: {"type":"content_block_stop","index":1 } + data: {"type":"content_block_stop","index":1 } event: message_delta - data: {"type":"message_delta","delta":{"stop_reason":"tool_use","stop_sequence":null},"usage":{"input_tokens":3,"cache_creation_input_tokens":1802,"cache_read_input_tokens":6884,"output_tokens":101} } + data: {"type":"message_delta","delta":{"stop_reason":"tool_use","stop_sequence":null},"usage":{"input_tokens":3,"cache_creation_input_tokens":1802,"cache_read_input_tokens":6904,"output_tokens":102} } event: message_stop - data: {"type":"message_stop" } + data: {"type":"message_stop" } headers: Content-Type: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 2.126792333s + duration: 2.144267875s - id: 2 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 32681 + content_length: 32762 host: "" - body: "{\"max_tokens\":10000,\"messages\":[{\"content\":[{\"text\":\"use multiedit to change 'Hello, World!' to 'Hello, Crush!' and add a comment '// Greeting' above the fmt.Println line in main.go\",\"type\":\"text\"}],\"role\":\"user\"},{\"content\":[{\"text\":\"I'll first check the contents of main.go, then use multiedit to make both changes.\",\"type\":\"text\"},{\"id\":\"toolu_01PTLgGTUeB7mJEwF1uK1tPt\",\"input\":{\"file_path\":\"/tmp/crush-test/TestCoderAgent/anthropic-sonnet/multiedit_tool/main.go\"},\"name\":\"view\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"tool_use\"}],\"role\":\"assistant\"},{\"content\":[{\"tool_use_id\":\"toolu_01PTLgGTUeB7mJEwF1uK1tPt\",\"cache_control\":{\"type\":\"ephemeral\"},\"content\":[{\"text\":\"\\u003cfile\\u003e\\n 1|package main\\n 2|\\n 3|import \\\"fmt\\\"\\n 4|\\n 5|func main() {\\n 6|\\tfmt.Println(\\\"Hello, World!\\\")\\n 7|}\\n\\u003c/file\\u003e\\n\",\"type\":\"text\"}],\"type\":\"tool_result\"}],\"role\":\"user\"}],\"model\":\"claude-sonnet-4-5-20250929\",\"system\":[{\"text\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\u003cmemory_instructions\\u003e\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\u003c/memory_instructions\\u003e\\n\\u003ccommunication_style\\u003e\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\u003cexample\\u003e\\nuser: 2 + 2\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what is 2+2?\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: is 11 a prime number?\\nassistant: true\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\u003c/example\\u003e\\n\\u003c/communication_style\\u003e\\n\\n\\u003cproactiveness\\u003e\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\u003c/proactiveness\\u003e\\n\\n\\u003cfollowing_conversations\\u003e\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\u003c/following_conversations\\u003e\\n\\n\\u003ccode_style\\u003e\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\u003c/code_style\\u003e\\n\\n\\u003cdoing_tasks\\u003e\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\u003c/doing_tasks\\u003e\\n\\n\\u003ctool_use\\u003e\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\u003c/tool_use\\u003e\\n\\n\\u003cenv\\u003e\\nWorking directory: /tmp/crush-test/TestCoderAgent/anthropic-sonnet/multiedit_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\u003c/env\\u003e\\n\\u003cmemory\\u003e\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\u003c/memory\\u003e\\n\\n\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"tool_choice\":{\"disable_parallel_tool_use\":false,\"type\":\"auto\"},\"tools\":[{\"input_schema\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"},\"name\":\"bash\",\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\u003ccross_platform\\u003e\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\u003c/cross_platform\\u003e\\n\\n\\u003cexecution_steps\\u003e\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with \\u003ccwd\\u003e\\u003c/cwd\\u003e tags\\n\\u003c/execution_steps\\u003e\\n\\n\\u003cusage_notes\\u003e\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '\\u0026\\u0026', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\u003c/usage_notes\\u003e\\n\\n\\u003cgit_commits\\u003e\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in \\u003ccommit_analysis\\u003e tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\u003ccrush@charm.land\\u003e\\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\u003c/git_commits\\u003e\\n\\n\\u003cpull_requests\\u003e\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in \\u003cpr_analysis\\u003e tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n\\n ## Summary\\n\\n \\u0026lt;1-3 bullet points\\u003e\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\u003c/pull_requests\\u003e\\n\\n\\u003cexamples\\u003e\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar \\u0026\\u0026 pytest tests\\n\\u003c/examples\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"},\"name\":\"download\",\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\u003cusage\\u003e\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"},\"name\":\"edit\",\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\u003c/parameters\\u003e\\n\\n\\u003cspecial_cases\\u003e\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\u003c/special_cases\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\u003c/best_practices\\u003e\\n\\n\\u003cwindows_notes\\u003e\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\u003c/windows_notes\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"},\"name\":\"multiedit\",\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\u003c/parameters\\u003e\\n\\n\\u003coperation\\u003e\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\u003c/operation\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\u003c/best_practices\\u003e\\n\\n\\u003cnew_file_creation\\u003e\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\u003c/new_file_creation\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"},\"name\":\"fetch\",\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\u003cusage\\u003e\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"glob\",\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cpattern_syntax\\u003e\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\u003c/pattern_syntax\\u003e\\n\\n\\u003cexamples\\u003e\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\u003c/examples\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"grep\",\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cregex_syntax\\u003e\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\u003c/regex_syntax\\u003e\\n\\n\\u003cinclude_patterns\\u003e\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\u003c/include_patterns\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003cignore_support\\u003e\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\u003c/ignore_support\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"name\":\"ls\",\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\u003cusage\\u003e\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"},\"name\":\"sourcegraph\",\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\u003cusage\\u003e\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cbasic_syntax\\u003e\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\u003c/basic_syntax\\u003e\\n\\n\\u003ckey_filters\\u003e\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\u003c/key_filters\\u003e\\n\\n\\u003cexamples\\u003e\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\u003c/examples\\u003e\\n\\n\\u003cboolean_operators\\u003e\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\u003c/boolean_operators\\u003e\\n\\n\\u003climitations\\u003e\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"},\"name\":\"view\",\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\u003cusage\\u003e\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines \\u003e2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"},\"name\":\"write\",\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\u003cusage\\u003e\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\u003c/tips\\u003e\\n\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"stream\":true}" + body: "{\"max_tokens\":10000,\"messages\":[{\"content\":[{\"text\":\"use multiedit to change 'Hello, World!' to 'Hello, Crush!' and add a comment '// Greeting' above the fmt.Println line in main.go\",\"type\":\"text\"}],\"role\":\"user\"},{\"content\":[{\"text\":\"I'll first check the current contents of main.go, then use multiedit to make both changes.\",\"type\":\"text\"},{\"id\":\"toolu_01KJenZ5txgGzY2PZdmbjVCY\",\"input\":{\"file_path\":\"/tmp/crush-test/TestCoderAgent/anthropic-sonnet/multiedit_tool/main.go\"},\"name\":\"view\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"tool_use\"}],\"role\":\"assistant\"},{\"content\":[{\"tool_use_id\":\"toolu_01KJenZ5txgGzY2PZdmbjVCY\",\"cache_control\":{\"type\":\"ephemeral\"},\"content\":[{\"text\":\"\\u003cfile\\u003e\\n 1|package main\\n 2|\\n 3|import \\\"fmt\\\"\\n 4|\\n 5|func main() {\\n 6|\\tfmt.Println(\\\"Hello, World!\\\")\\n 7|}\\n\\u003c/file\\u003e\\n\",\"type\":\"text\"}],\"type\":\"tool_result\"}],\"role\":\"user\"}],\"model\":\"claude-sonnet-4-5-20250929\",\"system\":[{\"text\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\u003cmemory_instructions\\u003e\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\u003c/memory_instructions\\u003e\\n\\u003ccommunication_style\\u003e\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\u003cexample\\u003e\\nuser: 2 + 2\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what is 2+2?\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: is 11 a prime number?\\nassistant: true\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\u003c/example\\u003e\\n\\u003c/communication_style\\u003e\\n\\n\\u003cproactiveness\\u003e\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\u003c/proactiveness\\u003e\\n\\n\\u003cfollowing_conversations\\u003e\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\u003c/following_conversations\\u003e\\n\\n\\u003ccode_style\\u003e\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\u003c/code_style\\u003e\\n\\n\\u003cdoing_tasks\\u003e\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\u003c/doing_tasks\\u003e\\n\\n\\u003ctool_use\\u003e\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\u003c/tool_use\\u003e\\n\\n\\u003cenv\\u003e\\nWorking directory: /tmp/crush-test/TestCoderAgent/anthropic-sonnet/multiedit_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\u003c/env\\u003e\\n\\u003cmemory\\u003e\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\u003c/memory\\u003e\\n\\n\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"tool_choice\":{\"disable_parallel_tool_use\":false,\"type\":\"auto\"},\"tools\":[{\"input_schema\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"},\"name\":\"bash\",\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\u003ccross_platform\\u003e\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\u003c/cross_platform\\u003e\\n\\n\\u003cexecution_steps\\u003e\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with \\u003ccwd\\u003e\\u003c/cwd\\u003e tags\\n\\u003c/execution_steps\\u003e\\n\\n\\u003cusage_notes\\u003e\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '\\u0026\\u0026', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\u003c/usage_notes\\u003e\\n\\n\\u003cgit_commits\\u003e\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in \\u003ccommit_analysis\\u003e tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\u003ccrush@charm.land\\u003e\\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\u003c/git_commits\\u003e\\n\\n\\u003cpull_requests\\u003e\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in \\u003cpr_analysis\\u003e tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n\\n ## Summary\\n\\n \\u0026lt;1-3 bullet points\\u003e\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\u003c/pull_requests\\u003e\\n\\n\\u003cexamples\\u003e\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar \\u0026\\u0026 pytest tests\\n\\u003c/examples\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"},\"name\":\"download\",\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\u003cusage\\u003e\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"},\"name\":\"edit\",\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\u003c/parameters\\u003e\\n\\n\\u003cspecial_cases\\u003e\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\u003c/special_cases\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\u003c/best_practices\\u003e\\n\\n\\u003cwindows_notes\\u003e\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\u003c/windows_notes\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"},\"name\":\"multiedit\",\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\u003c/parameters\\u003e\\n\\n\\u003coperation\\u003e\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\u003c/operation\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\u003c/best_practices\\u003e\\n\\n\\u003cnew_file_creation\\u003e\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\u003c/new_file_creation\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"},\"name\":\"fetch\",\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\u003cusage\\u003e\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"glob\",\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cpattern_syntax\\u003e\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\u003c/pattern_syntax\\u003e\\n\\n\\u003cexamples\\u003e\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\u003c/examples\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"grep\",\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cregex_syntax\\u003e\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\u003c/regex_syntax\\u003e\\n\\n\\u003cinclude_patterns\\u003e\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\u003c/include_patterns\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003cignore_support\\u003e\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\u003c/ignore_support\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"name\":\"ls\",\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\u003cusage\\u003e\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"},\"name\":\"sourcegraph\",\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\u003cusage\\u003e\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cbasic_syntax\\u003e\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\u003c/basic_syntax\\u003e\\n\\n\\u003ckey_filters\\u003e\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\u003c/key_filters\\u003e\\n\\n\\u003cexamples\\u003e\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\u003c/examples\\u003e\\n\\n\\u003cboolean_operators\\u003e\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\u003c/boolean_operators\\u003e\\n\\n\\u003climitations\\u003e\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"},\"name\":\"view\",\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\u003cusage\\u003e\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines \\u003e2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"},\"name\":\"write\",\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\u003cusage\\u003e\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\u003c/tips\\u003e\\n\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"stream\":true}" headers: Accept: - application/json @@ -188,160 +191,148 @@ interactions: content_length: -1 body: |+ event: message_start - data: {"type":"message_start","message":{"id":"msg_01GCz4fCieEC76Y3z63AB7SE","type":"message","role":"assistant","model":"claude-sonnet-4-5-20250929","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":4,"cache_creation_input_tokens":165,"cache_read_input_tokens":8686,"cache_creation":{"ephemeral_5m_input_tokens":165,"ephemeral_1h_input_tokens":0},"output_tokens":26,"service_tier":"standard"}} } + data: {"type":"message_start","message":{"id":"msg_0184H4ZdZBjgXrSDrn29rmgL","type":"message","role":"assistant","model":"claude-sonnet-4-5-20250929","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":4,"cache_creation_input_tokens":166,"cache_read_input_tokens":8706,"cache_creation":{"ephemeral_5m_input_tokens":166,"ephemeral_1h_input_tokens":0},"output_tokens":26,"service_tier":"standard"}} } event: content_block_start - data: {"type":"content_block_start","index":0,"content_block":{"type":"tool_use","id":"toolu_01D3XJPP6e2DyCLxad3AX62n","name":"multiedit","input":{}} } - - event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":""} } + data: {"type":"content_block_start","index":0,"content_block":{"type":"tool_use","id":"toolu_013rpLheBbBBc7eKLU7yT2iq","name":"multiedit","input":{}} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"{\"f"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":""} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"ile_path\":"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"{\"file_"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":" \"/"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"path"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"tmp/crush"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"\": \"/tmp/cru"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"-test/TestCo"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"sh"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"derAgent"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"-t"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"/anthro"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"est/"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"pic-s"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"TestCod"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"on"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"er"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"net"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"Ag"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"/multiedit_"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"ent/a"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"tool/"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"nthropic-"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"main."} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"sonnet"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"go\""} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"/mult"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":", \"edits\":"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"iedit"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":" [{"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"_too"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"\"o"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"l/main"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"ld_str"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":".go\""} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"ing"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":", \"edit"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"\":"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"s\": ["} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"\"f"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"{\"old"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"unc"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"_string\":\"f"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":" main()"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"unc m"}} event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":" {\\n\\tfmt."} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"ain() {\\n\\t"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"Printl"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"fmt.Prin"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"n(\\"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"tln(\\\"Hell"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"\"Hello"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"o,"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":", Wor"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":" World!"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"ld!\\\")\","} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"\\\")\","} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"\"new_stri"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"\"new_"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"ng\""} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"string\":\"f"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":":\"func mai"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"unc main()"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"n()"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":" {\\n\\t// G"}} event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":" {\\n\\t// Gre"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"reeting\\n\\t"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"eting\\n\\tf"}} + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"fmt.Println("} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"mt.Print"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"\\\"Hello,"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"ln(\\\"He"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":" Crush!\\"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"llo"}} - - event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":", Crush!\\"} } - - event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"\")\"}"} } - - event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"]}"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"\")\"}]}"} } event: content_block_stop - data: {"type":"content_block_stop","index":0 } + data: {"type":"content_block_stop","index":0} event: message_delta - data: {"type":"message_delta","delta":{"stop_reason":"tool_use","stop_sequence":null},"usage":{"input_tokens":4,"cache_creation_input_tokens":165,"cache_read_input_tokens":8686,"output_tokens":172} } + data: {"type":"message_delta","delta":{"stop_reason":"tool_use","stop_sequence":null},"usage":{"input_tokens":4,"cache_creation_input_tokens":166,"cache_read_input_tokens":8706,"output_tokens":172} } event: message_stop - data: {"type":"message_stop" } + data: {"type":"message_stop" } headers: Content-Type: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 2.09983325s + duration: 2.37044675s - id: 3 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 33313 + content_length: 33394 host: "" - body: "{\"max_tokens\":10000,\"messages\":[{\"content\":[{\"text\":\"use multiedit to change 'Hello, World!' to 'Hello, Crush!' and add a comment '// Greeting' above the fmt.Println line in main.go\",\"type\":\"text\"}],\"role\":\"user\"},{\"content\":[{\"text\":\"I'll first check the contents of main.go, then use multiedit to make both changes.\",\"type\":\"text\"},{\"id\":\"toolu_01PTLgGTUeB7mJEwF1uK1tPt\",\"input\":{\"file_path\":\"/tmp/crush-test/TestCoderAgent/anthropic-sonnet/multiedit_tool/main.go\"},\"name\":\"view\",\"type\":\"tool_use\"}],\"role\":\"assistant\"},{\"content\":[{\"tool_use_id\":\"toolu_01PTLgGTUeB7mJEwF1uK1tPt\",\"content\":[{\"text\":\"\\u003cfile\\u003e\\n 1|package main\\n 2|\\n 3|import \\\"fmt\\\"\\n 4|\\n 5|func main() {\\n 6|\\tfmt.Println(\\\"Hello, World!\\\")\\n 7|}\\n\\u003c/file\\u003e\\n\",\"type\":\"text\"}],\"type\":\"tool_result\"}],\"role\":\"user\"},{\"content\":[{\"id\":\"toolu_01D3XJPP6e2DyCLxad3AX62n\",\"input\":{\"edits\":[{\"new_string\":\"func main() {\\n\\t// Greeting\\n\\tfmt.Println(\\\"Hello, Crush!\\\")\",\"old_string\":\"func main() {\\n\\tfmt.Println(\\\"Hello, World!\\\")\"}],\"file_path\":\"/tmp/crush-test/TestCoderAgent/anthropic-sonnet/multiedit_tool/main.go\"},\"name\":\"multiedit\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"tool_use\"}],\"role\":\"assistant\"},{\"content\":[{\"tool_use_id\":\"toolu_01D3XJPP6e2DyCLxad3AX62n\",\"cache_control\":{\"type\":\"ephemeral\"},\"content\":[{\"text\":\"\\u003cresult\\u003e\\nApplied 1 edits to file: /tmp/crush-test/TestCoderAgent/anthropic-sonnet/multiedit_tool/main.go\\n\\u003c/result\\u003e\\n\",\"type\":\"text\"}],\"type\":\"tool_result\"}],\"role\":\"user\"}],\"model\":\"claude-sonnet-4-5-20250929\",\"system\":[{\"text\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\u003cmemory_instructions\\u003e\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\u003c/memory_instructions\\u003e\\n\\u003ccommunication_style\\u003e\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\u003cexample\\u003e\\nuser: 2 + 2\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what is 2+2?\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: is 11 a prime number?\\nassistant: true\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\u003c/example\\u003e\\n\\u003c/communication_style\\u003e\\n\\n\\u003cproactiveness\\u003e\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\u003c/proactiveness\\u003e\\n\\n\\u003cfollowing_conversations\\u003e\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\u003c/following_conversations\\u003e\\n\\n\\u003ccode_style\\u003e\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\u003c/code_style\\u003e\\n\\n\\u003cdoing_tasks\\u003e\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\u003c/doing_tasks\\u003e\\n\\n\\u003ctool_use\\u003e\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\u003c/tool_use\\u003e\\n\\n\\u003cenv\\u003e\\nWorking directory: /tmp/crush-test/TestCoderAgent/anthropic-sonnet/multiedit_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\u003c/env\\u003e\\n\\u003cmemory\\u003e\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\u003c/memory\\u003e\\n\\n\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"tool_choice\":{\"disable_parallel_tool_use\":false,\"type\":\"auto\"},\"tools\":[{\"input_schema\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"},\"name\":\"bash\",\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\u003ccross_platform\\u003e\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\u003c/cross_platform\\u003e\\n\\n\\u003cexecution_steps\\u003e\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with \\u003ccwd\\u003e\\u003c/cwd\\u003e tags\\n\\u003c/execution_steps\\u003e\\n\\n\\u003cusage_notes\\u003e\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '\\u0026\\u0026', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\u003c/usage_notes\\u003e\\n\\n\\u003cgit_commits\\u003e\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in \\u003ccommit_analysis\\u003e tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\u003ccrush@charm.land\\u003e\\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\u003c/git_commits\\u003e\\n\\n\\u003cpull_requests\\u003e\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in \\u003cpr_analysis\\u003e tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n\\n ## Summary\\n\\n \\u0026lt;1-3 bullet points\\u003e\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\u003c/pull_requests\\u003e\\n\\n\\u003cexamples\\u003e\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar \\u0026\\u0026 pytest tests\\n\\u003c/examples\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"},\"name\":\"download\",\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\u003cusage\\u003e\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"},\"name\":\"edit\",\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\u003c/parameters\\u003e\\n\\n\\u003cspecial_cases\\u003e\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\u003c/special_cases\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\u003c/best_practices\\u003e\\n\\n\\u003cwindows_notes\\u003e\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\u003c/windows_notes\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"},\"name\":\"multiedit\",\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\u003c/parameters\\u003e\\n\\n\\u003coperation\\u003e\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\u003c/operation\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\u003c/best_practices\\u003e\\n\\n\\u003cnew_file_creation\\u003e\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\u003c/new_file_creation\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"},\"name\":\"fetch\",\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\u003cusage\\u003e\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"glob\",\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cpattern_syntax\\u003e\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\u003c/pattern_syntax\\u003e\\n\\n\\u003cexamples\\u003e\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\u003c/examples\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"grep\",\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cregex_syntax\\u003e\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\u003c/regex_syntax\\u003e\\n\\n\\u003cinclude_patterns\\u003e\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\u003c/include_patterns\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003cignore_support\\u003e\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\u003c/ignore_support\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"name\":\"ls\",\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\u003cusage\\u003e\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"},\"name\":\"sourcegraph\",\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\u003cusage\\u003e\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cbasic_syntax\\u003e\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\u003c/basic_syntax\\u003e\\n\\n\\u003ckey_filters\\u003e\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\u003c/key_filters\\u003e\\n\\n\\u003cexamples\\u003e\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\u003c/examples\\u003e\\n\\n\\u003cboolean_operators\\u003e\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\u003c/boolean_operators\\u003e\\n\\n\\u003climitations\\u003e\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"},\"name\":\"view\",\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\u003cusage\\u003e\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines \\u003e2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"},\"name\":\"write\",\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\u003cusage\\u003e\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\u003c/tips\\u003e\\n\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"stream\":true}" + body: "{\"max_tokens\":10000,\"messages\":[{\"content\":[{\"text\":\"use multiedit to change 'Hello, World!' to 'Hello, Crush!' and add a comment '// Greeting' above the fmt.Println line in main.go\",\"type\":\"text\"}],\"role\":\"user\"},{\"content\":[{\"text\":\"I'll first check the current contents of main.go, then use multiedit to make both changes.\",\"type\":\"text\"},{\"id\":\"toolu_01KJenZ5txgGzY2PZdmbjVCY\",\"input\":{\"file_path\":\"/tmp/crush-test/TestCoderAgent/anthropic-sonnet/multiedit_tool/main.go\"},\"name\":\"view\",\"type\":\"tool_use\"}],\"role\":\"assistant\"},{\"content\":[{\"tool_use_id\":\"toolu_01KJenZ5txgGzY2PZdmbjVCY\",\"content\":[{\"text\":\"\\u003cfile\\u003e\\n 1|package main\\n 2|\\n 3|import \\\"fmt\\\"\\n 4|\\n 5|func main() {\\n 6|\\tfmt.Println(\\\"Hello, World!\\\")\\n 7|}\\n\\u003c/file\\u003e\\n\",\"type\":\"text\"}],\"type\":\"tool_result\"}],\"role\":\"user\"},{\"content\":[{\"id\":\"toolu_013rpLheBbBBc7eKLU7yT2iq\",\"input\":{\"edits\":[{\"new_string\":\"func main() {\\n\\t// Greeting\\n\\tfmt.Println(\\\"Hello, Crush!\\\")\",\"old_string\":\"func main() {\\n\\tfmt.Println(\\\"Hello, World!\\\")\"}],\"file_path\":\"/tmp/crush-test/TestCoderAgent/anthropic-sonnet/multiedit_tool/main.go\"},\"name\":\"multiedit\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"tool_use\"}],\"role\":\"assistant\"},{\"content\":[{\"tool_use_id\":\"toolu_013rpLheBbBBc7eKLU7yT2iq\",\"cache_control\":{\"type\":\"ephemeral\"},\"content\":[{\"text\":\"\\u003cresult\\u003e\\nApplied 1 edits to file: /tmp/crush-test/TestCoderAgent/anthropic-sonnet/multiedit_tool/main.go\\n\\u003c/result\\u003e\\n\",\"type\":\"text\"}],\"type\":\"tool_result\"}],\"role\":\"user\"}],\"model\":\"claude-sonnet-4-5-20250929\",\"system\":[{\"text\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\u003cmemory_instructions\\u003e\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\u003c/memory_instructions\\u003e\\n\\u003ccommunication_style\\u003e\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\u003cexample\\u003e\\nuser: 2 + 2\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what is 2+2?\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: is 11 a prime number?\\nassistant: true\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\u003c/example\\u003e\\n\\u003c/communication_style\\u003e\\n\\n\\u003cproactiveness\\u003e\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\u003c/proactiveness\\u003e\\n\\n\\u003cfollowing_conversations\\u003e\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\u003c/following_conversations\\u003e\\n\\n\\u003ccode_style\\u003e\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\u003c/code_style\\u003e\\n\\n\\u003cdoing_tasks\\u003e\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\u003c/doing_tasks\\u003e\\n\\n\\u003ctool_use\\u003e\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\u003c/tool_use\\u003e\\n\\n\\u003cenv\\u003e\\nWorking directory: /tmp/crush-test/TestCoderAgent/anthropic-sonnet/multiedit_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\u003c/env\\u003e\\n\\u003cmemory\\u003e\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\u003c/memory\\u003e\\n\\n\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"tool_choice\":{\"disable_parallel_tool_use\":false,\"type\":\"auto\"},\"tools\":[{\"input_schema\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"},\"name\":\"bash\",\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\u003ccross_platform\\u003e\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\u003c/cross_platform\\u003e\\n\\n\\u003cexecution_steps\\u003e\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with \\u003ccwd\\u003e\\u003c/cwd\\u003e tags\\n\\u003c/execution_steps\\u003e\\n\\n\\u003cusage_notes\\u003e\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '\\u0026\\u0026', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\u003c/usage_notes\\u003e\\n\\n\\u003cgit_commits\\u003e\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in \\u003ccommit_analysis\\u003e tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\u003ccrush@charm.land\\u003e\\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\u003c/git_commits\\u003e\\n\\n\\u003cpull_requests\\u003e\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in \\u003cpr_analysis\\u003e tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n\\n ## Summary\\n\\n \\u0026lt;1-3 bullet points\\u003e\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\u003c/pull_requests\\u003e\\n\\n\\u003cexamples\\u003e\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar \\u0026\\u0026 pytest tests\\n\\u003c/examples\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"},\"name\":\"download\",\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\u003cusage\\u003e\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"},\"name\":\"edit\",\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\u003c/parameters\\u003e\\n\\n\\u003cspecial_cases\\u003e\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\u003c/special_cases\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\u003c/best_practices\\u003e\\n\\n\\u003cwindows_notes\\u003e\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\u003c/windows_notes\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"},\"name\":\"multiedit\",\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\u003c/parameters\\u003e\\n\\n\\u003coperation\\u003e\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\u003c/operation\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\u003c/best_practices\\u003e\\n\\n\\u003cnew_file_creation\\u003e\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\u003c/new_file_creation\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"},\"name\":\"fetch\",\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\u003cusage\\u003e\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"glob\",\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cpattern_syntax\\u003e\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\u003c/pattern_syntax\\u003e\\n\\n\\u003cexamples\\u003e\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\u003c/examples\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"grep\",\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cregex_syntax\\u003e\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\u003c/regex_syntax\\u003e\\n\\n\\u003cinclude_patterns\\u003e\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\u003c/include_patterns\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003cignore_support\\u003e\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\u003c/ignore_support\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"name\":\"ls\",\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\u003cusage\\u003e\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"},\"name\":\"sourcegraph\",\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\u003cusage\\u003e\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cbasic_syntax\\u003e\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\u003c/basic_syntax\\u003e\\n\\n\\u003ckey_filters\\u003e\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\u003c/key_filters\\u003e\\n\\n\\u003cexamples\\u003e\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\u003c/examples\\u003e\\n\\n\\u003cboolean_operators\\u003e\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\u003c/boolean_operators\\u003e\\n\\n\\u003climitations\\u003e\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"},\"name\":\"view\",\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\u003cusage\\u003e\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines \\u003e2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"},\"name\":\"write\",\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\u003cusage\\u003e\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\u003c/tips\\u003e\\n\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"stream\":true}" headers: Accept: - application/json @@ -358,38 +349,38 @@ interactions: content_length: -1 body: |+ event: message_start - data: {"type":"message_start","message":{"id":"msg_01Qs8VVkm1yeoe7Nsw8okzc7","type":"message","role":"assistant","model":"claude-sonnet-4-5-20250929","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":4,"cache_creation_input_tokens":215,"cache_read_input_tokens":8851,"cache_creation":{"ephemeral_5m_input_tokens":215,"ephemeral_1h_input_tokens":0},"output_tokens":2,"service_tier":"standard"}} } + data: {"type":"message_start","message":{"id":"msg_013E4hHbbNbXmn2FNMKxo8Us","type":"message","role":"assistant","model":"claude-sonnet-4-5-20250929","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":4,"cache_creation_input_tokens":215,"cache_read_input_tokens":8872,"cache_creation":{"ephemeral_5m_input_tokens":215,"ephemeral_1h_input_tokens":0},"output_tokens":2,"service_tier":"standard"}} } event: content_block_start - data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } + data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } event: content_block_delta data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"\n\nDone"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":". Changed \"Hello, World!\" to \"Hello"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":". Changed the greeting to \"Hello, Crush!\" and adde"}} event: ping data: {"type": "ping"} event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":", Crush!\" and added the comment"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"d the comment above the println"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"."} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" statement."} } event: content_block_stop - data: {"type":"content_block_stop","index":0 } + data: {"type":"content_block_stop","index":0 } event: message_delta - data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":4,"cache_creation_input_tokens":215,"cache_read_input_tokens":8851,"output_tokens":24} } + data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":4,"cache_creation_input_tokens":215,"cache_read_input_tokens":8872,"output_tokens":25} } event: message_stop - data: {"type":"message_stop" } + data: {"type":"message_stop" } headers: Content-Type: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 2.212339584s + duration: 1.862919458s diff --git a/internal/agent/testdata/TestCoderAgent/anthropic-sonnet/parallel_tool_calls.yaml b/internal/agent/testdata/TestCoderAgent/anthropic-sonnet/parallel_tool_calls.yaml index 8727abd8b5dd7de29b9777ee20e970933dce9c2f..7b829652b01aa6f3c9e237529b29bb18be8ac319 100644 --- a/internal/agent/testdata/TestCoderAgent/anthropic-sonnet/parallel_tool_calls.yaml +++ b/internal/agent/testdata/TestCoderAgent/anthropic-sonnet/parallel_tool_calls.yaml @@ -25,55 +25,49 @@ interactions: content_length: -1 body: |+ event: message_start - data: {"type":"message_start","message":{"id":"msg_01JnpXQC44uuNTzMPLPV1HGC","type":"message","role":"assistant","model":"claude-3-5-haiku-20241022","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":136,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":2,"service_tier":"standard"}} } + data: {"type":"message_start","message":{"id":"msg_01AH9XB691MCVFTi88d4ddjW","type":"message","role":"assistant","model":"claude-3-5-haiku-20241022","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":136,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":2,"service_tier":"standard"}} } event: content_block_start - data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}} + data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Parallel"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Parallel"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Go File"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Go File"} } event: ping data: {"type": "ping"} event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Discovery"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Discovery"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" with"} } - - event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Glob and "} } - - event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"LS"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" and Listing"}} event: content_block_stop - data: {"type":"content_block_stop","index":0 } + data: {"type":"content_block_stop","index":0 } event: message_delta - data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":136,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":14} } + data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":136,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":11} } event: message_stop - data: {"type":"message_stop" } + data: {"type":"message_stop" } headers: Content-Type: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 694.903875ms + duration: 671.9185ms - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 32039 + content_length: 32112 host: "" - body: "{\"max_tokens\":10000,\"messages\":[{\"content\":[{\"text\":\"use glob to find all .go files and use ls to list the current directory, it is very important that you run both tool calls in parallel\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"role\":\"user\"}],\"model\":\"claude-sonnet-4-5-20250929\",\"system\":[{\"text\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\u003cmemory_instructions\\u003e\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\u003c/memory_instructions\\u003e\\n\\u003ccommunication_style\\u003e\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\u003cexample\\u003e\\nuser: 2 + 2\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what is 2+2?\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: is 11 a prime number?\\nassistant: true\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\u003c/example\\u003e\\n\\u003c/communication_style\\u003e\\n\\n\\u003cproactiveness\\u003e\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\u003c/proactiveness\\u003e\\n\\n\\u003cfollowing_conversations\\u003e\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\u003c/following_conversations\\u003e\\n\\n\\u003ccode_style\\u003e\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\u003c/code_style\\u003e\\n\\n\\u003cdoing_tasks\\u003e\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\u003c/doing_tasks\\u003e\\n\\n\\u003ctool_use\\u003e\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\u003c/tool_use\\u003e\\n\\n\\u003cenv\\u003e\\nWorking directory: /tmp/crush-test/TestCoderAgent/anthropic-sonnet/parallel_tool_calls\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\u003c/env\\u003e\\n\\u003cmemory\\u003e\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\u003c/memory\\u003e\\n\\n\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"tool_choice\":{\"disable_parallel_tool_use\":false,\"type\":\"auto\"},\"tools\":[{\"input_schema\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"},\"name\":\"bash\",\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\u003ccross_platform\\u003e\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\u003c/cross_platform\\u003e\\n\\n\\u003cexecution_steps\\u003e\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with \\u003ccwd\\u003e\\u003c/cwd\\u003e tags\\n\\u003c/execution_steps\\u003e\\n\\n\\u003cusage_notes\\u003e\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '\\u0026\\u0026', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\u003c/usage_notes\\u003e\\n\\n\\u003cgit_commits\\u003e\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in \\u003ccommit_analysis\\u003e tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\u003ccrush@charm.land\\u003e\\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\u003c/git_commits\\u003e\\n\\n\\u003cpull_requests\\u003e\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in \\u003cpr_analysis\\u003e tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n\\n ## Summary\\n\\n \\u0026lt;1-3 bullet points\\u003e\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\u003c/pull_requests\\u003e\\n\\n\\u003cexamples\\u003e\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar \\u0026\\u0026 pytest tests\\n\\u003c/examples\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"},\"name\":\"download\",\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\u003cusage\\u003e\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"},\"name\":\"edit\",\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\u003c/parameters\\u003e\\n\\n\\u003cspecial_cases\\u003e\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\u003c/special_cases\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\u003c/best_practices\\u003e\\n\\n\\u003cwindows_notes\\u003e\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\u003c/windows_notes\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"},\"name\":\"multiedit\",\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\u003c/parameters\\u003e\\n\\n\\u003coperation\\u003e\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\u003c/operation\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\u003c/best_practices\\u003e\\n\\n\\u003cnew_file_creation\\u003e\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\u003c/new_file_creation\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"},\"name\":\"fetch\",\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\u003cusage\\u003e\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"glob\",\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cpattern_syntax\\u003e\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\u003c/pattern_syntax\\u003e\\n\\n\\u003cexamples\\u003e\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\u003c/examples\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"grep\",\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cregex_syntax\\u003e\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\u003c/regex_syntax\\u003e\\n\\n\\u003cinclude_patterns\\u003e\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\u003c/include_patterns\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003cignore_support\\u003e\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\u003c/ignore_support\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"name\":\"ls\",\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\u003cusage\\u003e\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"},\"name\":\"sourcegraph\",\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\u003cusage\\u003e\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cbasic_syntax\\u003e\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\u003c/basic_syntax\\u003e\\n\\n\\u003ckey_filters\\u003e\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\u003c/key_filters\\u003e\\n\\n\\u003cexamples\\u003e\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\u003c/examples\\u003e\\n\\n\\u003cboolean_operators\\u003e\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\u003c/boolean_operators\\u003e\\n\\n\\u003climitations\\u003e\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"},\"name\":\"view\",\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\u003cusage\\u003e\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines \\u003e2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"},\"name\":\"write\",\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\u003cusage\\u003e\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\u003c/tips\\u003e\\n\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"stream\":true}" + body: "{\"max_tokens\":10000,\"messages\":[{\"content\":[{\"text\":\"use glob to find all .go files and use ls to list the current directory, it is very important that you run both tool calls in parallel\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"role\":\"user\"}],\"model\":\"claude-sonnet-4-5-20250929\",\"system\":[{\"text\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\u003cmemory_instructions\\u003e\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\u003c/memory_instructions\\u003e\\n\\u003ccommunication_style\\u003e\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\u003cexample\\u003e\\nuser: 2 + 2\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what is 2+2?\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: is 11 a prime number?\\nassistant: true\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\u003c/example\\u003e\\n\\u003c/communication_style\\u003e\\n\\n\\u003cproactiveness\\u003e\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\u003c/proactiveness\\u003e\\n\\n\\u003cfollowing_conversations\\u003e\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\u003c/following_conversations\\u003e\\n\\n\\u003ccode_style\\u003e\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\u003c/code_style\\u003e\\n\\n\\u003cdoing_tasks\\u003e\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\u003c/doing_tasks\\u003e\\n\\n\\u003ctool_use\\u003e\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\u003c/tool_use\\u003e\\n\\n\\u003cenv\\u003e\\nWorking directory: /tmp/crush-test/TestCoderAgent/anthropic-sonnet/parallel_tool_calls\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\u003c/env\\u003e\\n\\u003cmemory\\u003e\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\u003c/memory\\u003e\\n\\n\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"tool_choice\":{\"disable_parallel_tool_use\":false,\"type\":\"auto\"},\"tools\":[{\"input_schema\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"},\"name\":\"bash\",\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\u003ccross_platform\\u003e\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\u003c/cross_platform\\u003e\\n\\n\\u003cexecution_steps\\u003e\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with \\u003ccwd\\u003e\\u003c/cwd\\u003e tags\\n\\u003c/execution_steps\\u003e\\n\\n\\u003cusage_notes\\u003e\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '\\u0026\\u0026', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\u003c/usage_notes\\u003e\\n\\n\\u003cgit_commits\\u003e\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in \\u003ccommit_analysis\\u003e tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\u003ccrush@charm.land\\u003e\\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\u003c/git_commits\\u003e\\n\\n\\u003cpull_requests\\u003e\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in \\u003cpr_analysis\\u003e tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n\\n ## Summary\\n\\n \\u0026lt;1-3 bullet points\\u003e\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\u003c/pull_requests\\u003e\\n\\n\\u003cexamples\\u003e\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar \\u0026\\u0026 pytest tests\\n\\u003c/examples\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"},\"name\":\"download\",\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\u003cusage\\u003e\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"},\"name\":\"edit\",\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\u003c/parameters\\u003e\\n\\n\\u003cspecial_cases\\u003e\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\u003c/special_cases\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\u003c/best_practices\\u003e\\n\\n\\u003cwindows_notes\\u003e\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\u003c/windows_notes\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"},\"name\":\"multiedit\",\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\u003c/parameters\\u003e\\n\\n\\u003coperation\\u003e\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\u003c/operation\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\u003c/best_practices\\u003e\\n\\n\\u003cnew_file_creation\\u003e\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\u003c/new_file_creation\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"},\"name\":\"fetch\",\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\u003cusage\\u003e\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"glob\",\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cpattern_syntax\\u003e\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\u003c/pattern_syntax\\u003e\\n\\n\\u003cexamples\\u003e\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\u003c/examples\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"grep\",\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cregex_syntax\\u003e\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\u003c/regex_syntax\\u003e\\n\\n\\u003cinclude_patterns\\u003e\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\u003c/include_patterns\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003cignore_support\\u003e\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\u003c/ignore_support\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"name\":\"ls\",\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\u003cusage\\u003e\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"},\"name\":\"sourcegraph\",\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\u003cusage\\u003e\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cbasic_syntax\\u003e\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\u003c/basic_syntax\\u003e\\n\\n\\u003ckey_filters\\u003e\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\u003c/key_filters\\u003e\\n\\n\\u003cexamples\\u003e\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\u003c/examples\\u003e\\n\\n\\u003cboolean_operators\\u003e\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\u003c/boolean_operators\\u003e\\n\\n\\u003climitations\\u003e\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"},\"name\":\"view\",\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\u003cusage\\u003e\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines \\u003e2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"},\"name\":\"write\",\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\u003cusage\\u003e\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\u003c/tips\\u003e\\n\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"stream\":true}" headers: Accept: - application/json @@ -90,70 +84,61 @@ interactions: content_length: -1 body: |+ event: message_start - data: {"type":"message_start","message":{"id":"msg_01WpJqhjLgLhwFzftxm1swhY","type":"message","role":"assistant","model":"claude-sonnet-4-5-20250929","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":3,"cache_creation_input_tokens":1791,"cache_read_input_tokens":6884,"cache_creation":{"ephemeral_5m_input_tokens":1791,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard"}} } + data: {"type":"message_start","message":{"id":"msg_017Jx97nWW1nfijrxqjkV4jA","type":"message","role":"assistant","model":"claude-sonnet-4-5-20250929","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":3,"cache_creation_input_tokens":1791,"cache_read_input_tokens":6904,"cache_creation":{"ephemeral_5m_input_tokens":1791,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard"}} } event: content_block_start - data: {"type":"content_block_start","index":0,"content_block":{"type":"tool_use","id":"toolu_01AD1MyxgBjxLLcGzQVtm5Bv","name":"glob","input":{}} } - - event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":""} } + data: {"type":"content_block_start","index":0,"content_block":{"type":"tool_use","id":"toolu_019MkqiP6x5YxzNEXajmzZ6x","name":"glob","input":{}} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"{\"pat"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":""} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"te"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"{\"pat"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"rn"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"tern\":"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"\": \"*"} } - - event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"*/"} } - - event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"*.go\"}"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":" \"**/*.go\"}"} } event: content_block_stop - data: {"type":"content_block_stop","index":0 } + data: {"type":"content_block_stop","index":0 } event: content_block_start - data: {"type":"content_block_start","index":1,"content_block":{"type":"tool_use","id":"toolu_012AKyav2o7Yc6Bvr2RRcpew","name":"ls","input":{}} } + data: {"type":"content_block_start","index":1,"content_block":{"type":"tool_use","id":"toolu_01EqDdCkhpwBJs4f1NKxWyXr","name":"ls","input":{}} } event: content_block_delta - data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":""} } + data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":""}} event: content_block_delta - data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"{\""} } + data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"{\"path"} } event: content_block_delta - data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"path\": \".\"}"} } + data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"\": \".\"}"} } event: content_block_stop - data: {"type":"content_block_stop","index":1 } + data: {"type":"content_block_stop","index":1 } event: message_delta - data: {"type":"message_delta","delta":{"stop_reason":"tool_use","stop_sequence":null},"usage":{"input_tokens":3,"cache_creation_input_tokens":1791,"cache_read_input_tokens":6884,"output_tokens":86} } + data: {"type":"message_delta","delta":{"stop_reason":"tool_use","stop_sequence":null},"usage":{"input_tokens":3,"cache_creation_input_tokens":1791,"cache_read_input_tokens":6904,"output_tokens":86} } event: message_stop - data: {"type":"message_stop" } + data: {"type":"message_stop" } headers: Content-Type: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 2.12718075s + duration: 2.31543875s - id: 2 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 32718 + content_length: 32793 host: "" - body: "{\"max_tokens\":10000,\"messages\":[{\"content\":[{\"text\":\"use glob to find all .go files and use ls to list the current directory, it is very important that you run both tool calls in parallel\",\"type\":\"text\"}],\"role\":\"user\"},{\"content\":[{\"id\":\"toolu_01AD1MyxgBjxLLcGzQVtm5Bv\",\"input\":{\"pattern\":\"**/*.go\"},\"name\":\"glob\",\"type\":\"tool_use\"},{\"id\":\"toolu_012AKyav2o7Yc6Bvr2RRcpew\",\"input\":{\"path\":\".\"},\"name\":\"ls\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"tool_use\"}],\"role\":\"assistant\"},{\"content\":[{\"tool_use_id\":\"toolu_01AD1MyxgBjxLLcGzQVtm5Bv\",\"content\":[{\"text\":\"/tmp/crush-test/TestCoderAgent/anthropic-sonnet/parallel_tool_calls/main.go\",\"type\":\"text\"}],\"type\":\"tool_result\"},{\"tool_use_id\":\"toolu_012AKyav2o7Yc6Bvr2RRcpew\",\"cache_control\":{\"type\":\"ephemeral\"},\"content\":[{\"text\":\"- /tmp/crush-test/TestCoderAgent/anthropic-sonnet/parallel_tool_calls/\\n - go.mod\\n - main.go\\n\",\"type\":\"text\"}],\"type\":\"tool_result\"}],\"role\":\"user\"}],\"model\":\"claude-sonnet-4-5-20250929\",\"system\":[{\"text\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\u003cmemory_instructions\\u003e\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\u003c/memory_instructions\\u003e\\n\\u003ccommunication_style\\u003e\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\u003cexample\\u003e\\nuser: 2 + 2\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what is 2+2?\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: is 11 a prime number?\\nassistant: true\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\u003c/example\\u003e\\n\\u003c/communication_style\\u003e\\n\\n\\u003cproactiveness\\u003e\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\u003c/proactiveness\\u003e\\n\\n\\u003cfollowing_conversations\\u003e\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\u003c/following_conversations\\u003e\\n\\n\\u003ccode_style\\u003e\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\u003c/code_style\\u003e\\n\\n\\u003cdoing_tasks\\u003e\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\u003c/doing_tasks\\u003e\\n\\n\\u003ctool_use\\u003e\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\u003c/tool_use\\u003e\\n\\n\\u003cenv\\u003e\\nWorking directory: /tmp/crush-test/TestCoderAgent/anthropic-sonnet/parallel_tool_calls\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\u003c/env\\u003e\\n\\u003cmemory\\u003e\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\u003c/memory\\u003e\\n\\n\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"tool_choice\":{\"disable_parallel_tool_use\":false,\"type\":\"auto\"},\"tools\":[{\"input_schema\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"},\"name\":\"bash\",\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\u003ccross_platform\\u003e\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\u003c/cross_platform\\u003e\\n\\n\\u003cexecution_steps\\u003e\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with \\u003ccwd\\u003e\\u003c/cwd\\u003e tags\\n\\u003c/execution_steps\\u003e\\n\\n\\u003cusage_notes\\u003e\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '\\u0026\\u0026', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\u003c/usage_notes\\u003e\\n\\n\\u003cgit_commits\\u003e\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in \\u003ccommit_analysis\\u003e tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\u003ccrush@charm.land\\u003e\\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\u003c/git_commits\\u003e\\n\\n\\u003cpull_requests\\u003e\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in \\u003cpr_analysis\\u003e tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n\\n ## Summary\\n\\n \\u0026lt;1-3 bullet points\\u003e\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\u003c/pull_requests\\u003e\\n\\n\\u003cexamples\\u003e\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar \\u0026\\u0026 pytest tests\\n\\u003c/examples\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"},\"name\":\"download\",\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\u003cusage\\u003e\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"},\"name\":\"edit\",\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\u003c/parameters\\u003e\\n\\n\\u003cspecial_cases\\u003e\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\u003c/special_cases\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\u003c/best_practices\\u003e\\n\\n\\u003cwindows_notes\\u003e\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\u003c/windows_notes\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"},\"name\":\"multiedit\",\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\u003c/parameters\\u003e\\n\\n\\u003coperation\\u003e\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\u003c/operation\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\u003c/best_practices\\u003e\\n\\n\\u003cnew_file_creation\\u003e\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\u003c/new_file_creation\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"},\"name\":\"fetch\",\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\u003cusage\\u003e\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"glob\",\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cpattern_syntax\\u003e\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\u003c/pattern_syntax\\u003e\\n\\n\\u003cexamples\\u003e\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\u003c/examples\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"grep\",\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cregex_syntax\\u003e\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\u003c/regex_syntax\\u003e\\n\\n\\u003cinclude_patterns\\u003e\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\u003c/include_patterns\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003cignore_support\\u003e\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\u003c/ignore_support\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"name\":\"ls\",\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\u003cusage\\u003e\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"},\"name\":\"sourcegraph\",\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\u003cusage\\u003e\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cbasic_syntax\\u003e\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\u003c/basic_syntax\\u003e\\n\\n\\u003ckey_filters\\u003e\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\u003c/key_filters\\u003e\\n\\n\\u003cexamples\\u003e\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\u003c/examples\\u003e\\n\\n\\u003cboolean_operators\\u003e\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\u003c/boolean_operators\\u003e\\n\\n\\u003climitations\\u003e\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"},\"name\":\"view\",\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\u003cusage\\u003e\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines \\u003e2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"},\"name\":\"write\",\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\u003cusage\\u003e\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\u003c/tips\\u003e\\n\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"stream\":true}" + body: "{\"max_tokens\":10000,\"messages\":[{\"content\":[{\"text\":\"use glob to find all .go files and use ls to list the current directory, it is very important that you run both tool calls in parallel\",\"type\":\"text\"}],\"role\":\"user\"},{\"content\":[{\"id\":\"toolu_019MkqiP6x5YxzNEXajmzZ6x\",\"input\":{\"pattern\":\"**/*.go\"},\"name\":\"glob\",\"type\":\"tool_use\"},{\"id\":\"toolu_01EqDdCkhpwBJs4f1NKxWyXr\",\"input\":{\"path\":\".\"},\"name\":\"ls\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"tool_use\"}],\"role\":\"assistant\"},{\"content\":[{\"tool_use_id\":\"toolu_019MkqiP6x5YxzNEXajmzZ6x\",\"content\":[{\"text\":\"/tmp/crush-test/TestCoderAgent/anthropic-sonnet/parallel_tool_calls/main.go\",\"type\":\"text\"}],\"type\":\"tool_result\"},{\"tool_use_id\":\"toolu_01EqDdCkhpwBJs4f1NKxWyXr\",\"cache_control\":{\"type\":\"ephemeral\"},\"content\":[{\"text\":\"\\n- /tmp/crush-test/TestCoderAgent/anthropic-sonnet/parallel_tool_calls/\\n - go.mod\\n - main.go\\n\",\"type\":\"text\"}],\"type\":\"tool_result\"}],\"role\":\"user\"}],\"model\":\"claude-sonnet-4-5-20250929\",\"system\":[{\"text\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\u003cmemory_instructions\\u003e\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\u003c/memory_instructions\\u003e\\n\\u003ccommunication_style\\u003e\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\u003cexample\\u003e\\nuser: 2 + 2\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what is 2+2?\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: is 11 a prime number?\\nassistant: true\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\u003c/example\\u003e\\n\\u003c/communication_style\\u003e\\n\\n\\u003cproactiveness\\u003e\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\u003c/proactiveness\\u003e\\n\\n\\u003cfollowing_conversations\\u003e\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\u003c/following_conversations\\u003e\\n\\n\\u003ccode_style\\u003e\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\u003c/code_style\\u003e\\n\\n\\u003cdoing_tasks\\u003e\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\u003c/doing_tasks\\u003e\\n\\n\\u003ctool_use\\u003e\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\u003c/tool_use\\u003e\\n\\n\\u003cenv\\u003e\\nWorking directory: /tmp/crush-test/TestCoderAgent/anthropic-sonnet/parallel_tool_calls\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\u003c/env\\u003e\\n\\u003cmemory\\u003e\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\u003c/memory\\u003e\\n\\n\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"tool_choice\":{\"disable_parallel_tool_use\":false,\"type\":\"auto\"},\"tools\":[{\"input_schema\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"},\"name\":\"bash\",\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\u003ccross_platform\\u003e\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\u003c/cross_platform\\u003e\\n\\n\\u003cexecution_steps\\u003e\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with \\u003ccwd\\u003e\\u003c/cwd\\u003e tags\\n\\u003c/execution_steps\\u003e\\n\\n\\u003cusage_notes\\u003e\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '\\u0026\\u0026', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\u003c/usage_notes\\u003e\\n\\n\\u003cgit_commits\\u003e\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in \\u003ccommit_analysis\\u003e tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\u003ccrush@charm.land\\u003e\\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\u003c/git_commits\\u003e\\n\\n\\u003cpull_requests\\u003e\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in \\u003cpr_analysis\\u003e tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n\\n ## Summary\\n\\n \\u0026lt;1-3 bullet points\\u003e\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\u003c/pull_requests\\u003e\\n\\n\\u003cexamples\\u003e\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar \\u0026\\u0026 pytest tests\\n\\u003c/examples\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"},\"name\":\"download\",\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\u003cusage\\u003e\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"},\"name\":\"edit\",\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\u003c/parameters\\u003e\\n\\n\\u003cspecial_cases\\u003e\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\u003c/special_cases\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\u003c/best_practices\\u003e\\n\\n\\u003cwindows_notes\\u003e\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\u003c/windows_notes\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"},\"name\":\"multiedit\",\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\u003c/parameters\\u003e\\n\\n\\u003coperation\\u003e\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\u003c/operation\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\u003c/best_practices\\u003e\\n\\n\\u003cnew_file_creation\\u003e\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\u003c/new_file_creation\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"},\"name\":\"fetch\",\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\u003cusage\\u003e\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"glob\",\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cpattern_syntax\\u003e\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\u003c/pattern_syntax\\u003e\\n\\n\\u003cexamples\\u003e\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\u003c/examples\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"grep\",\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cregex_syntax\\u003e\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\u003c/regex_syntax\\u003e\\n\\n\\u003cinclude_patterns\\u003e\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\u003c/include_patterns\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003cignore_support\\u003e\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\u003c/ignore_support\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"name\":\"ls\",\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\u003cusage\\u003e\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"},\"name\":\"sourcegraph\",\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\u003cusage\\u003e\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cbasic_syntax\\u003e\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\u003c/basic_syntax\\u003e\\n\\n\\u003ckey_filters\\u003e\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\u003c/key_filters\\u003e\\n\\n\\u003cexamples\\u003e\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\u003c/examples\\u003e\\n\\n\\u003cboolean_operators\\u003e\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\u003c/boolean_operators\\u003e\\n\\n\\u003climitations\\u003e\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"},\"name\":\"view\",\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\u003cusage\\u003e\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines \\u003e2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"},\"name\":\"write\",\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\u003cusage\\u003e\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\u003c/tips\\u003e\\n\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"stream\":true}" headers: Accept: - application/json @@ -170,41 +155,41 @@ interactions: content_length: -1 body: |+ event: message_start - data: {"type":"message_start","message":{"id":"msg_01T2nuXd3s54rrBc2bwVUaut","type":"message","role":"assistant","model":"claude-sonnet-4-5-20250929","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":5,"cache_creation_input_tokens":206,"cache_read_input_tokens":8675,"cache_creation":{"ephemeral_5m_input_tokens":206,"ephemeral_1h_input_tokens":0},"output_tokens":2,"service_tier":"standard"}} } + data: {"type":"message_start","message":{"id":"msg_01SBtYchTRoNcAZAHamD8gd8","type":"message","role":"assistant","model":"claude-sonnet-4-5-20250929","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":5,"cache_creation_input_tokens":207,"cache_read_input_tokens":8695,"cache_creation":{"ephemeral_5m_input_tokens":207,"ephemeral_1h_input_tokens":0},"output_tokens":2,"service_tier":"standard"}} } event: content_block_start - data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } + data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"\n\nFoun"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"\n\nFoun"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"d 1 Go file (`"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"d 1 Go file:"} } event: ping data: {"type": "ping"} event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"main.go`). Directory"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" `main.go`\n\nCurrent"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" contains `go.mod` and `main."} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" directory contains:\n- go"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"go`."} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":".mod\n- main.go"} } event: content_block_stop - data: {"type":"content_block_stop","index":0 } + data: {"type":"content_block_stop","index":0 } event: message_delta - data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":5,"cache_creation_input_tokens":206,"cache_read_input_tokens":8675,"output_tokens":29} } + data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":5,"cache_creation_input_tokens":207,"cache_read_input_tokens":8695,"output_tokens":31} } event: message_stop - data: {"type":"message_stop" } + data: {"type":"message_stop" } headers: Content-Type: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 2.218992333s + duration: 2.502283708s diff --git a/internal/agent/testdata/TestCoderAgent/anthropic-sonnet/read_a_file.yaml b/internal/agent/testdata/TestCoderAgent/anthropic-sonnet/read_a_file.yaml index 50667a3ede91489900a1d6ef64815a192bdac68a..30c6855a51be52381ca07769ead2721946a06201 100644 --- a/internal/agent/testdata/TestCoderAgent/anthropic-sonnet/read_a_file.yaml +++ b/internal/agent/testdata/TestCoderAgent/anthropic-sonnet/read_a_file.yaml @@ -25,55 +25,49 @@ interactions: content_length: -1 body: |+ event: message_start - data: {"type":"message_start","message":{"id":"msg_01DVVALVrbJTryt1J4MjyZ87","type":"message","role":"assistant","model":"claude-3-5-haiku-20241022","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":111,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":2,"service_tier":"standard"}} } + data: {"type":"message_start","message":{"id":"msg_012FWBStQwEKSVhBhq9juncH","type":"message","role":"assistant","model":"claude-3-5-haiku-20241022","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":111,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard"}} } event: content_block_start - data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } + data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Checking"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Review"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Go"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Go"} } event: ping data: {"type": "ping"} event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Module Dependencies"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Module"} } - event: ping - data: {"type": "ping"} + event: content_block_delta + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Configuration"} } event: content_block_stop - data: {"type":"content_block_stop","index":0 } - - event: ping - data: {"type": "ping"} - - event: ping - data: {"type": "ping"} + data: {"type":"content_block_stop","index":0 } event: message_delta - data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":111,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":8} } + data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":111,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":7}} event: message_stop - data: {"type":"message_stop" } + data: {"type":"message_stop" } headers: Content-Type: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 642.18625ms + duration: 1.198261875s - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 31912 + content_length: 31985 host: "" - body: "{\"max_tokens\":10000,\"messages\":[{\"content\":[{\"text\":\"Read the go mod\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"role\":\"user\"}],\"model\":\"claude-sonnet-4-5-20250929\",\"system\":[{\"text\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\u003cmemory_instructions\\u003e\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\u003c/memory_instructions\\u003e\\n\\u003ccommunication_style\\u003e\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\u003cexample\\u003e\\nuser: 2 + 2\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what is 2+2?\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: is 11 a prime number?\\nassistant: true\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\u003c/example\\u003e\\n\\u003c/communication_style\\u003e\\n\\n\\u003cproactiveness\\u003e\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\u003c/proactiveness\\u003e\\n\\n\\u003cfollowing_conversations\\u003e\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\u003c/following_conversations\\u003e\\n\\n\\u003ccode_style\\u003e\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\u003c/code_style\\u003e\\n\\n\\u003cdoing_tasks\\u003e\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\u003c/doing_tasks\\u003e\\n\\n\\u003ctool_use\\u003e\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\u003c/tool_use\\u003e\\n\\n\\u003cenv\\u003e\\nWorking directory: /tmp/crush-test/TestCoderAgent/anthropic-sonnet/read_a_file\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\u003c/env\\u003e\\n\\u003cmemory\\u003e\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\u003c/memory\\u003e\\n\\n\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"tool_choice\":{\"disable_parallel_tool_use\":false,\"type\":\"auto\"},\"tools\":[{\"input_schema\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"},\"name\":\"bash\",\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\u003ccross_platform\\u003e\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\u003c/cross_platform\\u003e\\n\\n\\u003cexecution_steps\\u003e\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with \\u003ccwd\\u003e\\u003c/cwd\\u003e tags\\n\\u003c/execution_steps\\u003e\\n\\n\\u003cusage_notes\\u003e\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '\\u0026\\u0026', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\u003c/usage_notes\\u003e\\n\\n\\u003cgit_commits\\u003e\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in \\u003ccommit_analysis\\u003e tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\u003ccrush@charm.land\\u003e\\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\u003c/git_commits\\u003e\\n\\n\\u003cpull_requests\\u003e\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in \\u003cpr_analysis\\u003e tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n\\n ## Summary\\n\\n \\u0026lt;1-3 bullet points\\u003e\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\u003c/pull_requests\\u003e\\n\\n\\u003cexamples\\u003e\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar \\u0026\\u0026 pytest tests\\n\\u003c/examples\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"},\"name\":\"download\",\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\u003cusage\\u003e\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"},\"name\":\"edit\",\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\u003c/parameters\\u003e\\n\\n\\u003cspecial_cases\\u003e\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\u003c/special_cases\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\u003c/best_practices\\u003e\\n\\n\\u003cwindows_notes\\u003e\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\u003c/windows_notes\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"},\"name\":\"multiedit\",\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\u003c/parameters\\u003e\\n\\n\\u003coperation\\u003e\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\u003c/operation\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\u003c/best_practices\\u003e\\n\\n\\u003cnew_file_creation\\u003e\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\u003c/new_file_creation\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"},\"name\":\"fetch\",\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\u003cusage\\u003e\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"glob\",\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cpattern_syntax\\u003e\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\u003c/pattern_syntax\\u003e\\n\\n\\u003cexamples\\u003e\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\u003c/examples\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"grep\",\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cregex_syntax\\u003e\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\u003c/regex_syntax\\u003e\\n\\n\\u003cinclude_patterns\\u003e\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\u003c/include_patterns\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003cignore_support\\u003e\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\u003c/ignore_support\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"name\":\"ls\",\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\u003cusage\\u003e\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"},\"name\":\"sourcegraph\",\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\u003cusage\\u003e\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cbasic_syntax\\u003e\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\u003c/basic_syntax\\u003e\\n\\n\\u003ckey_filters\\u003e\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\u003c/key_filters\\u003e\\n\\n\\u003cexamples\\u003e\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\u003c/examples\\u003e\\n\\n\\u003cboolean_operators\\u003e\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\u003c/boolean_operators\\u003e\\n\\n\\u003climitations\\u003e\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"},\"name\":\"view\",\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\u003cusage\\u003e\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines \\u003e2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"},\"name\":\"write\",\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\u003cusage\\u003e\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\u003c/tips\\u003e\\n\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"stream\":true}" + body: "{\"max_tokens\":10000,\"messages\":[{\"content\":[{\"text\":\"Read the go mod\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"role\":\"user\"}],\"model\":\"claude-sonnet-4-5-20250929\",\"system\":[{\"text\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\u003cmemory_instructions\\u003e\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\u003c/memory_instructions\\u003e\\n\\u003ccommunication_style\\u003e\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\u003cexample\\u003e\\nuser: 2 + 2\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what is 2+2?\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: is 11 a prime number?\\nassistant: true\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\u003c/example\\u003e\\n\\u003c/communication_style\\u003e\\n\\n\\u003cproactiveness\\u003e\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\u003c/proactiveness\\u003e\\n\\n\\u003cfollowing_conversations\\u003e\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\u003c/following_conversations\\u003e\\n\\n\\u003ccode_style\\u003e\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\u003c/code_style\\u003e\\n\\n\\u003cdoing_tasks\\u003e\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\u003c/doing_tasks\\u003e\\n\\n\\u003ctool_use\\u003e\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\u003c/tool_use\\u003e\\n\\n\\u003cenv\\u003e\\nWorking directory: /tmp/crush-test/TestCoderAgent/anthropic-sonnet/read_a_file\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\u003c/env\\u003e\\n\\u003cmemory\\u003e\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\u003c/memory\\u003e\\n\\n\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"tool_choice\":{\"disable_parallel_tool_use\":false,\"type\":\"auto\"},\"tools\":[{\"input_schema\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"},\"name\":\"bash\",\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\u003ccross_platform\\u003e\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\u003c/cross_platform\\u003e\\n\\n\\u003cexecution_steps\\u003e\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with \\u003ccwd\\u003e\\u003c/cwd\\u003e tags\\n\\u003c/execution_steps\\u003e\\n\\n\\u003cusage_notes\\u003e\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '\\u0026\\u0026', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\u003c/usage_notes\\u003e\\n\\n\\u003cgit_commits\\u003e\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in \\u003ccommit_analysis\\u003e tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\u003ccrush@charm.land\\u003e\\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\u003c/git_commits\\u003e\\n\\n\\u003cpull_requests\\u003e\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in \\u003cpr_analysis\\u003e tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n\\n ## Summary\\n\\n \\u0026lt;1-3 bullet points\\u003e\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\u003c/pull_requests\\u003e\\n\\n\\u003cexamples\\u003e\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar \\u0026\\u0026 pytest tests\\n\\u003c/examples\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"},\"name\":\"download\",\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\u003cusage\\u003e\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"},\"name\":\"edit\",\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\u003c/parameters\\u003e\\n\\n\\u003cspecial_cases\\u003e\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\u003c/special_cases\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\u003c/best_practices\\u003e\\n\\n\\u003cwindows_notes\\u003e\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\u003c/windows_notes\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"},\"name\":\"multiedit\",\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\u003c/parameters\\u003e\\n\\n\\u003coperation\\u003e\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\u003c/operation\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\u003c/best_practices\\u003e\\n\\n\\u003cnew_file_creation\\u003e\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\u003c/new_file_creation\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"},\"name\":\"fetch\",\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\u003cusage\\u003e\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"glob\",\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cpattern_syntax\\u003e\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\u003c/pattern_syntax\\u003e\\n\\n\\u003cexamples\\u003e\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\u003c/examples\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"grep\",\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cregex_syntax\\u003e\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\u003c/regex_syntax\\u003e\\n\\n\\u003cinclude_patterns\\u003e\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\u003c/include_patterns\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003cignore_support\\u003e\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\u003c/ignore_support\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"name\":\"ls\",\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\u003cusage\\u003e\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"},\"name\":\"sourcegraph\",\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\u003cusage\\u003e\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cbasic_syntax\\u003e\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\u003c/basic_syntax\\u003e\\n\\n\\u003ckey_filters\\u003e\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\u003c/key_filters\\u003e\\n\\n\\u003cexamples\\u003e\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\u003c/examples\\u003e\\n\\n\\u003cboolean_operators\\u003e\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\u003c/boolean_operators\\u003e\\n\\n\\u003climitations\\u003e\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"},\"name\":\"view\",\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\u003cusage\\u003e\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines \\u003e2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"},\"name\":\"write\",\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\u003cusage\\u003e\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\u003c/tips\\u003e\\n\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"stream\":true}" headers: Accept: - application/json @@ -90,46 +84,52 @@ interactions: content_length: -1 body: |+ event: message_start - data: {"type":"message_start","message":{"id":"msg_0114bVskVVsxo6FQNwHz4jSK","type":"message","role":"assistant","model":"claude-sonnet-4-5-20250929","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":3,"cache_creation_input_tokens":1766,"cache_read_input_tokens":6884,"cache_creation":{"ephemeral_5m_input_tokens":1766,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard"}} } + data: {"type":"message_start","message":{"id":"msg_016dHVhWSNQjP9Xsp23DCbxo","type":"message","role":"assistant","model":"claude-sonnet-4-5-20250929","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":3,"cache_creation_input_tokens":1766,"cache_read_input_tokens":6904,"cache_creation":{"ephemeral_5m_input_tokens":1766,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard"}} } event: content_block_start - data: {"type":"content_block_start","index":0,"content_block":{"type":"tool_use","id":"toolu_01YP1ew39pkMTrJ7EWAJHgbh","name":"view","input":{}} } + data: {"type":"content_block_start","index":0,"content_block":{"type":"tool_use","id":"toolu_01SDG7wc4J7utFNtf4qVG3Ti","name":"view","input":{}} } + + event: content_block_delta + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":""} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":""} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"{\"file_p"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"{\"file_pa"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"ath\""} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"th\": \"go"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":": \"g"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":".mod\"}"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"o."} } + + event: content_block_delta + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"mod\"}"} } event: content_block_stop - data: {"type":"content_block_stop","index":0 } + data: {"type":"content_block_stop","index":0 } event: message_delta - data: {"type":"message_delta","delta":{"stop_reason":"tool_use","stop_sequence":null},"usage":{"input_tokens":3,"cache_creation_input_tokens":1766,"cache_read_input_tokens":6884,"output_tokens":55} } + data: {"type":"message_delta","delta":{"stop_reason":"tool_use","stop_sequence":null},"usage":{"input_tokens":3,"cache_creation_input_tokens":1766,"cache_read_input_tokens":6904,"output_tokens":55} } event: message_stop - data: {"type":"message_stop"} + data: {"type":"message_stop" } headers: Content-Type: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 2.890234125s + duration: 2.239228625s - id: 2 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 32322 + content_length: 32395 host: "" - body: "{\"max_tokens\":10000,\"messages\":[{\"content\":[{\"text\":\"Read the go mod\",\"type\":\"text\"}],\"role\":\"user\"},{\"content\":[{\"id\":\"toolu_01YP1ew39pkMTrJ7EWAJHgbh\",\"input\":{\"file_path\":\"go.mod\"},\"name\":\"view\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"tool_use\"}],\"role\":\"assistant\"},{\"content\":[{\"tool_use_id\":\"toolu_01YP1ew39pkMTrJ7EWAJHgbh\",\"cache_control\":{\"type\":\"ephemeral\"},\"content\":[{\"text\":\"\\u003cfile\\u003e\\n 1|module example.com/testproject\\n 2|\\n 3|go 1.23\\n\\u003c/file\\u003e\\n\",\"type\":\"text\"}],\"type\":\"tool_result\"}],\"role\":\"user\"}],\"model\":\"claude-sonnet-4-5-20250929\",\"system\":[{\"text\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\u003cmemory_instructions\\u003e\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\u003c/memory_instructions\\u003e\\n\\u003ccommunication_style\\u003e\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\u003cexample\\u003e\\nuser: 2 + 2\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what is 2+2?\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: is 11 a prime number?\\nassistant: true\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\u003c/example\\u003e\\n\\u003c/communication_style\\u003e\\n\\n\\u003cproactiveness\\u003e\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\u003c/proactiveness\\u003e\\n\\n\\u003cfollowing_conversations\\u003e\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\u003c/following_conversations\\u003e\\n\\n\\u003ccode_style\\u003e\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\u003c/code_style\\u003e\\n\\n\\u003cdoing_tasks\\u003e\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\u003c/doing_tasks\\u003e\\n\\n\\u003ctool_use\\u003e\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\u003c/tool_use\\u003e\\n\\n\\u003cenv\\u003e\\nWorking directory: /tmp/crush-test/TestCoderAgent/anthropic-sonnet/read_a_file\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\u003c/env\\u003e\\n\\u003cmemory\\u003e\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\u003c/memory\\u003e\\n\\n\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"tool_choice\":{\"disable_parallel_tool_use\":false,\"type\":\"auto\"},\"tools\":[{\"input_schema\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"},\"name\":\"bash\",\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\u003ccross_platform\\u003e\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\u003c/cross_platform\\u003e\\n\\n\\u003cexecution_steps\\u003e\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with \\u003ccwd\\u003e\\u003c/cwd\\u003e tags\\n\\u003c/execution_steps\\u003e\\n\\n\\u003cusage_notes\\u003e\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '\\u0026\\u0026', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\u003c/usage_notes\\u003e\\n\\n\\u003cgit_commits\\u003e\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in \\u003ccommit_analysis\\u003e tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\u003ccrush@charm.land\\u003e\\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\u003c/git_commits\\u003e\\n\\n\\u003cpull_requests\\u003e\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in \\u003cpr_analysis\\u003e tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n\\n ## Summary\\n\\n \\u0026lt;1-3 bullet points\\u003e\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\u003c/pull_requests\\u003e\\n\\n\\u003cexamples\\u003e\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar \\u0026\\u0026 pytest tests\\n\\u003c/examples\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"},\"name\":\"download\",\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\u003cusage\\u003e\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"},\"name\":\"edit\",\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\u003c/parameters\\u003e\\n\\n\\u003cspecial_cases\\u003e\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\u003c/special_cases\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\u003c/best_practices\\u003e\\n\\n\\u003cwindows_notes\\u003e\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\u003c/windows_notes\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"},\"name\":\"multiedit\",\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\u003c/parameters\\u003e\\n\\n\\u003coperation\\u003e\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\u003c/operation\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\u003c/best_practices\\u003e\\n\\n\\u003cnew_file_creation\\u003e\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\u003c/new_file_creation\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"},\"name\":\"fetch\",\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\u003cusage\\u003e\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"glob\",\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cpattern_syntax\\u003e\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\u003c/pattern_syntax\\u003e\\n\\n\\u003cexamples\\u003e\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\u003c/examples\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"grep\",\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cregex_syntax\\u003e\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\u003c/regex_syntax\\u003e\\n\\n\\u003cinclude_patterns\\u003e\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\u003c/include_patterns\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003cignore_support\\u003e\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\u003c/ignore_support\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"name\":\"ls\",\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\u003cusage\\u003e\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"},\"name\":\"sourcegraph\",\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\u003cusage\\u003e\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cbasic_syntax\\u003e\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\u003c/basic_syntax\\u003e\\n\\n\\u003ckey_filters\\u003e\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\u003c/key_filters\\u003e\\n\\n\\u003cexamples\\u003e\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\u003c/examples\\u003e\\n\\n\\u003cboolean_operators\\u003e\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\u003c/boolean_operators\\u003e\\n\\n\\u003climitations\\u003e\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"},\"name\":\"view\",\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\u003cusage\\u003e\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines \\u003e2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"},\"name\":\"write\",\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\u003cusage\\u003e\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\u003c/tips\\u003e\\n\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"stream\":true}" + body: "{\"max_tokens\":10000,\"messages\":[{\"content\":[{\"text\":\"Read the go mod\",\"type\":\"text\"}],\"role\":\"user\"},{\"content\":[{\"id\":\"toolu_01SDG7wc4J7utFNtf4qVG3Ti\",\"input\":{\"file_path\":\"go.mod\"},\"name\":\"view\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"tool_use\"}],\"role\":\"assistant\"},{\"content\":[{\"tool_use_id\":\"toolu_01SDG7wc4J7utFNtf4qVG3Ti\",\"cache_control\":{\"type\":\"ephemeral\"},\"content\":[{\"text\":\"\\u003cfile\\u003e\\n 1|module example.com/testproject\\n 2|\\n 3|go 1.23\\n\\u003c/file\\u003e\\n\",\"type\":\"text\"}],\"type\":\"tool_result\"}],\"role\":\"user\"}],\"model\":\"claude-sonnet-4-5-20250929\",\"system\":[{\"text\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\u003cmemory_instructions\\u003e\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\u003c/memory_instructions\\u003e\\n\\u003ccommunication_style\\u003e\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\u003cexample\\u003e\\nuser: 2 + 2\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what is 2+2?\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: is 11 a prime number?\\nassistant: true\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\u003c/example\\u003e\\n\\u003c/communication_style\\u003e\\n\\n\\u003cproactiveness\\u003e\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\u003c/proactiveness\\u003e\\n\\n\\u003cfollowing_conversations\\u003e\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\u003c/following_conversations\\u003e\\n\\n\\u003ccode_style\\u003e\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\u003c/code_style\\u003e\\n\\n\\u003cdoing_tasks\\u003e\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\u003c/doing_tasks\\u003e\\n\\n\\u003ctool_use\\u003e\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\u003c/tool_use\\u003e\\n\\n\\u003cenv\\u003e\\nWorking directory: /tmp/crush-test/TestCoderAgent/anthropic-sonnet/read_a_file\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\u003c/env\\u003e\\n\\u003cmemory\\u003e\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\u003c/memory\\u003e\\n\\n\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"tool_choice\":{\"disable_parallel_tool_use\":false,\"type\":\"auto\"},\"tools\":[{\"input_schema\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"},\"name\":\"bash\",\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\u003ccross_platform\\u003e\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\u003c/cross_platform\\u003e\\n\\n\\u003cexecution_steps\\u003e\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with \\u003ccwd\\u003e\\u003c/cwd\\u003e tags\\n\\u003c/execution_steps\\u003e\\n\\n\\u003cusage_notes\\u003e\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '\\u0026\\u0026', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\u003c/usage_notes\\u003e\\n\\n\\u003cgit_commits\\u003e\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in \\u003ccommit_analysis\\u003e tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\u003ccrush@charm.land\\u003e\\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\u003c/git_commits\\u003e\\n\\n\\u003cpull_requests\\u003e\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in \\u003cpr_analysis\\u003e tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n\\n ## Summary\\n\\n \\u0026lt;1-3 bullet points\\u003e\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\u003c/pull_requests\\u003e\\n\\n\\u003cexamples\\u003e\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar \\u0026\\u0026 pytest tests\\n\\u003c/examples\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"},\"name\":\"download\",\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\u003cusage\\u003e\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"},\"name\":\"edit\",\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\u003c/parameters\\u003e\\n\\n\\u003cspecial_cases\\u003e\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\u003c/special_cases\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\u003c/best_practices\\u003e\\n\\n\\u003cwindows_notes\\u003e\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\u003c/windows_notes\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"},\"name\":\"multiedit\",\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\u003c/parameters\\u003e\\n\\n\\u003coperation\\u003e\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\u003c/operation\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\u003c/best_practices\\u003e\\n\\n\\u003cnew_file_creation\\u003e\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\u003c/new_file_creation\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"},\"name\":\"fetch\",\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\u003cusage\\u003e\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"glob\",\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cpattern_syntax\\u003e\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\u003c/pattern_syntax\\u003e\\n\\n\\u003cexamples\\u003e\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\u003c/examples\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"grep\",\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cregex_syntax\\u003e\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\u003c/regex_syntax\\u003e\\n\\n\\u003cinclude_patterns\\u003e\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\u003c/include_patterns\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003cignore_support\\u003e\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\u003c/ignore_support\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"name\":\"ls\",\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\u003cusage\\u003e\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"},\"name\":\"sourcegraph\",\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\u003cusage\\u003e\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cbasic_syntax\\u003e\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\u003c/basic_syntax\\u003e\\n\\n\\u003ckey_filters\\u003e\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\u003c/key_filters\\u003e\\n\\n\\u003cexamples\\u003e\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\u003c/examples\\u003e\\n\\n\\u003cboolean_operators\\u003e\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\u003c/boolean_operators\\u003e\\n\\n\\u003climitations\\u003e\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"},\"name\":\"view\",\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\u003cusage\\u003e\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines \\u003e2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"},\"name\":\"write\",\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\u003cusage\\u003e\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\u003c/tips\\u003e\\n\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"stream\":true}" headers: Accept: - application/json @@ -146,35 +146,44 @@ interactions: content_length: -1 body: |+ event: message_start - data: {"type":"message_start","message":{"id":"msg_01WEW1wEeHzeuTMmrF4FPCq7","type":"message","role":"assistant","model":"claude-sonnet-4-5-20250929","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":4,"cache_creation_input_tokens":96,"cache_read_input_tokens":8650,"cache_creation":{"ephemeral_5m_input_tokens":96,"ephemeral_1h_input_tokens":0},"output_tokens":2,"service_tier":"standard"}} } + data: {"type":"message_start","message":{"id":"msg_015XKXjL9SricTkGkz4G3YMT","type":"message","role":"assistant","model":"claude-sonnet-4-5-20250929","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":4,"cache_creation_input_tokens":96,"cache_read_input_tokens":8670,"cache_creation":{"ephemeral_5m_input_tokens":96,"ephemeral_1h_input_tokens":0},"output_tokens":2,"service_tier":"standard"}} } event: content_block_start - data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } + data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"\n\n```"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"\n\n```"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"\nmodule example.com/testproject\n\ngo"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"go\nmodule example.com/testproject"} } event: ping data: {"type": "ping"} event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" 1.23\n```"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"\n\ngo 1.23\n```"} } + + event: ping + data: {"type": "ping"} event: content_block_stop - data: {"type":"content_block_stop","index":0 } + data: {"type":"content_block_stop","index":0 } + + event: ping + data: {"type": "ping"} + + event: ping + data: {"type": "ping"} event: message_delta - data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":4,"cache_creation_input_tokens":96,"cache_read_input_tokens":8650,"output_tokens":21} } + data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":4,"cache_creation_input_tokens":96,"cache_read_input_tokens":8670,"output_tokens":22} } event: message_stop - data: {"type":"message_stop" } + data: {"type":"message_stop" } headers: Content-Type: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 2.211554084s + duration: 2.176813959s diff --git a/internal/agent/testdata/TestCoderAgent/anthropic-sonnet/simple_test.yaml b/internal/agent/testdata/TestCoderAgent/anthropic-sonnet/simple_test.yaml index 5a95d8acec91494a0301794107cb24b3f164c1df..06c858f1a96eb0c2d48bbb3a96cb3bd78f563f49 100644 --- a/internal/agent/testdata/TestCoderAgent/anthropic-sonnet/simple_test.yaml +++ b/internal/agent/testdata/TestCoderAgent/anthropic-sonnet/simple_test.yaml @@ -25,49 +25,46 @@ interactions: content_length: -1 body: |+ event: message_start - data: {"type":"message_start","message":{"id":"msg_01NPfprSHhMARzbCZRr49Ke8","type":"message","role":"assistant","model":"claude-3-5-haiku-20241022","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":108,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard"}} } + data: {"type":"message_start","message":{"id":"msg_01CXaxQ4hxLAZTrDjUQFvr14","type":"message","role":"assistant","model":"claude-3-5-haiku-20241022","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":108,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard"}} } event: content_block_start - data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } + data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"First"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Getting"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Chat"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Starte"} } event: ping data: {"type": "ping"} - event: content_block_stop - data: {"type":"content_block_stop","index":0 } - - event: ping - data: {"type": "ping"} + event: content_block_delta + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"d"} } - event: ping - data: {"type": "ping"} + event: content_block_stop + data: {"type":"content_block_stop","index":0 } event: message_delta - data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":108,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":5} } + data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":108,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":5} } event: message_stop - data: {"type":"message_stop" } + data: {"type":"message_stop"} headers: Content-Type: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 720.459042ms + duration: 808.0945ms - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 31902 + content_length: 31975 host: "" - body: "{\"max_tokens\":10000,\"messages\":[{\"content\":[{\"text\":\"Hello\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"role\":\"user\"}],\"model\":\"claude-sonnet-4-5-20250929\",\"system\":[{\"text\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\u003cmemory_instructions\\u003e\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\u003c/memory_instructions\\u003e\\n\\u003ccommunication_style\\u003e\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\u003cexample\\u003e\\nuser: 2 + 2\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what is 2+2?\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: is 11 a prime number?\\nassistant: true\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\u003c/example\\u003e\\n\\u003c/communication_style\\u003e\\n\\n\\u003cproactiveness\\u003e\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\u003c/proactiveness\\u003e\\n\\n\\u003cfollowing_conversations\\u003e\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\u003c/following_conversations\\u003e\\n\\n\\u003ccode_style\\u003e\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\u003c/code_style\\u003e\\n\\n\\u003cdoing_tasks\\u003e\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\u003c/doing_tasks\\u003e\\n\\n\\u003ctool_use\\u003e\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\u003c/tool_use\\u003e\\n\\n\\u003cenv\\u003e\\nWorking directory: /tmp/crush-test/TestCoderAgent/anthropic-sonnet/simple_test\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\u003c/env\\u003e\\n\\u003cmemory\\u003e\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\u003c/memory\\u003e\\n\\n\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"tool_choice\":{\"disable_parallel_tool_use\":false,\"type\":\"auto\"},\"tools\":[{\"input_schema\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"},\"name\":\"bash\",\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\u003ccross_platform\\u003e\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\u003c/cross_platform\\u003e\\n\\n\\u003cexecution_steps\\u003e\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with \\u003ccwd\\u003e\\u003c/cwd\\u003e tags\\n\\u003c/execution_steps\\u003e\\n\\n\\u003cusage_notes\\u003e\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '\\u0026\\u0026', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\u003c/usage_notes\\u003e\\n\\n\\u003cgit_commits\\u003e\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in \\u003ccommit_analysis\\u003e tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\u003ccrush@charm.land\\u003e\\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\u003c/git_commits\\u003e\\n\\n\\u003cpull_requests\\u003e\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in \\u003cpr_analysis\\u003e tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n\\n ## Summary\\n\\n \\u0026lt;1-3 bullet points\\u003e\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\u003c/pull_requests\\u003e\\n\\n\\u003cexamples\\u003e\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar \\u0026\\u0026 pytest tests\\n\\u003c/examples\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"},\"name\":\"download\",\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\u003cusage\\u003e\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"},\"name\":\"edit\",\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\u003c/parameters\\u003e\\n\\n\\u003cspecial_cases\\u003e\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\u003c/special_cases\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\u003c/best_practices\\u003e\\n\\n\\u003cwindows_notes\\u003e\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\u003c/windows_notes\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"},\"name\":\"multiedit\",\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\u003c/parameters\\u003e\\n\\n\\u003coperation\\u003e\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\u003c/operation\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\u003c/best_practices\\u003e\\n\\n\\u003cnew_file_creation\\u003e\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\u003c/new_file_creation\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"},\"name\":\"fetch\",\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\u003cusage\\u003e\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"glob\",\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cpattern_syntax\\u003e\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\u003c/pattern_syntax\\u003e\\n\\n\\u003cexamples\\u003e\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\u003c/examples\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"grep\",\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cregex_syntax\\u003e\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\u003c/regex_syntax\\u003e\\n\\n\\u003cinclude_patterns\\u003e\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\u003c/include_patterns\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003cignore_support\\u003e\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\u003c/ignore_support\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"name\":\"ls\",\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\u003cusage\\u003e\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"},\"name\":\"sourcegraph\",\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\u003cusage\\u003e\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cbasic_syntax\\u003e\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\u003c/basic_syntax\\u003e\\n\\n\\u003ckey_filters\\u003e\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\u003c/key_filters\\u003e\\n\\n\\u003cexamples\\u003e\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\u003c/examples\\u003e\\n\\n\\u003cboolean_operators\\u003e\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\u003c/boolean_operators\\u003e\\n\\n\\u003climitations\\u003e\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"},\"name\":\"view\",\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\u003cusage\\u003e\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines \\u003e2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"},\"name\":\"write\",\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\u003cusage\\u003e\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\u003c/tips\\u003e\\n\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"stream\":true}" + body: "{\"max_tokens\":10000,\"messages\":[{\"content\":[{\"text\":\"Hello\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"role\":\"user\"}],\"model\":\"claude-sonnet-4-5-20250929\",\"system\":[{\"text\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\u003cmemory_instructions\\u003e\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\u003c/memory_instructions\\u003e\\n\\u003ccommunication_style\\u003e\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\u003cexample\\u003e\\nuser: 2 + 2\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what is 2+2?\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: is 11 a prime number?\\nassistant: true\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\u003c/example\\u003e\\n\\u003c/communication_style\\u003e\\n\\n\\u003cproactiveness\\u003e\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\u003c/proactiveness\\u003e\\n\\n\\u003cfollowing_conversations\\u003e\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\u003c/following_conversations\\u003e\\n\\n\\u003ccode_style\\u003e\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\u003c/code_style\\u003e\\n\\n\\u003cdoing_tasks\\u003e\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\u003c/doing_tasks\\u003e\\n\\n\\u003ctool_use\\u003e\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\u003c/tool_use\\u003e\\n\\n\\u003cenv\\u003e\\nWorking directory: /tmp/crush-test/TestCoderAgent/anthropic-sonnet/simple_test\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\u003c/env\\u003e\\n\\u003cmemory\\u003e\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\u003c/memory\\u003e\\n\\n\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"tool_choice\":{\"disable_parallel_tool_use\":false,\"type\":\"auto\"},\"tools\":[{\"input_schema\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"},\"name\":\"bash\",\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\u003ccross_platform\\u003e\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\u003c/cross_platform\\u003e\\n\\n\\u003cexecution_steps\\u003e\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with \\u003ccwd\\u003e\\u003c/cwd\\u003e tags\\n\\u003c/execution_steps\\u003e\\n\\n\\u003cusage_notes\\u003e\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '\\u0026\\u0026', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\u003c/usage_notes\\u003e\\n\\n\\u003cgit_commits\\u003e\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in \\u003ccommit_analysis\\u003e tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\u003ccrush@charm.land\\u003e\\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\u003c/git_commits\\u003e\\n\\n\\u003cpull_requests\\u003e\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in \\u003cpr_analysis\\u003e tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n\\n ## Summary\\n\\n \\u0026lt;1-3 bullet points\\u003e\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\u003c/pull_requests\\u003e\\n\\n\\u003cexamples\\u003e\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar \\u0026\\u0026 pytest tests\\n\\u003c/examples\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"},\"name\":\"download\",\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\u003cusage\\u003e\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"},\"name\":\"edit\",\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\u003c/parameters\\u003e\\n\\n\\u003cspecial_cases\\u003e\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\u003c/special_cases\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\u003c/best_practices\\u003e\\n\\n\\u003cwindows_notes\\u003e\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\u003c/windows_notes\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"},\"name\":\"multiedit\",\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\u003c/parameters\\u003e\\n\\n\\u003coperation\\u003e\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\u003c/operation\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\u003c/best_practices\\u003e\\n\\n\\u003cnew_file_creation\\u003e\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\u003c/new_file_creation\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"},\"name\":\"fetch\",\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\u003cusage\\u003e\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"glob\",\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cpattern_syntax\\u003e\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\u003c/pattern_syntax\\u003e\\n\\n\\u003cexamples\\u003e\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\u003c/examples\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"grep\",\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cregex_syntax\\u003e\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\u003c/regex_syntax\\u003e\\n\\n\\u003cinclude_patterns\\u003e\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\u003c/include_patterns\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003cignore_support\\u003e\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\u003c/ignore_support\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"name\":\"ls\",\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\u003cusage\\u003e\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"},\"name\":\"sourcegraph\",\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\u003cusage\\u003e\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cbasic_syntax\\u003e\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\u003c/basic_syntax\\u003e\\n\\n\\u003ckey_filters\\u003e\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\u003c/key_filters\\u003e\\n\\n\\u003cexamples\\u003e\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\u003c/examples\\u003e\\n\\n\\u003cboolean_operators\\u003e\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\u003c/boolean_operators\\u003e\\n\\n\\u003climitations\\u003e\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"},\"name\":\"view\",\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\u003cusage\\u003e\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines \\u003e2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"},\"name\":\"write\",\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\u003cusage\\u003e\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\u003c/tips\\u003e\\n\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"stream\":true}" headers: Accept: - application/json @@ -84,22 +81,22 @@ interactions: content_length: -1 body: |+ event: message_start - data: {"type":"message_start","message":{"id":"msg_01BP7bLj4NRioVUWazXDXcXs","type":"message","role":"assistant","model":"claude-sonnet-4-5-20250929","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":3,"cache_creation_input_tokens":8645,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":8645,"ephemeral_1h_input_tokens":0},"output_tokens":3,"service_tier":"standard"}} } + data: {"type":"message_start","message":{"id":"msg_01B4XaRUoxdCiiS5CUokTiYe","type":"message","role":"assistant","model":"claude-sonnet-4-5-20250929","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":3,"cache_creation_input_tokens":8665,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":8665,"ephemeral_1h_input_tokens":0},"output_tokens":3,"service_tier":"standard"}} } event: content_block_start - data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } + data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } event: content_block_delta data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Hello! How"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" can I help you today?"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" can I help you today?"} } event: ping data: {"type": "ping"} event: content_block_stop - data: {"type":"content_block_stop","index":0 } + data: {"type":"content_block_stop","index":0 } event: ping data: {"type": "ping"} @@ -108,14 +105,14 @@ interactions: data: {"type": "ping"} event: message_delta - data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":3,"cache_creation_input_tokens":8645,"cache_read_input_tokens":0,"output_tokens":12} } + data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":3,"cache_creation_input_tokens":8665,"cache_read_input_tokens":0,"output_tokens":12} } event: message_stop - data: {"type":"message_stop" } + data: {"type":"message_stop" } headers: Content-Type: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 2.237486709s + duration: 2.30398275s diff --git a/internal/agent/testdata/TestCoderAgent/anthropic-sonnet/sourcegraph_tool.yaml b/internal/agent/testdata/TestCoderAgent/anthropic-sonnet/sourcegraph_tool.yaml index c818833522f6fa156e10e01069e01fbaf622d0c7..b10d6da30ad58544034a5487608f8e9e6094a276 100644 --- a/internal/agent/testdata/TestCoderAgent/anthropic-sonnet/sourcegraph_tool.yaml +++ b/internal/agent/testdata/TestCoderAgent/anthropic-sonnet/sourcegraph_tool.yaml @@ -25,52 +25,55 @@ interactions: content_length: -1 body: |+ event: message_start - data: {"type":"message_start","message":{"id":"msg_01QvTXuWQd7x5a1gdsHNdRLc","type":"message","role":"assistant","model":"claude-3-5-haiku-20241022","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":122,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":2,"service_tier":"standard"}} } + data: {"type":"message_start","message":{"id":"msg_01NNQSo6XdvUrm9KVjF253LP","type":"message","role":"assistant","model":"claude-3-5-haiku-20241022","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":122,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard"}} } event: content_block_start - data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } + data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Search "} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Search"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"'func main' in"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Go"} } event: ping data: {"type": "ping"} event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Go repos"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Repos"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" on"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" for"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Sourcegraph"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Main"} } + + event: content_block_delta + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Function"} } event: content_block_stop - data: {"type":"content_block_stop","index":0 } + data: {"type":"content_block_stop","index":0 } event: message_delta - data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":122,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":17} } + data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":122,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":10} } event: message_stop - data: {"type":"message_stop" } + data: {"type":"message_stop" } headers: Content-Type: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 557.6895ms + duration: 549.390667ms - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 31962 + content_length: 32035 host: "" - body: "{\"max_tokens\":10000,\"messages\":[{\"content\":[{\"text\":\"use sourcegraph to search for 'func main' in Go repositories\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"role\":\"user\"}],\"model\":\"claude-sonnet-4-5-20250929\",\"system\":[{\"text\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\u003cmemory_instructions\\u003e\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\u003c/memory_instructions\\u003e\\n\\u003ccommunication_style\\u003e\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\u003cexample\\u003e\\nuser: 2 + 2\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what is 2+2?\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: is 11 a prime number?\\nassistant: true\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\u003c/example\\u003e\\n\\u003c/communication_style\\u003e\\n\\n\\u003cproactiveness\\u003e\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\u003c/proactiveness\\u003e\\n\\n\\u003cfollowing_conversations\\u003e\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\u003c/following_conversations\\u003e\\n\\n\\u003ccode_style\\u003e\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\u003c/code_style\\u003e\\n\\n\\u003cdoing_tasks\\u003e\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\u003c/doing_tasks\\u003e\\n\\n\\u003ctool_use\\u003e\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\u003c/tool_use\\u003e\\n\\n\\u003cenv\\u003e\\nWorking directory: /tmp/crush-test/TestCoderAgent/anthropic-sonnet/sourcegraph_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\u003c/env\\u003e\\n\\u003cmemory\\u003e\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\u003c/memory\\u003e\\n\\n\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"tool_choice\":{\"disable_parallel_tool_use\":false,\"type\":\"auto\"},\"tools\":[{\"input_schema\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"},\"name\":\"bash\",\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\u003ccross_platform\\u003e\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\u003c/cross_platform\\u003e\\n\\n\\u003cexecution_steps\\u003e\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with \\u003ccwd\\u003e\\u003c/cwd\\u003e tags\\n\\u003c/execution_steps\\u003e\\n\\n\\u003cusage_notes\\u003e\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '\\u0026\\u0026', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\u003c/usage_notes\\u003e\\n\\n\\u003cgit_commits\\u003e\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in \\u003ccommit_analysis\\u003e tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\u003ccrush@charm.land\\u003e\\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\u003c/git_commits\\u003e\\n\\n\\u003cpull_requests\\u003e\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in \\u003cpr_analysis\\u003e tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n\\n ## Summary\\n\\n \\u0026lt;1-3 bullet points\\u003e\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\u003c/pull_requests\\u003e\\n\\n\\u003cexamples\\u003e\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar \\u0026\\u0026 pytest tests\\n\\u003c/examples\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"},\"name\":\"download\",\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\u003cusage\\u003e\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"},\"name\":\"edit\",\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\u003c/parameters\\u003e\\n\\n\\u003cspecial_cases\\u003e\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\u003c/special_cases\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\u003c/best_practices\\u003e\\n\\n\\u003cwindows_notes\\u003e\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\u003c/windows_notes\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"},\"name\":\"multiedit\",\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\u003c/parameters\\u003e\\n\\n\\u003coperation\\u003e\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\u003c/operation\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\u003c/best_practices\\u003e\\n\\n\\u003cnew_file_creation\\u003e\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\u003c/new_file_creation\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"},\"name\":\"fetch\",\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\u003cusage\\u003e\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"glob\",\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cpattern_syntax\\u003e\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\u003c/pattern_syntax\\u003e\\n\\n\\u003cexamples\\u003e\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\u003c/examples\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"grep\",\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cregex_syntax\\u003e\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\u003c/regex_syntax\\u003e\\n\\n\\u003cinclude_patterns\\u003e\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\u003c/include_patterns\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003cignore_support\\u003e\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\u003c/ignore_support\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"name\":\"ls\",\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\u003cusage\\u003e\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"},\"name\":\"sourcegraph\",\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\u003cusage\\u003e\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cbasic_syntax\\u003e\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\u003c/basic_syntax\\u003e\\n\\n\\u003ckey_filters\\u003e\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\u003c/key_filters\\u003e\\n\\n\\u003cexamples\\u003e\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\u003c/examples\\u003e\\n\\n\\u003cboolean_operators\\u003e\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\u003c/boolean_operators\\u003e\\n\\n\\u003climitations\\u003e\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"},\"name\":\"view\",\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\u003cusage\\u003e\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines \\u003e2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"},\"name\":\"write\",\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\u003cusage\\u003e\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\u003c/tips\\u003e\\n\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"stream\":true}" + body: "{\"max_tokens\":10000,\"messages\":[{\"content\":[{\"text\":\"use sourcegraph to search for 'func main' in Go repositories\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"role\":\"user\"}],\"model\":\"claude-sonnet-4-5-20250929\",\"system\":[{\"text\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\u003cmemory_instructions\\u003e\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\u003c/memory_instructions\\u003e\\n\\u003ccommunication_style\\u003e\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\u003cexample\\u003e\\nuser: 2 + 2\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what is 2+2?\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: is 11 a prime number?\\nassistant: true\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\u003c/example\\u003e\\n\\u003c/communication_style\\u003e\\n\\n\\u003cproactiveness\\u003e\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\u003c/proactiveness\\u003e\\n\\n\\u003cfollowing_conversations\\u003e\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\u003c/following_conversations\\u003e\\n\\n\\u003ccode_style\\u003e\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\u003c/code_style\\u003e\\n\\n\\u003cdoing_tasks\\u003e\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\u003c/doing_tasks\\u003e\\n\\n\\u003ctool_use\\u003e\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\u003c/tool_use\\u003e\\n\\n\\u003cenv\\u003e\\nWorking directory: /tmp/crush-test/TestCoderAgent/anthropic-sonnet/sourcegraph_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\u003c/env\\u003e\\n\\u003cmemory\\u003e\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\u003c/memory\\u003e\\n\\n\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"tool_choice\":{\"disable_parallel_tool_use\":false,\"type\":\"auto\"},\"tools\":[{\"input_schema\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"},\"name\":\"bash\",\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\u003ccross_platform\\u003e\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\u003c/cross_platform\\u003e\\n\\n\\u003cexecution_steps\\u003e\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with \\u003ccwd\\u003e\\u003c/cwd\\u003e tags\\n\\u003c/execution_steps\\u003e\\n\\n\\u003cusage_notes\\u003e\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '\\u0026\\u0026', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\u003c/usage_notes\\u003e\\n\\n\\u003cgit_commits\\u003e\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in \\u003ccommit_analysis\\u003e tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\u003ccrush@charm.land\\u003e\\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\u003c/git_commits\\u003e\\n\\n\\u003cpull_requests\\u003e\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in \\u003cpr_analysis\\u003e tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n\\n ## Summary\\n\\n \\u0026lt;1-3 bullet points\\u003e\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\u003c/pull_requests\\u003e\\n\\n\\u003cexamples\\u003e\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar \\u0026\\u0026 pytest tests\\n\\u003c/examples\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"},\"name\":\"download\",\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\u003cusage\\u003e\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"},\"name\":\"edit\",\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\u003c/parameters\\u003e\\n\\n\\u003cspecial_cases\\u003e\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\u003c/special_cases\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\u003c/best_practices\\u003e\\n\\n\\u003cwindows_notes\\u003e\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\u003c/windows_notes\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"},\"name\":\"multiedit\",\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\u003c/parameters\\u003e\\n\\n\\u003coperation\\u003e\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\u003c/operation\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\u003c/best_practices\\u003e\\n\\n\\u003cnew_file_creation\\u003e\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\u003c/new_file_creation\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"},\"name\":\"fetch\",\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\u003cusage\\u003e\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"glob\",\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cpattern_syntax\\u003e\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\u003c/pattern_syntax\\u003e\\n\\n\\u003cexamples\\u003e\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\u003c/examples\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"grep\",\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cregex_syntax\\u003e\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\u003c/regex_syntax\\u003e\\n\\n\\u003cinclude_patterns\\u003e\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\u003c/include_patterns\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003cignore_support\\u003e\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\u003c/ignore_support\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"name\":\"ls\",\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\u003cusage\\u003e\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"},\"name\":\"sourcegraph\",\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\u003cusage\\u003e\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cbasic_syntax\\u003e\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\u003c/basic_syntax\\u003e\\n\\n\\u003ckey_filters\\u003e\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\u003c/key_filters\\u003e\\n\\n\\u003cexamples\\u003e\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\u003c/examples\\u003e\\n\\n\\u003cboolean_operators\\u003e\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\u003c/boolean_operators\\u003e\\n\\n\\u003climitations\\u003e\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"},\"name\":\"view\",\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\u003cusage\\u003e\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines \\u003e2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"},\"name\":\"write\",\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\u003cusage\\u003e\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\u003c/tips\\u003e\\n\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"stream\":true}" headers: Accept: - application/json @@ -87,47 +90,59 @@ interactions: content_length: -1 body: |+ event: message_start - data: {"type":"message_start","message":{"id":"msg_01EWC82Vo5nazifWKvow26pU","type":"message","role":"assistant","model":"claude-sonnet-4-5-20250929","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":3,"cache_creation_input_tokens":1777,"cache_read_input_tokens":6884,"cache_creation":{"ephemeral_5m_input_tokens":1777,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard"}} } + data: {"type":"message_start","message":{"id":"msg_018yVhEFkWh9q5YAdht62Wk4","type":"message","role":"assistant","model":"claude-sonnet-4-5-20250929","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":3,"cache_creation_input_tokens":1777,"cache_read_input_tokens":6904,"cache_creation":{"ephemeral_5m_input_tokens":1777,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard"}} } event: content_block_start - data: {"type":"content_block_start","index":0,"content_block":{"type":"tool_use","id":"toolu_01CpVoqS4jABUcegUtjhj46R","name":"sourcegraph","input":{}} } + data: {"type":"content_block_start","index":0,"content_block":{"type":"tool_use","id":"toolu_01GRCP7Ck679pphBHpdiz68S","name":"sourcegraph","input":{}} } + + event: content_block_delta + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":""} } + + event: content_block_delta + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"{\"que"} } + + event: content_block_delta + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"ry\": "} } + + event: content_block_delta + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"\"lang"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":""} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":":g"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"{\"query\""} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"o func m"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":": \"lang:"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"ai"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"go fu"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"n\""} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"nc main\""}} + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":", \"c"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":", \"count\": "} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"ount\": "} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"10}"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"10}"}} event: content_block_stop - data: {"type":"content_block_stop","index":0 } + data: {"type":"content_block_stop","index":0 } event: message_delta - data: {"type":"message_delta","delta":{"stop_reason":"tool_use","stop_sequence":null},"usage":{"input_tokens":3,"cache_creation_input_tokens":1777,"cache_read_input_tokens":6884,"output_tokens":74} } + data: {"type":"message_delta","delta":{"stop_reason":"tool_use","stop_sequence":null},"usage":{"input_tokens":3,"cache_creation_input_tokens":1777,"cache_read_input_tokens":6904,"output_tokens":74} } event: message_stop - data: {"type":"message_stop"} + data: {"type":"message_stop" } headers: Content-Type: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 2.234445125s + duration: 2.724424166s - id: 2 request: proto: HTTP/1.1 @@ -155,15 +170,15 @@ interactions: - application/json status: 200 OK code: 200 - duration: 1.427534041s + duration: 1.417697375s - id: 3 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 39784 + content_length: 39857 host: "" - body: "{\"max_tokens\":10000,\"messages\":[{\"content\":[{\"text\":\"use sourcegraph to search for 'func main' in Go repositories\",\"type\":\"text\"}],\"role\":\"user\"},{\"content\":[{\"id\":\"toolu_01CpVoqS4jABUcegUtjhj46R\",\"input\":{\"count\":10,\"query\":\"lang:go func main\"},\"name\":\"sourcegraph\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"tool_use\"}],\"role\":\"assistant\"},{\"content\":[{\"tool_use_id\":\"toolu_01CpVoqS4jABUcegUtjhj46R\",\"cache_control\":{\"type\":\"ephemeral\"},\"content\":[{\"text\":\"# Sourcegraph Search Results\\n\\nFound 30 matches across 30 results\\n(Result limit reached, try a more specific query)\\n\\n## Result 1: github.com/yanfeizhang/go-training/8-internal/memory/stackgrow/main.go\\n\\nURL: /github.com/yanfeizhang/go-training/-/blob/8-internal/memory/stackgrow/main.go\\n\\n```\\n0| package main\\n1| package main\\n2| \\n3| func main() {\\n4| \\tn := 1\\n5| \\t_ = func1(n)\\n6| \\t_ = func2(n)\\n7| }\\n8| \\n9| func func1(n int) int {\\n10| \\t_ = make([]byte, 200)\\n```\\n\\n```\\n1| package main\\n2| func main() {\\n3| func main() {\\n4| \\tn := 1\\n5| \\t_ = func1(n)\\n6| \\t_ = func2(n)\\n7| }\\n8| \\n9| func func1(n int) int {\\n10| \\t_ = make([]byte, 200)\\n11| \\treturn n\\n12| }\\n```\\n\\n```\\n1| package main\\n2| \\n3| func main() {\\n4| \\t_ = func1(n)\\n5| \\t_ = func1(n)\\n6| \\t_ = func2(n)\\n7| }\\n8| \\n9| func func1(n int) int {\\n10| \\t_ = make([]byte, 200)\\n11| \\treturn n\\n12| }\\n13| \\n14| func func2(n int) int {\\n```\\n\\n```\\n1| package main\\n2| \\n3| func main() {\\n4| \\tn := 1\\n5| \\t_ = func2(n)\\n6| \\t_ = func2(n)\\n7| }\\n8| \\n9| func func1(n int) int {\\n10| \\t_ = make([]byte, 200)\\n11| \\treturn n\\n12| }\\n13| \\n14| func func2(n int) int {\\n15| \\t_ = make([]byte, 20)\\n```\\n\\n```\\n1| package main\\n2| \\n3| func main() {\\n4| \\tn := 1\\n5| \\t_ = func1(n)\\n6| \\t_ = func2(n)\\n7| }\\n8| func func1(n int) int {\\n9| func func1(n int) int {\\n10| \\t_ = make([]byte, 200)\\n11| \\treturn n\\n12| }\\n13| \\n14| func func2(n int) int {\\n15| \\t_ = make([]byte, 20)\\n16| \\treturn n\\n17| }\\n18| \\n```\\n\\n```\\n3| func main() {\\n4| \\tn := 1\\n5| \\t_ = func1(n)\\n6| \\t_ = func2(n)\\n7| }\\n8| \\n9| func func1(n int) int {\\n10| \\t_ = make([]byte, 200)\\n11| \\treturn n\\n12| }\\n13| func func2(n int) int {\\n14| func func2(n int) int {\\n15| \\t_ = make([]byte, 20)\\n16| \\treturn n\\n17| }\\n18| \\n```\\n\\n## Result 2: github.com/GolangUA/go-training/src/functions/functions3/main.go\\n\\nURL: /github.com/GolangUA/go-training/-/blob/src/functions/functions3/main.go\\n\\n```\\n1| package main\\n2| \\n3| // START OMIT\\n4| func hello(name int) {\\n5| \\tprintln(\\\"Hello \\\" + name)\\n6| }\\n7| func main() {\\n8| func main() {\\n9| \\thello(\\\"David\\\")\\n10| }\\n11| \\n12| // END OMIT\\n13| \\n```\\n\\n```\\n0| package main\\n1| package main\\n2| \\n3| // START OMIT\\n4| func hello(name int) {\\n5| \\tprintln(\\\"Hello \\\" + name)\\n6| }\\n7| \\n8| func main() {\\n9| \\thello(\\\"David\\\")\\n10| }\\n```\\n\\n```\\n1| package main\\n2| \\n3| func hello(name int) {\\n4| func hello(name int) {\\n5| \\tprintln(\\\"Hello \\\" + name)\\n6| }\\n7| \\n8| func main() {\\n9| \\thello(\\\"David\\\")\\n10| }\\n11| \\n12| // END OMIT\\n13| \\n```\\n\\n## Result 3: github.com/pingguoxueyuan/gostudy/listen15/defer/main.go\\n\\nURL: /github.com/pingguoxueyuan/gostudy/-/blob/listen15/defer/main.go\\n\\n```\\n26| \\t}()\\n27| \\treturn x\\n28| }\\n29| \\n30| func funcD() (x int) {\\n31| \\tdefer func(x int) {\\n32| \\t\\tx += 1\\n33| \\t}(x)\\n34| \\treturn 5\\n35| }\\n36| func main() {\\n37| func main() {\\n38| \\t//fmt.Println(funcA())\\n39| \\t//fmt.Println(funcB())\\n40| \\t//fmt.Println(funcC())\\n41| \\tfmt.Println(funcD())\\n42| }\\n43| \\n```\\n\\n```\\n27| \\treturn x\\n28| }\\n29| \\n30| func funcD() (x int) {\\n31| \\tdefer func(x int) {\\n32| \\t\\tx += 1\\n33| \\t}(x)\\n34| \\treturn 5\\n35| }\\n36| \\n37| \\t//fmt.Println(funcA())\\n38| \\t//fmt.Println(funcA())\\n39| \\t//fmt.Println(funcB())\\n40| \\t//fmt.Println(funcC())\\n41| \\tfmt.Println(funcD())\\n42| }\\n43| \\n```\\n\\n```\\n28| }\\n29| \\n30| func funcD() (x int) {\\n31| \\tdefer func(x int) {\\n32| \\t\\tx += 1\\n33| \\t}(x)\\n34| \\treturn 5\\n35| }\\n36| \\n37| func main() {\\n38| \\t//fmt.Println(funcB())\\n39| \\t//fmt.Println(funcB())\\n40| \\t//fmt.Println(funcC())\\n41| \\tfmt.Println(funcD())\\n42| }\\n43| \\n```\\n\\n```\\n29| \\n30| func funcD() (x int) {\\n31| \\tdefer func(x int) {\\n32| \\t\\tx += 1\\n33| \\t}(x)\\n34| \\treturn 5\\n35| }\\n36| \\n37| func main() {\\n38| \\t//fmt.Println(funcA())\\n39| \\t//fmt.Println(funcC())\\n40| \\t//fmt.Println(funcC())\\n41| \\tfmt.Println(funcD())\\n42| }\\n43| \\n```\\n\\n```\\n30| func funcD() (x int) {\\n31| \\tdefer func(x int) {\\n32| \\t\\tx += 1\\n33| \\t}(x)\\n34| \\treturn 5\\n35| }\\n36| \\n37| func main() {\\n38| \\t//fmt.Println(funcA())\\n39| \\t//fmt.Println(funcB())\\n40| \\tfmt.Println(funcD())\\n41| \\tfmt.Println(funcD())\\n42| }\\n43| \\n```\\n\\n```\\n1| package main\\n2| \\n3| import (\\n4| \\t\\\"fmt\\\"\\n5| )\\n6| func funcA() int {\\n7| func funcA() int {\\n8| \\tx := 5\\n9| \\tdefer func() {\\n10| \\t\\tx += 1\\n11| \\t}()\\n12| \\treturn x\\n13| }\\n14| \\n15| func funcB() (x int) {\\n16| \\tdefer func() {\\n```\\n\\n```\\n1| package main\\n2| \\n3| import (\\n4| \\t\\\"fmt\\\"\\n5| )\\n6| \\n7| func funcA() int {\\n8| \\tdefer func() {\\n9| \\tdefer func() {\\n10| \\t\\tx += 1\\n11| \\t}()\\n12| \\treturn x\\n13| }\\n14| \\n15| func funcB() (x int) {\\n16| \\tdefer func() {\\n17| \\t\\tx += 1\\n18| \\t}()\\n```\\n\\n```\\n0| package main\\n1| package main\\n2| \\n3| import (\\n4| \\t\\\"fmt\\\"\\n5| )\\n6| \\n7| func funcA() int {\\n8| \\tx := 5\\n9| \\tdefer func() {\\n10| \\t\\tx += 1\\n```\\n\\n```\\n4| \\t\\\"fmt\\\"\\n5| )\\n6| \\n7| func funcA() int {\\n8| \\tx := 5\\n9| \\tdefer func() {\\n10| \\t\\tx += 1\\n11| \\t}()\\n12| \\treturn x\\n13| }\\n14| func funcB() (x int) {\\n15| func funcB() (x int) {\\n16| \\tdefer func() {\\n17| \\t\\tx += 1\\n18| \\t}()\\n19| \\treturn 5\\n20| }\\n21| \\n22| func funcC() (y int) {\\n23| \\tx := 5\\n24| \\tdefer func() {\\n```\\n\\n```\\n5| )\\n6| \\n7| func funcA() int {\\n8| \\tx := 5\\n9| \\tdefer func() {\\n10| \\t\\tx += 1\\n11| \\t}()\\n12| \\treturn x\\n13| }\\n14| \\n15| \\tdefer func() {\\n16| \\tdefer func() {\\n17| \\t\\tx += 1\\n18| \\t}()\\n19| \\treturn 5\\n20| }\\n21| \\n22| func funcC() (y int) {\\n23| \\tx := 5\\n24| \\tdefer func() {\\n25| \\t\\tx += 1\\n```\\n\\n```\\n11| \\t}()\\n12| \\treturn x\\n13| }\\n14| \\n15| func funcB() (x int) {\\n16| \\tdefer func() {\\n17| \\t\\tx += 1\\n18| \\t}()\\n19| \\treturn 5\\n20| }\\n21| func funcC() (y int) {\\n22| func funcC() (y int) {\\n23| \\tx := 5\\n24| \\tdefer func() {\\n25| \\t\\tx += 1\\n26| \\t}()\\n27| \\treturn x\\n28| }\\n29| \\n30| func funcD() (x int) {\\n31| \\tdefer func(x int) {\\n```\\n\\n```\\n13| }\\n14| \\n15| func funcB() (x int) {\\n16| \\tdefer func() {\\n17| \\t\\tx += 1\\n18| \\t}()\\n19| \\treturn 5\\n20| }\\n21| \\n22| func funcC() (y int) {\\n23| \\tdefer func() {\\n24| \\tdefer func() {\\n25| \\t\\tx += 1\\n26| \\t}()\\n27| \\treturn x\\n28| }\\n29| \\n30| func funcD() (x int) {\\n31| \\tdefer func(x int) {\\n32| \\t\\tx += 1\\n33| \\t}(x)\\n```\\n\\n```\\n19| \\treturn 5\\n20| }\\n21| \\n22| func funcC() (y int) {\\n23| \\tx := 5\\n24| \\tdefer func() {\\n25| \\t\\tx += 1\\n26| \\t}()\\n27| \\treturn x\\n28| }\\n29| func funcD() (x int) {\\n30| func funcD() (x int) {\\n31| \\tdefer func(x int) {\\n32| \\t\\tx += 1\\n33| \\t}(x)\\n34| \\treturn 5\\n35| }\\n36| \\n37| func main() {\\n38| \\t//fmt.Println(funcA())\\n39| \\t//fmt.Println(funcB())\\n```\\n\\n```\\n20| }\\n21| \\n22| func funcC() (y int) {\\n23| \\tx := 5\\n24| \\tdefer func() {\\n25| \\t\\tx += 1\\n26| \\t}()\\n27| \\treturn x\\n28| }\\n29| \\n30| \\tdefer func(x int) {\\n31| \\tdefer func(x int) {\\n32| \\t\\tx += 1\\n33| \\t}(x)\\n34| \\treturn 5\\n35| }\\n36| \\n37| func main() {\\n38| \\t//fmt.Println(funcA())\\n39| \\t//fmt.Println(funcB())\\n40| \\t//fmt.Println(funcC())\\n```\\n\\n## Result 4: github.com/Zhouchaowen/golang-tutorial/12-library/8-error/ch_1/main.go\\n\\nURL: /github.com/Zhouchaowen/golang-tutorial/-/blob/12-library/8-error/ch_1/main.go\\n\\n```\\n5| \\t\\\"fmt\\\"\\n6| )\\n7| \\n8| func func1() error {\\n9| \\treturn errors.New(\\\"func1 error\\\")\\n10| }\\n11| \\n12| func func2() error {\\n13| \\treturn fmt.Errorf(\\\"func2 error: %w\\\", func1())\\n14| }\\n15| func main() {\\n16| func main() {\\n17| \\terr := func2()\\n18| \\tif err != nil {\\n19| \\t\\tfmt.Println(err)\\n20| \\t}\\n21| }\\n22| \\n```\\n\\n\",\"type\":\"text\"}],\"type\":\"tool_result\"}],\"role\":\"user\"}],\"model\":\"claude-sonnet-4-5-20250929\",\"system\":[{\"text\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\u003cmemory_instructions\\u003e\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\u003c/memory_instructions\\u003e\\n\\u003ccommunication_style\\u003e\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\u003cexample\\u003e\\nuser: 2 + 2\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what is 2+2?\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: is 11 a prime number?\\nassistant: true\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\u003c/example\\u003e\\n\\u003c/communication_style\\u003e\\n\\n\\u003cproactiveness\\u003e\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\u003c/proactiveness\\u003e\\n\\n\\u003cfollowing_conversations\\u003e\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\u003c/following_conversations\\u003e\\n\\n\\u003ccode_style\\u003e\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\u003c/code_style\\u003e\\n\\n\\u003cdoing_tasks\\u003e\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\u003c/doing_tasks\\u003e\\n\\n\\u003ctool_use\\u003e\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\u003c/tool_use\\u003e\\n\\n\\u003cenv\\u003e\\nWorking directory: /tmp/crush-test/TestCoderAgent/anthropic-sonnet/sourcegraph_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\u003c/env\\u003e\\n\\u003cmemory\\u003e\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\u003c/memory\\u003e\\n\\n\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"tool_choice\":{\"disable_parallel_tool_use\":false,\"type\":\"auto\"},\"tools\":[{\"input_schema\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"},\"name\":\"bash\",\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\u003ccross_platform\\u003e\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\u003c/cross_platform\\u003e\\n\\n\\u003cexecution_steps\\u003e\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with \\u003ccwd\\u003e\\u003c/cwd\\u003e tags\\n\\u003c/execution_steps\\u003e\\n\\n\\u003cusage_notes\\u003e\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '\\u0026\\u0026', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\u003c/usage_notes\\u003e\\n\\n\\u003cgit_commits\\u003e\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in \\u003ccommit_analysis\\u003e tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\u003ccrush@charm.land\\u003e\\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\u003c/git_commits\\u003e\\n\\n\\u003cpull_requests\\u003e\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in \\u003cpr_analysis\\u003e tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n\\n ## Summary\\n\\n \\u0026lt;1-3 bullet points\\u003e\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\u003c/pull_requests\\u003e\\n\\n\\u003cexamples\\u003e\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar \\u0026\\u0026 pytest tests\\n\\u003c/examples\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"},\"name\":\"download\",\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\u003cusage\\u003e\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"},\"name\":\"edit\",\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\u003c/parameters\\u003e\\n\\n\\u003cspecial_cases\\u003e\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\u003c/special_cases\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\u003c/best_practices\\u003e\\n\\n\\u003cwindows_notes\\u003e\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\u003c/windows_notes\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"},\"name\":\"multiedit\",\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\u003c/parameters\\u003e\\n\\n\\u003coperation\\u003e\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\u003c/operation\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\u003c/best_practices\\u003e\\n\\n\\u003cnew_file_creation\\u003e\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\u003c/new_file_creation\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"},\"name\":\"fetch\",\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\u003cusage\\u003e\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"glob\",\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cpattern_syntax\\u003e\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\u003c/pattern_syntax\\u003e\\n\\n\\u003cexamples\\u003e\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\u003c/examples\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"grep\",\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cregex_syntax\\u003e\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\u003c/regex_syntax\\u003e\\n\\n\\u003cinclude_patterns\\u003e\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\u003c/include_patterns\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003cignore_support\\u003e\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\u003c/ignore_support\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"name\":\"ls\",\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\u003cusage\\u003e\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"},\"name\":\"sourcegraph\",\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\u003cusage\\u003e\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cbasic_syntax\\u003e\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\u003c/basic_syntax\\u003e\\n\\n\\u003ckey_filters\\u003e\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\u003c/key_filters\\u003e\\n\\n\\u003cexamples\\u003e\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\u003c/examples\\u003e\\n\\n\\u003cboolean_operators\\u003e\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\u003c/boolean_operators\\u003e\\n\\n\\u003climitations\\u003e\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"},\"name\":\"view\",\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\u003cusage\\u003e\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines \\u003e2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"},\"name\":\"write\",\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\u003cusage\\u003e\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\u003c/tips\\u003e\\n\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"stream\":true}" + body: "{\"max_tokens\":10000,\"messages\":[{\"content\":[{\"text\":\"use sourcegraph to search for 'func main' in Go repositories\",\"type\":\"text\"}],\"role\":\"user\"},{\"content\":[{\"id\":\"toolu_01GRCP7Ck679pphBHpdiz68S\",\"input\":{\"count\":10,\"query\":\"lang:go func main\"},\"name\":\"sourcegraph\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"tool_use\"}],\"role\":\"assistant\"},{\"content\":[{\"tool_use_id\":\"toolu_01GRCP7Ck679pphBHpdiz68S\",\"cache_control\":{\"type\":\"ephemeral\"},\"content\":[{\"text\":\"# Sourcegraph Search Results\\n\\nFound 30 matches across 30 results\\n(Result limit reached, try a more specific query)\\n\\n## Result 1: github.com/yanfeizhang/go-training/8-internal/memory/stackgrow/main.go\\n\\nURL: /github.com/yanfeizhang/go-training/-/blob/8-internal/memory/stackgrow/main.go\\n\\n```\\n0| package main\\n1| package main\\n2| \\n3| func main() {\\n4| \\tn := 1\\n5| \\t_ = func1(n)\\n6| \\t_ = func2(n)\\n7| }\\n8| \\n9| func func1(n int) int {\\n10| \\t_ = make([]byte, 200)\\n```\\n\\n```\\n1| package main\\n2| func main() {\\n3| func main() {\\n4| \\tn := 1\\n5| \\t_ = func1(n)\\n6| \\t_ = func2(n)\\n7| }\\n8| \\n9| func func1(n int) int {\\n10| \\t_ = make([]byte, 200)\\n11| \\treturn n\\n12| }\\n```\\n\\n```\\n1| package main\\n2| \\n3| func main() {\\n4| \\t_ = func1(n)\\n5| \\t_ = func1(n)\\n6| \\t_ = func2(n)\\n7| }\\n8| \\n9| func func1(n int) int {\\n10| \\t_ = make([]byte, 200)\\n11| \\treturn n\\n12| }\\n13| \\n14| func func2(n int) int {\\n```\\n\\n```\\n1| package main\\n2| \\n3| func main() {\\n4| \\tn := 1\\n5| \\t_ = func2(n)\\n6| \\t_ = func2(n)\\n7| }\\n8| \\n9| func func1(n int) int {\\n10| \\t_ = make([]byte, 200)\\n11| \\treturn n\\n12| }\\n13| \\n14| func func2(n int) int {\\n15| \\t_ = make([]byte, 20)\\n```\\n\\n```\\n1| package main\\n2| \\n3| func main() {\\n4| \\tn := 1\\n5| \\t_ = func1(n)\\n6| \\t_ = func2(n)\\n7| }\\n8| func func1(n int) int {\\n9| func func1(n int) int {\\n10| \\t_ = make([]byte, 200)\\n11| \\treturn n\\n12| }\\n13| \\n14| func func2(n int) int {\\n15| \\t_ = make([]byte, 20)\\n16| \\treturn n\\n17| }\\n18| \\n```\\n\\n```\\n3| func main() {\\n4| \\tn := 1\\n5| \\t_ = func1(n)\\n6| \\t_ = func2(n)\\n7| }\\n8| \\n9| func func1(n int) int {\\n10| \\t_ = make([]byte, 200)\\n11| \\treturn n\\n12| }\\n13| func func2(n int) int {\\n14| func func2(n int) int {\\n15| \\t_ = make([]byte, 20)\\n16| \\treturn n\\n17| }\\n18| \\n```\\n\\n## Result 2: github.com/GolangUA/go-training/src/functions/functions3/main.go\\n\\nURL: /github.com/GolangUA/go-training/-/blob/src/functions/functions3/main.go\\n\\n```\\n1| package main\\n2| \\n3| // START OMIT\\n4| func hello(name int) {\\n5| \\tprintln(\\\"Hello \\\" + name)\\n6| }\\n7| func main() {\\n8| func main() {\\n9| \\thello(\\\"David\\\")\\n10| }\\n11| \\n12| // END OMIT\\n13| \\n```\\n\\n```\\n0| package main\\n1| package main\\n2| \\n3| // START OMIT\\n4| func hello(name int) {\\n5| \\tprintln(\\\"Hello \\\" + name)\\n6| }\\n7| \\n8| func main() {\\n9| \\thello(\\\"David\\\")\\n10| }\\n```\\n\\n```\\n1| package main\\n2| \\n3| func hello(name int) {\\n4| func hello(name int) {\\n5| \\tprintln(\\\"Hello \\\" + name)\\n6| }\\n7| \\n8| func main() {\\n9| \\thello(\\\"David\\\")\\n10| }\\n11| \\n12| // END OMIT\\n13| \\n```\\n\\n## Result 3: github.com/pingguoxueyuan/gostudy/listen15/defer/main.go\\n\\nURL: /github.com/pingguoxueyuan/gostudy/-/blob/listen15/defer/main.go\\n\\n```\\n26| \\t}()\\n27| \\treturn x\\n28| }\\n29| \\n30| func funcD() (x int) {\\n31| \\tdefer func(x int) {\\n32| \\t\\tx += 1\\n33| \\t}(x)\\n34| \\treturn 5\\n35| }\\n36| func main() {\\n37| func main() {\\n38| \\t//fmt.Println(funcA())\\n39| \\t//fmt.Println(funcB())\\n40| \\t//fmt.Println(funcC())\\n41| \\tfmt.Println(funcD())\\n42| }\\n43| \\n```\\n\\n```\\n27| \\treturn x\\n28| }\\n29| \\n30| func funcD() (x int) {\\n31| \\tdefer func(x int) {\\n32| \\t\\tx += 1\\n33| \\t}(x)\\n34| \\treturn 5\\n35| }\\n36| \\n37| \\t//fmt.Println(funcA())\\n38| \\t//fmt.Println(funcA())\\n39| \\t//fmt.Println(funcB())\\n40| \\t//fmt.Println(funcC())\\n41| \\tfmt.Println(funcD())\\n42| }\\n43| \\n```\\n\\n```\\n28| }\\n29| \\n30| func funcD() (x int) {\\n31| \\tdefer func(x int) {\\n32| \\t\\tx += 1\\n33| \\t}(x)\\n34| \\treturn 5\\n35| }\\n36| \\n37| func main() {\\n38| \\t//fmt.Println(funcB())\\n39| \\t//fmt.Println(funcB())\\n40| \\t//fmt.Println(funcC())\\n41| \\tfmt.Println(funcD())\\n42| }\\n43| \\n```\\n\\n```\\n29| \\n30| func funcD() (x int) {\\n31| \\tdefer func(x int) {\\n32| \\t\\tx += 1\\n33| \\t}(x)\\n34| \\treturn 5\\n35| }\\n36| \\n37| func main() {\\n38| \\t//fmt.Println(funcA())\\n39| \\t//fmt.Println(funcC())\\n40| \\t//fmt.Println(funcC())\\n41| \\tfmt.Println(funcD())\\n42| }\\n43| \\n```\\n\\n```\\n30| func funcD() (x int) {\\n31| \\tdefer func(x int) {\\n32| \\t\\tx += 1\\n33| \\t}(x)\\n34| \\treturn 5\\n35| }\\n36| \\n37| func main() {\\n38| \\t//fmt.Println(funcA())\\n39| \\t//fmt.Println(funcB())\\n40| \\tfmt.Println(funcD())\\n41| \\tfmt.Println(funcD())\\n42| }\\n43| \\n```\\n\\n```\\n1| package main\\n2| \\n3| import (\\n4| \\t\\\"fmt\\\"\\n5| )\\n6| func funcA() int {\\n7| func funcA() int {\\n8| \\tx := 5\\n9| \\tdefer func() {\\n10| \\t\\tx += 1\\n11| \\t}()\\n12| \\treturn x\\n13| }\\n14| \\n15| func funcB() (x int) {\\n16| \\tdefer func() {\\n```\\n\\n```\\n1| package main\\n2| \\n3| import (\\n4| \\t\\\"fmt\\\"\\n5| )\\n6| \\n7| func funcA() int {\\n8| \\tdefer func() {\\n9| \\tdefer func() {\\n10| \\t\\tx += 1\\n11| \\t}()\\n12| \\treturn x\\n13| }\\n14| \\n15| func funcB() (x int) {\\n16| \\tdefer func() {\\n17| \\t\\tx += 1\\n18| \\t}()\\n```\\n\\n```\\n0| package main\\n1| package main\\n2| \\n3| import (\\n4| \\t\\\"fmt\\\"\\n5| )\\n6| \\n7| func funcA() int {\\n8| \\tx := 5\\n9| \\tdefer func() {\\n10| \\t\\tx += 1\\n```\\n\\n```\\n4| \\t\\\"fmt\\\"\\n5| )\\n6| \\n7| func funcA() int {\\n8| \\tx := 5\\n9| \\tdefer func() {\\n10| \\t\\tx += 1\\n11| \\t}()\\n12| \\treturn x\\n13| }\\n14| func funcB() (x int) {\\n15| func funcB() (x int) {\\n16| \\tdefer func() {\\n17| \\t\\tx += 1\\n18| \\t}()\\n19| \\treturn 5\\n20| }\\n21| \\n22| func funcC() (y int) {\\n23| \\tx := 5\\n24| \\tdefer func() {\\n```\\n\\n```\\n5| )\\n6| \\n7| func funcA() int {\\n8| \\tx := 5\\n9| \\tdefer func() {\\n10| \\t\\tx += 1\\n11| \\t}()\\n12| \\treturn x\\n13| }\\n14| \\n15| \\tdefer func() {\\n16| \\tdefer func() {\\n17| \\t\\tx += 1\\n18| \\t}()\\n19| \\treturn 5\\n20| }\\n21| \\n22| func funcC() (y int) {\\n23| \\tx := 5\\n24| \\tdefer func() {\\n25| \\t\\tx += 1\\n```\\n\\n```\\n11| \\t}()\\n12| \\treturn x\\n13| }\\n14| \\n15| func funcB() (x int) {\\n16| \\tdefer func() {\\n17| \\t\\tx += 1\\n18| \\t}()\\n19| \\treturn 5\\n20| }\\n21| func funcC() (y int) {\\n22| func funcC() (y int) {\\n23| \\tx := 5\\n24| \\tdefer func() {\\n25| \\t\\tx += 1\\n26| \\t}()\\n27| \\treturn x\\n28| }\\n29| \\n30| func funcD() (x int) {\\n31| \\tdefer func(x int) {\\n```\\n\\n```\\n13| }\\n14| \\n15| func funcB() (x int) {\\n16| \\tdefer func() {\\n17| \\t\\tx += 1\\n18| \\t}()\\n19| \\treturn 5\\n20| }\\n21| \\n22| func funcC() (y int) {\\n23| \\tdefer func() {\\n24| \\tdefer func() {\\n25| \\t\\tx += 1\\n26| \\t}()\\n27| \\treturn x\\n28| }\\n29| \\n30| func funcD() (x int) {\\n31| \\tdefer func(x int) {\\n32| \\t\\tx += 1\\n33| \\t}(x)\\n```\\n\\n```\\n19| \\treturn 5\\n20| }\\n21| \\n22| func funcC() (y int) {\\n23| \\tx := 5\\n24| \\tdefer func() {\\n25| \\t\\tx += 1\\n26| \\t}()\\n27| \\treturn x\\n28| }\\n29| func funcD() (x int) {\\n30| func funcD() (x int) {\\n31| \\tdefer func(x int) {\\n32| \\t\\tx += 1\\n33| \\t}(x)\\n34| \\treturn 5\\n35| }\\n36| \\n37| func main() {\\n38| \\t//fmt.Println(funcA())\\n39| \\t//fmt.Println(funcB())\\n```\\n\\n```\\n20| }\\n21| \\n22| func funcC() (y int) {\\n23| \\tx := 5\\n24| \\tdefer func() {\\n25| \\t\\tx += 1\\n26| \\t}()\\n27| \\treturn x\\n28| }\\n29| \\n30| \\tdefer func(x int) {\\n31| \\tdefer func(x int) {\\n32| \\t\\tx += 1\\n33| \\t}(x)\\n34| \\treturn 5\\n35| }\\n36| \\n37| func main() {\\n38| \\t//fmt.Println(funcA())\\n39| \\t//fmt.Println(funcB())\\n40| \\t//fmt.Println(funcC())\\n```\\n\\n## Result 4: github.com/Zhouchaowen/golang-tutorial/12-library/8-error/ch_1/main.go\\n\\nURL: /github.com/Zhouchaowen/golang-tutorial/-/blob/12-library/8-error/ch_1/main.go\\n\\n```\\n5| \\t\\\"fmt\\\"\\n6| )\\n7| \\n8| func func1() error {\\n9| \\treturn errors.New(\\\"func1 error\\\")\\n10| }\\n11| \\n12| func func2() error {\\n13| \\treturn fmt.Errorf(\\\"func2 error: %w\\\", func1())\\n14| }\\n15| func main() {\\n16| func main() {\\n17| \\terr := func2()\\n18| \\tif err != nil {\\n19| \\t\\tfmt.Println(err)\\n20| \\t}\\n21| }\\n22| \\n```\\n\\n\",\"type\":\"text\"}],\"type\":\"tool_result\"}],\"role\":\"user\"}],\"model\":\"claude-sonnet-4-5-20250929\",\"system\":[{\"text\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\u003cmemory_instructions\\u003e\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\u003c/memory_instructions\\u003e\\n\\u003ccommunication_style\\u003e\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\u003cexample\\u003e\\nuser: 2 + 2\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what is 2+2?\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: is 11 a prime number?\\nassistant: true\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\u003c/example\\u003e\\n\\u003c/communication_style\\u003e\\n\\n\\u003cproactiveness\\u003e\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\u003c/proactiveness\\u003e\\n\\n\\u003cfollowing_conversations\\u003e\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\u003c/following_conversations\\u003e\\n\\n\\u003ccode_style\\u003e\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\u003c/code_style\\u003e\\n\\n\\u003cdoing_tasks\\u003e\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\u003c/doing_tasks\\u003e\\n\\n\\u003ctool_use\\u003e\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\u003c/tool_use\\u003e\\n\\n\\u003cenv\\u003e\\nWorking directory: /tmp/crush-test/TestCoderAgent/anthropic-sonnet/sourcegraph_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\u003c/env\\u003e\\n\\u003cmemory\\u003e\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\u003c/memory\\u003e\\n\\n\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"tool_choice\":{\"disable_parallel_tool_use\":false,\"type\":\"auto\"},\"tools\":[{\"input_schema\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"},\"name\":\"bash\",\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\u003ccross_platform\\u003e\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\u003c/cross_platform\\u003e\\n\\n\\u003cexecution_steps\\u003e\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with \\u003ccwd\\u003e\\u003c/cwd\\u003e tags\\n\\u003c/execution_steps\\u003e\\n\\n\\u003cusage_notes\\u003e\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '\\u0026\\u0026', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\u003c/usage_notes\\u003e\\n\\n\\u003cgit_commits\\u003e\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in \\u003ccommit_analysis\\u003e tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\u003ccrush@charm.land\\u003e\\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\u003c/git_commits\\u003e\\n\\n\\u003cpull_requests\\u003e\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in \\u003cpr_analysis\\u003e tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n\\n ## Summary\\n\\n \\u0026lt;1-3 bullet points\\u003e\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\u003c/pull_requests\\u003e\\n\\n\\u003cexamples\\u003e\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar \\u0026\\u0026 pytest tests\\n\\u003c/examples\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"},\"name\":\"download\",\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\u003cusage\\u003e\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"},\"name\":\"edit\",\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\u003c/parameters\\u003e\\n\\n\\u003cspecial_cases\\u003e\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\u003c/special_cases\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\u003c/best_practices\\u003e\\n\\n\\u003cwindows_notes\\u003e\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\u003c/windows_notes\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"},\"name\":\"multiedit\",\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\u003c/parameters\\u003e\\n\\n\\u003coperation\\u003e\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\u003c/operation\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\u003c/best_practices\\u003e\\n\\n\\u003cnew_file_creation\\u003e\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\u003c/new_file_creation\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"},\"name\":\"fetch\",\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\u003cusage\\u003e\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"glob\",\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cpattern_syntax\\u003e\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\u003c/pattern_syntax\\u003e\\n\\n\\u003cexamples\\u003e\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\u003c/examples\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"grep\",\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cregex_syntax\\u003e\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\u003c/regex_syntax\\u003e\\n\\n\\u003cinclude_patterns\\u003e\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\u003c/include_patterns\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003cignore_support\\u003e\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\u003c/ignore_support\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"name\":\"ls\",\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\u003cusage\\u003e\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"},\"name\":\"sourcegraph\",\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\u003cusage\\u003e\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cbasic_syntax\\u003e\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\u003c/basic_syntax\\u003e\\n\\n\\u003ckey_filters\\u003e\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\u003c/key_filters\\u003e\\n\\n\\u003cexamples\\u003e\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\u003c/examples\\u003e\\n\\n\\u003cboolean_operators\\u003e\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\u003c/boolean_operators\\u003e\\n\\n\\u003climitations\\u003e\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"},\"name\":\"view\",\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\u003cusage\\u003e\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines \\u003e2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"},\"name\":\"write\",\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\u003cusage\\u003e\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\u003c/tips\\u003e\\n\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"stream\":true}" headers: Accept: - application/json @@ -180,86 +195,44 @@ interactions: content_length: -1 body: |+ event: message_start - data: {"type":"message_start","message":{"id":"msg_01UU9P4euaxqULuxSvnxHxqt","type":"message","role":"assistant","model":"claude-sonnet-4-5-20250929","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":4,"cache_creation_input_tokens":3597,"cache_read_input_tokens":8661,"cache_creation":{"ephemeral_5m_input_tokens":3597,"ephemeral_1h_input_tokens":0},"output_tokens":2,"service_tier":"standard"}}} + data: {"type":"message_start","message":{"id":"msg_01X2nMr4XeKPLcwoBpo2Y5ZT","type":"message","role":"assistant","model":"claude-sonnet-4-5-20250929","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":4,"cache_creation_input_tokens":3597,"cache_read_input_tokens":8681,"cache_creation":{"ephemeral_5m_input_tokens":3597,"ephemeral_1h_input_tokens":0},"output_tokens":2,"service_tier":"standard"}} } event: content_block_start - data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } + data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"\n\nFoun"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"\n\nFoun"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"d 30 matches for `func main` in Go"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"d 30 matches for `func main` in Go repositories."} } event: ping data: {"type": "ping"} event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" repositories. Here's a"} } - - event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" sample:\n\n1"} } - - event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":". **github.com/yan"} } - - event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"feizhang/go-training"} } - - event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"** - Stack growth"} } - - event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" example with main calling helper functions\n2. **github.com"} } - - event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"/GolangUA/go-training** - Function example"} } - - event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" showing type error"} } - - event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" in hello function\n3. **github.com"} } - - event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"/pingguoxueyuan/"} } - - event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"gostudy** - Defer behavior"} } - - event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" testing with multiple functions\n4. **github.com/"} } - - event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Zhouchaowen/golang-"} } - - event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"tutorial** - Error handling example with wrappe"} } - - event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"d errors\n\nThe search hit the result limit (30 matches)."}} + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Results include training repos demonstrating stack growth, defer statements"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" Use more specific filters like `"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":", error handling, and basic Go program"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"repo:` or file path"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" structure. All show typical `func"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" patterns to narrow results."} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" main()` entry point patterns in Go."} } event: content_block_stop - data: {"type":"content_block_stop","index":0 } + data: {"type":"content_block_stop","index":0 } event: message_delta - data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":4,"cache_creation_input_tokens":3597,"cache_read_input_tokens":8661,"output_tokens":157} } + data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":4,"cache_creation_input_tokens":3597,"cache_read_input_tokens":8681,"output_tokens":53}} event: message_stop - data: {"type":"message_stop" } + data: {"type":"message_stop" } headers: Content-Type: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 2.127060875s + duration: 2.452323417s diff --git a/internal/agent/testdata/TestCoderAgent/anthropic-sonnet/update_a_file.yaml b/internal/agent/testdata/TestCoderAgent/anthropic-sonnet/update_a_file.yaml index 8b429418977bd23de7f0d8e951c2a06f280a1fc8..367e54473fc030b3c6e5a3b991cc73c4576c4664 100644 --- a/internal/agent/testdata/TestCoderAgent/anthropic-sonnet/update_a_file.yaml +++ b/internal/agent/testdata/TestCoderAgent/anthropic-sonnet/update_a_file.yaml @@ -25,28 +25,25 @@ interactions: content_length: -1 body: |+ event: message_start - data: {"type":"message_start","message":{"id":"msg_012U5SVc7ycGJ6g6CTYwMrtc","type":"message","role":"assistant","model":"claude-3-5-haiku-20241022","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":122,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard"}} } + data: {"type":"message_start","message":{"id":"msg_017ojmccd78pbpdMdsMBsi1Q","type":"message","role":"assistant","model":"claude-3-5-haiku-20241022","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":122,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":2,"service_tier":"standard"}} } event: content_block_start - data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } + data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}} event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Update"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Update main"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" main"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":".go print"} } event: ping data: {"type": "ping"} event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":".go hello"} } - - event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" print"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" statement"} } event: content_block_stop - data: {"type":"content_block_stop","index":0 } + data: {"type":"content_block_stop","index":0 } event: message_delta data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":122,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":9} } @@ -59,15 +56,15 @@ interactions: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 682.118125ms + duration: 645.703916ms - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 31968 + content_length: 32041 host: "" - body: "{\"max_tokens\":10000,\"messages\":[{\"content\":[{\"text\":\"update the main.go file by changing the print to say hello from crush\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"role\":\"user\"}],\"model\":\"claude-sonnet-4-5-20250929\",\"system\":[{\"text\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\u003cmemory_instructions\\u003e\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\u003c/memory_instructions\\u003e\\n\\u003ccommunication_style\\u003e\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\u003cexample\\u003e\\nuser: 2 + 2\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what is 2+2?\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: is 11 a prime number?\\nassistant: true\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\u003c/example\\u003e\\n\\u003c/communication_style\\u003e\\n\\n\\u003cproactiveness\\u003e\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\u003c/proactiveness\\u003e\\n\\n\\u003cfollowing_conversations\\u003e\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\u003c/following_conversations\\u003e\\n\\n\\u003ccode_style\\u003e\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\u003c/code_style\\u003e\\n\\n\\u003cdoing_tasks\\u003e\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\u003c/doing_tasks\\u003e\\n\\n\\u003ctool_use\\u003e\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\u003c/tool_use\\u003e\\n\\n\\u003cenv\\u003e\\nWorking directory: /tmp/crush-test/TestCoderAgent/anthropic-sonnet/update_a_file\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\u003c/env\\u003e\\n\\u003cmemory\\u003e\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\u003c/memory\\u003e\\n\\n\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"tool_choice\":{\"disable_parallel_tool_use\":false,\"type\":\"auto\"},\"tools\":[{\"input_schema\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"},\"name\":\"bash\",\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\u003ccross_platform\\u003e\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\u003c/cross_platform\\u003e\\n\\n\\u003cexecution_steps\\u003e\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with \\u003ccwd\\u003e\\u003c/cwd\\u003e tags\\n\\u003c/execution_steps\\u003e\\n\\n\\u003cusage_notes\\u003e\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '\\u0026\\u0026', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\u003c/usage_notes\\u003e\\n\\n\\u003cgit_commits\\u003e\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in \\u003ccommit_analysis\\u003e tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\u003ccrush@charm.land\\u003e\\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\u003c/git_commits\\u003e\\n\\n\\u003cpull_requests\\u003e\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in \\u003cpr_analysis\\u003e tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n\\n ## Summary\\n\\n \\u0026lt;1-3 bullet points\\u003e\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\u003c/pull_requests\\u003e\\n\\n\\u003cexamples\\u003e\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar \\u0026\\u0026 pytest tests\\n\\u003c/examples\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"},\"name\":\"download\",\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\u003cusage\\u003e\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"},\"name\":\"edit\",\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\u003c/parameters\\u003e\\n\\n\\u003cspecial_cases\\u003e\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\u003c/special_cases\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\u003c/best_practices\\u003e\\n\\n\\u003cwindows_notes\\u003e\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\u003c/windows_notes\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"},\"name\":\"multiedit\",\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\u003c/parameters\\u003e\\n\\n\\u003coperation\\u003e\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\u003c/operation\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\u003c/best_practices\\u003e\\n\\n\\u003cnew_file_creation\\u003e\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\u003c/new_file_creation\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"},\"name\":\"fetch\",\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\u003cusage\\u003e\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"glob\",\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cpattern_syntax\\u003e\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\u003c/pattern_syntax\\u003e\\n\\n\\u003cexamples\\u003e\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\u003c/examples\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"grep\",\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cregex_syntax\\u003e\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\u003c/regex_syntax\\u003e\\n\\n\\u003cinclude_patterns\\u003e\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\u003c/include_patterns\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003cignore_support\\u003e\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\u003c/ignore_support\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"name\":\"ls\",\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\u003cusage\\u003e\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"},\"name\":\"sourcegraph\",\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\u003cusage\\u003e\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cbasic_syntax\\u003e\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\u003c/basic_syntax\\u003e\\n\\n\\u003ckey_filters\\u003e\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\u003c/key_filters\\u003e\\n\\n\\u003cexamples\\u003e\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\u003c/examples\\u003e\\n\\n\\u003cboolean_operators\\u003e\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\u003c/boolean_operators\\u003e\\n\\n\\u003climitations\\u003e\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"},\"name\":\"view\",\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\u003cusage\\u003e\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines \\u003e2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"},\"name\":\"write\",\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\u003cusage\\u003e\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\u003c/tips\\u003e\\n\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"stream\":true}" + body: "{\"max_tokens\":10000,\"messages\":[{\"content\":[{\"text\":\"update the main.go file by changing the print to say hello from crush\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"role\":\"user\"}],\"model\":\"claude-sonnet-4-5-20250929\",\"system\":[{\"text\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\u003cmemory_instructions\\u003e\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\u003c/memory_instructions\\u003e\\n\\u003ccommunication_style\\u003e\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\u003cexample\\u003e\\nuser: 2 + 2\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what is 2+2?\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: is 11 a prime number?\\nassistant: true\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\u003c/example\\u003e\\n\\u003c/communication_style\\u003e\\n\\n\\u003cproactiveness\\u003e\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\u003c/proactiveness\\u003e\\n\\n\\u003cfollowing_conversations\\u003e\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\u003c/following_conversations\\u003e\\n\\n\\u003ccode_style\\u003e\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\u003c/code_style\\u003e\\n\\n\\u003cdoing_tasks\\u003e\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\u003c/doing_tasks\\u003e\\n\\n\\u003ctool_use\\u003e\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\u003c/tool_use\\u003e\\n\\n\\u003cenv\\u003e\\nWorking directory: /tmp/crush-test/TestCoderAgent/anthropic-sonnet/update_a_file\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\u003c/env\\u003e\\n\\u003cmemory\\u003e\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\u003c/memory\\u003e\\n\\n\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"tool_choice\":{\"disable_parallel_tool_use\":false,\"type\":\"auto\"},\"tools\":[{\"input_schema\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"},\"name\":\"bash\",\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\u003ccross_platform\\u003e\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\u003c/cross_platform\\u003e\\n\\n\\u003cexecution_steps\\u003e\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with \\u003ccwd\\u003e\\u003c/cwd\\u003e tags\\n\\u003c/execution_steps\\u003e\\n\\n\\u003cusage_notes\\u003e\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '\\u0026\\u0026', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\u003c/usage_notes\\u003e\\n\\n\\u003cgit_commits\\u003e\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in \\u003ccommit_analysis\\u003e tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\u003ccrush@charm.land\\u003e\\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\u003c/git_commits\\u003e\\n\\n\\u003cpull_requests\\u003e\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in \\u003cpr_analysis\\u003e tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n\\n ## Summary\\n\\n \\u0026lt;1-3 bullet points\\u003e\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\u003c/pull_requests\\u003e\\n\\n\\u003cexamples\\u003e\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar \\u0026\\u0026 pytest tests\\n\\u003c/examples\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"},\"name\":\"download\",\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\u003cusage\\u003e\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"},\"name\":\"edit\",\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\u003c/parameters\\u003e\\n\\n\\u003cspecial_cases\\u003e\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\u003c/special_cases\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\u003c/best_practices\\u003e\\n\\n\\u003cwindows_notes\\u003e\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\u003c/windows_notes\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"},\"name\":\"multiedit\",\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\u003c/parameters\\u003e\\n\\n\\u003coperation\\u003e\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\u003c/operation\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\u003c/best_practices\\u003e\\n\\n\\u003cnew_file_creation\\u003e\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\u003c/new_file_creation\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"},\"name\":\"fetch\",\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\u003cusage\\u003e\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"glob\",\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cpattern_syntax\\u003e\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\u003c/pattern_syntax\\u003e\\n\\n\\u003cexamples\\u003e\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\u003c/examples\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"grep\",\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cregex_syntax\\u003e\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\u003c/regex_syntax\\u003e\\n\\n\\u003cinclude_patterns\\u003e\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\u003c/include_patterns\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003cignore_support\\u003e\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\u003c/ignore_support\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"name\":\"ls\",\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\u003cusage\\u003e\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"},\"name\":\"sourcegraph\",\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\u003cusage\\u003e\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cbasic_syntax\\u003e\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\u003c/basic_syntax\\u003e\\n\\n\\u003ckey_filters\\u003e\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\u003c/key_filters\\u003e\\n\\n\\u003cexamples\\u003e\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\u003c/examples\\u003e\\n\\n\\u003cboolean_operators\\u003e\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\u003c/boolean_operators\\u003e\\n\\n\\u003climitations\\u003e\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"},\"name\":\"view\",\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\u003cusage\\u003e\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines \\u003e2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"},\"name\":\"write\",\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\u003cusage\\u003e\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\u003c/tips\\u003e\\n\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"stream\":true}" headers: Accept: - application/json @@ -84,73 +81,64 @@ interactions: content_length: -1 body: |+ event: message_start - data: {"type":"message_start","message":{"id":"msg_01Ppqu1XxcbcN7ccJZcGA6RE","type":"message","role":"assistant","model":"claude-sonnet-4-5-20250929","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":3,"cache_creation_input_tokens":1777,"cache_read_input_tokens":6884,"cache_creation":{"ephemeral_5m_input_tokens":1777,"ephemeral_1h_input_tokens":0},"output_tokens":8,"service_tier":"standard"}}} + data: {"type":"message_start","message":{"id":"msg_01Jm1xcaqkDuSx6nZiSMyxzZ","type":"message","role":"assistant","model":"claude-sonnet-4-5-20250929","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":3,"cache_creation_input_tokens":1777,"cache_read_input_tokens":6904,"cache_creation":{"ephemeral_5m_input_tokens":1777,"ephemeral_1h_input_tokens":0},"output_tokens":8,"service_tier":"standard"}} } event: content_block_start - data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } + data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"I'll help you update the main."} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"I'll help you update the main."} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"go file. Let me first view"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"go file. Let me first view"} } event: ping data: {"type": "ping"} event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" the current content of the file."} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" the current content of the file."} } event: content_block_stop - data: {"type":"content_block_stop","index":0 } + data: {"type":"content_block_stop","index":0 } event: content_block_start - data: {"type":"content_block_start","index":1,"content_block":{"type":"tool_use","id":"toolu_01A383hxoERkBJvjzgwHK3Q2","name":"view","input":{}} } - - event: content_block_delta - data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":""} } - - event: content_block_delta - data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"{\"file"} } - - event: content_block_delta - data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"_pa"}} + data: {"type":"content_block_start","index":1,"content_block":{"type":"tool_use","id":"toolu_0188zsoGVUTRpdHfDC945Wdo","name":"view","input":{}} } event: content_block_delta - data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"th"} } + data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":""} } event: content_block_delta - data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"\": \"m"} } + data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"{\"file_path\""} } event: content_block_delta - data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":"ain"} } + data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":": \"main"} } event: content_block_delta - data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":".go\"}"} } + data: {"type":"content_block_delta","index":1,"delta":{"type":"input_json_delta","partial_json":".go\"}"} } event: content_block_stop - data: {"type":"content_block_stop","index":1 } + data: {"type":"content_block_stop","index":1 } event: message_delta - data: {"type":"message_delta","delta":{"stop_reason":"tool_use","stop_sequence":null},"usage":{"input_tokens":3,"cache_creation_input_tokens":1777,"cache_read_input_tokens":6884,"output_tokens":78} } + data: {"type":"message_delta","delta":{"stop_reason":"tool_use","stop_sequence":null},"usage":{"input_tokens":3,"cache_creation_input_tokens":1777,"cache_read_input_tokens":6904,"output_tokens":78} } event: message_stop - data: {"type":"message_stop"} + data: {"type":"message_stop" } headers: Content-Type: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 2.217208375s + duration: 2.428231625s - id: 2 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 32565 + content_length: 32638 host: "" - body: "{\"max_tokens\":10000,\"messages\":[{\"content\":[{\"text\":\"update the main.go file by changing the print to say hello from crush\",\"type\":\"text\"}],\"role\":\"user\"},{\"content\":[{\"text\":\"I'll help you update the main.go file. Let me first view the current content of the file.\",\"type\":\"text\"},{\"id\":\"toolu_01A383hxoERkBJvjzgwHK3Q2\",\"input\":{\"file_path\":\"main.go\"},\"name\":\"view\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"tool_use\"}],\"role\":\"assistant\"},{\"content\":[{\"tool_use_id\":\"toolu_01A383hxoERkBJvjzgwHK3Q2\",\"cache_control\":{\"type\":\"ephemeral\"},\"content\":[{\"text\":\"\\u003cfile\\u003e\\n 1|package main\\n 2|\\n 3|import \\\"fmt\\\"\\n 4|\\n 5|func main() {\\n 6|\\tfmt.Println(\\\"Hello, World!\\\")\\n 7|}\\n\\u003c/file\\u003e\\n\",\"type\":\"text\"}],\"type\":\"tool_result\"}],\"role\":\"user\"}],\"model\":\"claude-sonnet-4-5-20250929\",\"system\":[{\"text\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\u003cmemory_instructions\\u003e\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\u003c/memory_instructions\\u003e\\n\\u003ccommunication_style\\u003e\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\u003cexample\\u003e\\nuser: 2 + 2\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what is 2+2?\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: is 11 a prime number?\\nassistant: true\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\u003c/example\\u003e\\n\\u003c/communication_style\\u003e\\n\\n\\u003cproactiveness\\u003e\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\u003c/proactiveness\\u003e\\n\\n\\u003cfollowing_conversations\\u003e\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\u003c/following_conversations\\u003e\\n\\n\\u003ccode_style\\u003e\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\u003c/code_style\\u003e\\n\\n\\u003cdoing_tasks\\u003e\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\u003c/doing_tasks\\u003e\\n\\n\\u003ctool_use\\u003e\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\u003c/tool_use\\u003e\\n\\n\\u003cenv\\u003e\\nWorking directory: /tmp/crush-test/TestCoderAgent/anthropic-sonnet/update_a_file\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\u003c/env\\u003e\\n\\u003cmemory\\u003e\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\u003c/memory\\u003e\\n\\n\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"tool_choice\":{\"disable_parallel_tool_use\":false,\"type\":\"auto\"},\"tools\":[{\"input_schema\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"},\"name\":\"bash\",\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\u003ccross_platform\\u003e\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\u003c/cross_platform\\u003e\\n\\n\\u003cexecution_steps\\u003e\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with \\u003ccwd\\u003e\\u003c/cwd\\u003e tags\\n\\u003c/execution_steps\\u003e\\n\\n\\u003cusage_notes\\u003e\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '\\u0026\\u0026', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\u003c/usage_notes\\u003e\\n\\n\\u003cgit_commits\\u003e\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in \\u003ccommit_analysis\\u003e tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\u003ccrush@charm.land\\u003e\\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\u003c/git_commits\\u003e\\n\\n\\u003cpull_requests\\u003e\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in \\u003cpr_analysis\\u003e tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n\\n ## Summary\\n\\n \\u0026lt;1-3 bullet points\\u003e\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\u003c/pull_requests\\u003e\\n\\n\\u003cexamples\\u003e\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar \\u0026\\u0026 pytest tests\\n\\u003c/examples\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"},\"name\":\"download\",\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\u003cusage\\u003e\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"},\"name\":\"edit\",\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\u003c/parameters\\u003e\\n\\n\\u003cspecial_cases\\u003e\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\u003c/special_cases\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\u003c/best_practices\\u003e\\n\\n\\u003cwindows_notes\\u003e\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\u003c/windows_notes\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"},\"name\":\"multiedit\",\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\u003c/parameters\\u003e\\n\\n\\u003coperation\\u003e\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\u003c/operation\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\u003c/best_practices\\u003e\\n\\n\\u003cnew_file_creation\\u003e\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\u003c/new_file_creation\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"},\"name\":\"fetch\",\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\u003cusage\\u003e\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"glob\",\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cpattern_syntax\\u003e\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\u003c/pattern_syntax\\u003e\\n\\n\\u003cexamples\\u003e\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\u003c/examples\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"grep\",\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cregex_syntax\\u003e\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\u003c/regex_syntax\\u003e\\n\\n\\u003cinclude_patterns\\u003e\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\u003c/include_patterns\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003cignore_support\\u003e\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\u003c/ignore_support\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"name\":\"ls\",\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\u003cusage\\u003e\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"},\"name\":\"sourcegraph\",\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\u003cusage\\u003e\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cbasic_syntax\\u003e\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\u003c/basic_syntax\\u003e\\n\\n\\u003ckey_filters\\u003e\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\u003c/key_filters\\u003e\\n\\n\\u003cexamples\\u003e\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\u003c/examples\\u003e\\n\\n\\u003cboolean_operators\\u003e\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\u003c/boolean_operators\\u003e\\n\\n\\u003climitations\\u003e\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"},\"name\":\"view\",\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\u003cusage\\u003e\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines \\u003e2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"},\"name\":\"write\",\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\u003cusage\\u003e\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\u003c/tips\\u003e\\n\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"stream\":true}" + body: "{\"max_tokens\":10000,\"messages\":[{\"content\":[{\"text\":\"update the main.go file by changing the print to say hello from crush\",\"type\":\"text\"}],\"role\":\"user\"},{\"content\":[{\"text\":\"I'll help you update the main.go file. Let me first view the current content of the file.\",\"type\":\"text\"},{\"id\":\"toolu_0188zsoGVUTRpdHfDC945Wdo\",\"input\":{\"file_path\":\"main.go\"},\"name\":\"view\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"tool_use\"}],\"role\":\"assistant\"},{\"content\":[{\"tool_use_id\":\"toolu_0188zsoGVUTRpdHfDC945Wdo\",\"cache_control\":{\"type\":\"ephemeral\"},\"content\":[{\"text\":\"\\u003cfile\\u003e\\n 1|package main\\n 2|\\n 3|import \\\"fmt\\\"\\n 4|\\n 5|func main() {\\n 6|\\tfmt.Println(\\\"Hello, World!\\\")\\n 7|}\\n\\u003c/file\\u003e\\n\",\"type\":\"text\"}],\"type\":\"tool_result\"}],\"role\":\"user\"}],\"model\":\"claude-sonnet-4-5-20250929\",\"system\":[{\"text\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\u003cmemory_instructions\\u003e\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\u003c/memory_instructions\\u003e\\n\\u003ccommunication_style\\u003e\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\u003cexample\\u003e\\nuser: 2 + 2\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what is 2+2?\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: is 11 a prime number?\\nassistant: true\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\u003c/example\\u003e\\n\\u003c/communication_style\\u003e\\n\\n\\u003cproactiveness\\u003e\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\u003c/proactiveness\\u003e\\n\\n\\u003cfollowing_conversations\\u003e\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\u003c/following_conversations\\u003e\\n\\n\\u003ccode_style\\u003e\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\u003c/code_style\\u003e\\n\\n\\u003cdoing_tasks\\u003e\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\u003c/doing_tasks\\u003e\\n\\n\\u003ctool_use\\u003e\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\u003c/tool_use\\u003e\\n\\n\\u003cenv\\u003e\\nWorking directory: /tmp/crush-test/TestCoderAgent/anthropic-sonnet/update_a_file\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\u003c/env\\u003e\\n\\u003cmemory\\u003e\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\u003c/memory\\u003e\\n\\n\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"tool_choice\":{\"disable_parallel_tool_use\":false,\"type\":\"auto\"},\"tools\":[{\"input_schema\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"},\"name\":\"bash\",\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\u003ccross_platform\\u003e\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\u003c/cross_platform\\u003e\\n\\n\\u003cexecution_steps\\u003e\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with \\u003ccwd\\u003e\\u003c/cwd\\u003e tags\\n\\u003c/execution_steps\\u003e\\n\\n\\u003cusage_notes\\u003e\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '\\u0026\\u0026', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\u003c/usage_notes\\u003e\\n\\n\\u003cgit_commits\\u003e\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in \\u003ccommit_analysis\\u003e tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\u003ccrush@charm.land\\u003e\\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\u003c/git_commits\\u003e\\n\\n\\u003cpull_requests\\u003e\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in \\u003cpr_analysis\\u003e tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n\\n ## Summary\\n\\n \\u0026lt;1-3 bullet points\\u003e\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\u003c/pull_requests\\u003e\\n\\n\\u003cexamples\\u003e\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar \\u0026\\u0026 pytest tests\\n\\u003c/examples\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"},\"name\":\"download\",\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\u003cusage\\u003e\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"},\"name\":\"edit\",\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\u003c/parameters\\u003e\\n\\n\\u003cspecial_cases\\u003e\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\u003c/special_cases\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\u003c/best_practices\\u003e\\n\\n\\u003cwindows_notes\\u003e\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\u003c/windows_notes\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"},\"name\":\"multiedit\",\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\u003c/parameters\\u003e\\n\\n\\u003coperation\\u003e\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\u003c/operation\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\u003c/best_practices\\u003e\\n\\n\\u003cnew_file_creation\\u003e\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\u003c/new_file_creation\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"},\"name\":\"fetch\",\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\u003cusage\\u003e\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"glob\",\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cpattern_syntax\\u003e\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\u003c/pattern_syntax\\u003e\\n\\n\\u003cexamples\\u003e\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\u003c/examples\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"grep\",\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cregex_syntax\\u003e\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\u003c/regex_syntax\\u003e\\n\\n\\u003cinclude_patterns\\u003e\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\u003c/include_patterns\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003cignore_support\\u003e\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\u003c/ignore_support\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"name\":\"ls\",\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\u003cusage\\u003e\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"},\"name\":\"sourcegraph\",\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\u003cusage\\u003e\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cbasic_syntax\\u003e\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\u003c/basic_syntax\\u003e\\n\\n\\u003ckey_filters\\u003e\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\u003c/key_filters\\u003e\\n\\n\\u003cexamples\\u003e\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\u003c/examples\\u003e\\n\\n\\u003cboolean_operators\\u003e\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\u003c/boolean_operators\\u003e\\n\\n\\u003climitations\\u003e\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"},\"name\":\"view\",\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\u003cusage\\u003e\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines \\u003e2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"},\"name\":\"write\",\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\u003cusage\\u003e\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\u003c/tips\\u003e\\n\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"stream\":true}" headers: Accept: - application/json @@ -167,109 +155,118 @@ interactions: content_length: -1 body: |+ event: message_start - data: {"type":"message_start","message":{"id":"msg_01NrykuqeLAzkZbPnG2VtVtR","type":"message","role":"assistant","model":"claude-sonnet-4-5-20250929","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":4,"cache_creation_input_tokens":142,"cache_read_input_tokens":8661,"cache_creation":{"ephemeral_5m_input_tokens":142,"ephemeral_1h_input_tokens":0},"output_tokens":26,"service_tier":"standard"}} } + data: {"type":"message_start","message":{"id":"msg_015Pk76cAHmkCGpnrBmWsBX5","type":"message","role":"assistant","model":"claude-sonnet-4-5-20250929","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":4,"cache_creation_input_tokens":142,"cache_read_input_tokens":8681,"cache_creation":{"ephemeral_5m_input_tokens":142,"ephemeral_1h_input_tokens":0},"output_tokens":26,"service_tier":"standard"}} } event: content_block_start - data: {"type":"content_block_start","index":0,"content_block":{"type":"tool_use","id":"toolu_01SUqEQUVzFAbm9a1fjdGzut","name":"edit","input":{}} } + data: {"type":"content_block_start","index":0,"content_block":{"type":"tool_use","id":"toolu_01G2jr8EfH1EtHmmP4MNymNB","name":"edit","input":{}} } + + event: content_block_delta + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":""} } + + event: content_block_delta + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"{\"fi"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":""} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"le_pat"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"{\"file_p"}} + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"h\": \"main."} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"ath\": \"mai"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"go\""} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"n.go\""} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":", \"old_stri"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":", \"old"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"ng\""} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"_stri"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":": "} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"ng\": \"fun"}} + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"\"func main("} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"c main() "} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":") {\\n\\t"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"{\\n\\tfmt."} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"fmt.Pri"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"Pr"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"ntl"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"intln(\\\"He"}} + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"n(\\\""} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"llo"}} + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"Hello, World"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":", W"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"!\\\")\\n}"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"orld!\\\""}} + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"\""} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":")\\"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":", \"new_st"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"n}\""}} + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"ring\""} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":", \"new_strin"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":": "} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"g\": \""} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"\"func main"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"func mai"}} + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"() {\\"}} event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"n() {\\n"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"n\\t"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"\\tfmt.Prin"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"fmt.Print"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"tln(\\\"hello"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"ln(\\\"h"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":" from crus"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"ell"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"h\\\")\\"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"o f"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"n}\"}"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"rom c"} } + + event: content_block_delta + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"rush\\\")\\n}\"}"}} event: content_block_stop - data: {"type":"content_block_stop","index":0 } + data: {"type":"content_block_stop","index":0 } event: message_delta - data: {"type":"message_delta","delta":{"stop_reason":"tool_use","stop_sequence":null},"usage":{"input_tokens":4,"cache_creation_input_tokens":142,"cache_read_input_tokens":8661,"output_tokens":124} } + data: {"type":"message_delta","delta":{"stop_reason":"tool_use","stop_sequence":null},"usage":{"input_tokens":4,"cache_creation_input_tokens":142,"cache_read_input_tokens":8681,"output_tokens":124} } event: message_stop - data: {"type":"message_stop" } + data: {"type":"message_stop" } headers: Content-Type: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 2.34528125s + duration: 2.290297666s - id: 3 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 33111 + content_length: 33184 host: "" - body: "{\"max_tokens\":10000,\"messages\":[{\"content\":[{\"text\":\"update the main.go file by changing the print to say hello from crush\",\"type\":\"text\"}],\"role\":\"user\"},{\"content\":[{\"text\":\"I'll help you update the main.go file. Let me first view the current content of the file.\",\"type\":\"text\"},{\"id\":\"toolu_01A383hxoERkBJvjzgwHK3Q2\",\"input\":{\"file_path\":\"main.go\"},\"name\":\"view\",\"type\":\"tool_use\"}],\"role\":\"assistant\"},{\"content\":[{\"tool_use_id\":\"toolu_01A383hxoERkBJvjzgwHK3Q2\",\"content\":[{\"text\":\"\\u003cfile\\u003e\\n 1|package main\\n 2|\\n 3|import \\\"fmt\\\"\\n 4|\\n 5|func main() {\\n 6|\\tfmt.Println(\\\"Hello, World!\\\")\\n 7|}\\n\\u003c/file\\u003e\\n\",\"type\":\"text\"}],\"type\":\"tool_result\"}],\"role\":\"user\"},{\"content\":[{\"id\":\"toolu_01SUqEQUVzFAbm9a1fjdGzut\",\"input\":{\"file_path\":\"main.go\",\"new_string\":\"func main() {\\n\\tfmt.Println(\\\"hello from crush\\\")\\n}\",\"old_string\":\"func main() {\\n\\tfmt.Println(\\\"Hello, World!\\\")\\n}\"},\"name\":\"edit\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"tool_use\"}],\"role\":\"assistant\"},{\"content\":[{\"tool_use_id\":\"toolu_01SUqEQUVzFAbm9a1fjdGzut\",\"cache_control\":{\"type\":\"ephemeral\"},\"content\":[{\"text\":\"\\u003cresult\\u003e\\nContent replaced in file: /tmp/crush-test/TestCoderAgent/anthropic-sonnet/update_a_file/main.go\\n\\u003c/result\\u003e\\n\",\"type\":\"text\"}],\"type\":\"tool_result\"}],\"role\":\"user\"}],\"model\":\"claude-sonnet-4-5-20250929\",\"system\":[{\"text\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\u003cmemory_instructions\\u003e\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\u003c/memory_instructions\\u003e\\n\\u003ccommunication_style\\u003e\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\u003cexample\\u003e\\nuser: 2 + 2\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what is 2+2?\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: is 11 a prime number?\\nassistant: true\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\u003c/example\\u003e\\n\\u003c/communication_style\\u003e\\n\\n\\u003cproactiveness\\u003e\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\u003c/proactiveness\\u003e\\n\\n\\u003cfollowing_conversations\\u003e\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\u003c/following_conversations\\u003e\\n\\n\\u003ccode_style\\u003e\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\u003c/code_style\\u003e\\n\\n\\u003cdoing_tasks\\u003e\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\u003c/doing_tasks\\u003e\\n\\n\\u003ctool_use\\u003e\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\u003c/tool_use\\u003e\\n\\n\\u003cenv\\u003e\\nWorking directory: /tmp/crush-test/TestCoderAgent/anthropic-sonnet/update_a_file\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\u003c/env\\u003e\\n\\u003cmemory\\u003e\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\u003c/memory\\u003e\\n\\n\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"tool_choice\":{\"disable_parallel_tool_use\":false,\"type\":\"auto\"},\"tools\":[{\"input_schema\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"},\"name\":\"bash\",\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\u003ccross_platform\\u003e\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\u003c/cross_platform\\u003e\\n\\n\\u003cexecution_steps\\u003e\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with \\u003ccwd\\u003e\\u003c/cwd\\u003e tags\\n\\u003c/execution_steps\\u003e\\n\\n\\u003cusage_notes\\u003e\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '\\u0026\\u0026', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\u003c/usage_notes\\u003e\\n\\n\\u003cgit_commits\\u003e\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in \\u003ccommit_analysis\\u003e tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\u003ccrush@charm.land\\u003e\\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\u003c/git_commits\\u003e\\n\\n\\u003cpull_requests\\u003e\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in \\u003cpr_analysis\\u003e tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n\\n ## Summary\\n\\n \\u0026lt;1-3 bullet points\\u003e\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\u003c/pull_requests\\u003e\\n\\n\\u003cexamples\\u003e\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar \\u0026\\u0026 pytest tests\\n\\u003c/examples\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"},\"name\":\"download\",\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\u003cusage\\u003e\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"},\"name\":\"edit\",\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\u003c/parameters\\u003e\\n\\n\\u003cspecial_cases\\u003e\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\u003c/special_cases\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\u003c/best_practices\\u003e\\n\\n\\u003cwindows_notes\\u003e\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\u003c/windows_notes\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"},\"name\":\"multiedit\",\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\u003c/parameters\\u003e\\n\\n\\u003coperation\\u003e\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\u003c/operation\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\u003c/best_practices\\u003e\\n\\n\\u003cnew_file_creation\\u003e\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\u003c/new_file_creation\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"},\"name\":\"fetch\",\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\u003cusage\\u003e\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"glob\",\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cpattern_syntax\\u003e\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\u003c/pattern_syntax\\u003e\\n\\n\\u003cexamples\\u003e\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\u003c/examples\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"grep\",\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cregex_syntax\\u003e\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\u003c/regex_syntax\\u003e\\n\\n\\u003cinclude_patterns\\u003e\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\u003c/include_patterns\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003cignore_support\\u003e\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\u003c/ignore_support\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"name\":\"ls\",\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\u003cusage\\u003e\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"},\"name\":\"sourcegraph\",\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\u003cusage\\u003e\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cbasic_syntax\\u003e\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\u003c/basic_syntax\\u003e\\n\\n\\u003ckey_filters\\u003e\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\u003c/key_filters\\u003e\\n\\n\\u003cexamples\\u003e\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\u003c/examples\\u003e\\n\\n\\u003cboolean_operators\\u003e\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\u003c/boolean_operators\\u003e\\n\\n\\u003climitations\\u003e\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"},\"name\":\"view\",\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\u003cusage\\u003e\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines \\u003e2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"},\"name\":\"write\",\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\u003cusage\\u003e\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\u003c/tips\\u003e\\n\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"stream\":true}" + body: "{\"max_tokens\":10000,\"messages\":[{\"content\":[{\"text\":\"update the main.go file by changing the print to say hello from crush\",\"type\":\"text\"}],\"role\":\"user\"},{\"content\":[{\"text\":\"I'll help you update the main.go file. Let me first view the current content of the file.\",\"type\":\"text\"},{\"id\":\"toolu_0188zsoGVUTRpdHfDC945Wdo\",\"input\":{\"file_path\":\"main.go\"},\"name\":\"view\",\"type\":\"tool_use\"}],\"role\":\"assistant\"},{\"content\":[{\"tool_use_id\":\"toolu_0188zsoGVUTRpdHfDC945Wdo\",\"content\":[{\"text\":\"\\u003cfile\\u003e\\n 1|package main\\n 2|\\n 3|import \\\"fmt\\\"\\n 4|\\n 5|func main() {\\n 6|\\tfmt.Println(\\\"Hello, World!\\\")\\n 7|}\\n\\u003c/file\\u003e\\n\",\"type\":\"text\"}],\"type\":\"tool_result\"}],\"role\":\"user\"},{\"content\":[{\"id\":\"toolu_01G2jr8EfH1EtHmmP4MNymNB\",\"input\":{\"file_path\":\"main.go\",\"new_string\":\"func main() {\\n\\tfmt.Println(\\\"hello from crush\\\")\\n}\",\"old_string\":\"func main() {\\n\\tfmt.Println(\\\"Hello, World!\\\")\\n}\"},\"name\":\"edit\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"tool_use\"}],\"role\":\"assistant\"},{\"content\":[{\"tool_use_id\":\"toolu_01G2jr8EfH1EtHmmP4MNymNB\",\"cache_control\":{\"type\":\"ephemeral\"},\"content\":[{\"text\":\"\\u003cresult\\u003e\\nContent replaced in file: /tmp/crush-test/TestCoderAgent/anthropic-sonnet/update_a_file/main.go\\n\\u003c/result\\u003e\\n\",\"type\":\"text\"}],\"type\":\"tool_result\"}],\"role\":\"user\"}],\"model\":\"claude-sonnet-4-5-20250929\",\"system\":[{\"text\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\u003cmemory_instructions\\u003e\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\u003c/memory_instructions\\u003e\\n\\u003ccommunication_style\\u003e\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\u003cexample\\u003e\\nuser: 2 + 2\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what is 2+2?\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: is 11 a prime number?\\nassistant: true\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\u003c/example\\u003e\\n\\u003c/communication_style\\u003e\\n\\n\\u003cproactiveness\\u003e\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\u003c/proactiveness\\u003e\\n\\n\\u003cfollowing_conversations\\u003e\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\u003c/following_conversations\\u003e\\n\\n\\u003ccode_style\\u003e\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\u003c/code_style\\u003e\\n\\n\\u003cdoing_tasks\\u003e\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\u003c/doing_tasks\\u003e\\n\\n\\u003ctool_use\\u003e\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\u003c/tool_use\\u003e\\n\\n\\u003cenv\\u003e\\nWorking directory: /tmp/crush-test/TestCoderAgent/anthropic-sonnet/update_a_file\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\u003c/env\\u003e\\n\\u003cmemory\\u003e\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\u003c/memory\\u003e\\n\\n\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"tool_choice\":{\"disable_parallel_tool_use\":false,\"type\":\"auto\"},\"tools\":[{\"input_schema\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"},\"name\":\"bash\",\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\u003ccross_platform\\u003e\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\u003c/cross_platform\\u003e\\n\\n\\u003cexecution_steps\\u003e\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with \\u003ccwd\\u003e\\u003c/cwd\\u003e tags\\n\\u003c/execution_steps\\u003e\\n\\n\\u003cusage_notes\\u003e\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '\\u0026\\u0026', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\u003c/usage_notes\\u003e\\n\\n\\u003cgit_commits\\u003e\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in \\u003ccommit_analysis\\u003e tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\u003ccrush@charm.land\\u003e\\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\u003c/git_commits\\u003e\\n\\n\\u003cpull_requests\\u003e\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in \\u003cpr_analysis\\u003e tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n\\n ## Summary\\n\\n \\u0026lt;1-3 bullet points\\u003e\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\u003c/pull_requests\\u003e\\n\\n\\u003cexamples\\u003e\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar \\u0026\\u0026 pytest tests\\n\\u003c/examples\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"},\"name\":\"download\",\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\u003cusage\\u003e\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"},\"name\":\"edit\",\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\u003c/parameters\\u003e\\n\\n\\u003cspecial_cases\\u003e\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\u003c/special_cases\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\u003c/best_practices\\u003e\\n\\n\\u003cwindows_notes\\u003e\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\u003c/windows_notes\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"},\"name\":\"multiedit\",\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\u003c/parameters\\u003e\\n\\n\\u003coperation\\u003e\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\u003c/operation\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\u003c/best_practices\\u003e\\n\\n\\u003cnew_file_creation\\u003e\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\u003c/new_file_creation\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"},\"name\":\"fetch\",\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\u003cusage\\u003e\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"glob\",\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cpattern_syntax\\u003e\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\u003c/pattern_syntax\\u003e\\n\\n\\u003cexamples\\u003e\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\u003c/examples\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"grep\",\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cregex_syntax\\u003e\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\u003c/regex_syntax\\u003e\\n\\n\\u003cinclude_patterns\\u003e\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\u003c/include_patterns\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003cignore_support\\u003e\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\u003c/ignore_support\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"name\":\"ls\",\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\u003cusage\\u003e\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"},\"name\":\"sourcegraph\",\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\u003cusage\\u003e\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cbasic_syntax\\u003e\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\u003c/basic_syntax\\u003e\\n\\n\\u003ckey_filters\\u003e\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\u003c/key_filters\\u003e\\n\\n\\u003cexamples\\u003e\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\u003c/examples\\u003e\\n\\n\\u003cboolean_operators\\u003e\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\u003c/boolean_operators\\u003e\\n\\n\\u003climitations\\u003e\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"},\"name\":\"view\",\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\u003cusage\\u003e\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines \\u003e2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"},\"name\":\"write\",\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\u003cusage\\u003e\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\u003c/tips\\u003e\\n\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"stream\":true}" headers: Accept: - application/json @@ -286,22 +283,22 @@ interactions: content_length: -1 body: |+ event: message_start - data: {"type":"message_start","message":{"id":"msg_01Y2WMP5Eu8NutZ2VjvZKeLx","type":"message","role":"assistant","model":"claude-sonnet-4-5-20250929","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":4,"cache_creation_input_tokens":174,"cache_read_input_tokens":8803,"cache_creation":{"ephemeral_5m_input_tokens":174,"ephemeral_1h_input_tokens":0},"output_tokens":2,"service_tier":"standard"}} } + data: {"type":"message_start","message":{"id":"msg_01SVwfTbQ9vcj2REASCEvwpM","type":"message","role":"assistant","model":"claude-sonnet-4-5-20250929","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":4,"cache_creation_input_tokens":174,"cache_read_input_tokens":8823,"cache_creation":{"ephemeral_5m_input_tokens":174,"ephemeral_1h_input_tokens":0},"output_tokens":2,"service_tier":"standard"}} } event: content_block_start - data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}} + data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"\n\nDone"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"\n\nDone"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":". The print statement now says \"hello from crush\"."} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":". The print statement now says \"hello from crush\"."} } event: ping data: {"type": "ping"} event: content_block_stop - data: {"type":"content_block_stop","index":0 } + data: {"type":"content_block_stop","index":0 } event: ping data: {"type": "ping"} @@ -310,7 +307,7 @@ interactions: data: {"type": "ping"} event: message_delta - data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":4,"cache_creation_input_tokens":174,"cache_read_input_tokens":8803,"output_tokens":16} } + data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":4,"cache_creation_input_tokens":174,"cache_read_input_tokens":8823,"output_tokens":16} } event: message_stop data: {"type":"message_stop" } @@ -320,4 +317,4 @@ interactions: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 2.250784458s + duration: 2.169448709s diff --git a/internal/agent/testdata/TestCoderAgent/anthropic-sonnet/write_tool.yaml b/internal/agent/testdata/TestCoderAgent/anthropic-sonnet/write_tool.yaml index fd0ab6281ccbae9cdad1ae02d0bcf11d6d3f01d0..b41373c48e8fccf13aebb331c65ab308bcf010b2 100644 --- a/internal/agent/testdata/TestCoderAgent/anthropic-sonnet/write_tool.yaml +++ b/internal/agent/testdata/TestCoderAgent/anthropic-sonnet/write_tool.yaml @@ -25,49 +25,49 @@ interactions: content_length: -1 body: |+ event: message_start - data: {"type":"message_start","message":{"id":"msg_014hAw8pARfMkVqmUpoMM5pz","type":"message","role":"assistant","model":"claude-3-5-haiku-20241022","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":138,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard"}} } + data: {"type":"message_start","message":{"id":"msg_01WCZLh4HmYZpaDXUTzZPzKN","type":"message","role":"assistant","model":"claude-3-5-haiku-20241022","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":138,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard"}} } event: content_block_start - data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } + data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Create"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Create"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" config"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" config"} } event: ping data: {"type": "ping"} event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":".json file with JSON"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":".json file with JSON"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" data"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" content"} } event: content_block_stop - data: {"type":"content_block_stop","index":0 } + data: {"type":"content_block_stop","index":0 } event: message_delta - data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":138,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":11} } + data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":138,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":11} } event: message_stop - data: {"type":"message_stop" } + data: {"type":"message_stop" } headers: Content-Type: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 720.809ms + duration: 539.216416ms - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 32005 + content_length: 32078 host: "" - body: "{\"max_tokens\":10000,\"messages\":[{\"content\":[{\"text\":\"use write to create a new file called config.json with content '{\\\"name\\\": \\\"test\\\", \\\"version\\\": \\\"1.0.0\\\"}'\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"role\":\"user\"}],\"model\":\"claude-sonnet-4-5-20250929\",\"system\":[{\"text\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\u003cmemory_instructions\\u003e\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\u003c/memory_instructions\\u003e\\n\\u003ccommunication_style\\u003e\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\u003cexample\\u003e\\nuser: 2 + 2\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what is 2+2?\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: is 11 a prime number?\\nassistant: true\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\u003c/example\\u003e\\n\\u003c/communication_style\\u003e\\n\\n\\u003cproactiveness\\u003e\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\u003c/proactiveness\\u003e\\n\\n\\u003cfollowing_conversations\\u003e\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\u003c/following_conversations\\u003e\\n\\n\\u003ccode_style\\u003e\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\u003c/code_style\\u003e\\n\\n\\u003cdoing_tasks\\u003e\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\u003c/doing_tasks\\u003e\\n\\n\\u003ctool_use\\u003e\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\u003c/tool_use\\u003e\\n\\n\\u003cenv\\u003e\\nWorking directory: /tmp/crush-test/TestCoderAgent/anthropic-sonnet/write_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\u003c/env\\u003e\\n\\u003cmemory\\u003e\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\u003c/memory\\u003e\\n\\n\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"tool_choice\":{\"disable_parallel_tool_use\":false,\"type\":\"auto\"},\"tools\":[{\"input_schema\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"},\"name\":\"bash\",\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\u003ccross_platform\\u003e\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\u003c/cross_platform\\u003e\\n\\n\\u003cexecution_steps\\u003e\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with \\u003ccwd\\u003e\\u003c/cwd\\u003e tags\\n\\u003c/execution_steps\\u003e\\n\\n\\u003cusage_notes\\u003e\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '\\u0026\\u0026', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\u003c/usage_notes\\u003e\\n\\n\\u003cgit_commits\\u003e\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in \\u003ccommit_analysis\\u003e tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\u003ccrush@charm.land\\u003e\\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\u003c/git_commits\\u003e\\n\\n\\u003cpull_requests\\u003e\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in \\u003cpr_analysis\\u003e tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n\\n ## Summary\\n\\n \\u0026lt;1-3 bullet points\\u003e\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\u003c/pull_requests\\u003e\\n\\n\\u003cexamples\\u003e\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar \\u0026\\u0026 pytest tests\\n\\u003c/examples\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"},\"name\":\"download\",\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\u003cusage\\u003e\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"},\"name\":\"edit\",\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\u003c/parameters\\u003e\\n\\n\\u003cspecial_cases\\u003e\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\u003c/special_cases\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\u003c/best_practices\\u003e\\n\\n\\u003cwindows_notes\\u003e\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\u003c/windows_notes\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"},\"name\":\"multiedit\",\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\u003c/parameters\\u003e\\n\\n\\u003coperation\\u003e\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\u003c/operation\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\u003c/best_practices\\u003e\\n\\n\\u003cnew_file_creation\\u003e\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\u003c/new_file_creation\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"},\"name\":\"fetch\",\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\u003cusage\\u003e\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"glob\",\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cpattern_syntax\\u003e\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\u003c/pattern_syntax\\u003e\\n\\n\\u003cexamples\\u003e\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\u003c/examples\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"grep\",\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cregex_syntax\\u003e\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\u003c/regex_syntax\\u003e\\n\\n\\u003cinclude_patterns\\u003e\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\u003c/include_patterns\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003cignore_support\\u003e\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\u003c/ignore_support\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"name\":\"ls\",\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\u003cusage\\u003e\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"},\"name\":\"sourcegraph\",\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\u003cusage\\u003e\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cbasic_syntax\\u003e\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\u003c/basic_syntax\\u003e\\n\\n\\u003ckey_filters\\u003e\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\u003c/key_filters\\u003e\\n\\n\\u003cexamples\\u003e\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\u003c/examples\\u003e\\n\\n\\u003cboolean_operators\\u003e\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\u003c/boolean_operators\\u003e\\n\\n\\u003climitations\\u003e\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"},\"name\":\"view\",\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\u003cusage\\u003e\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines \\u003e2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"},\"name\":\"write\",\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\u003cusage\\u003e\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\u003c/tips\\u003e\\n\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"stream\":true}" + body: "{\"max_tokens\":10000,\"messages\":[{\"content\":[{\"text\":\"use write to create a new file called config.json with content '{\\\"name\\\": \\\"test\\\", \\\"version\\\": \\\"1.0.0\\\"}'\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"role\":\"user\"}],\"model\":\"claude-sonnet-4-5-20250929\",\"system\":[{\"text\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\u003cmemory_instructions\\u003e\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\u003c/memory_instructions\\u003e\\n\\u003ccommunication_style\\u003e\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\u003cexample\\u003e\\nuser: 2 + 2\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what is 2+2?\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: is 11 a prime number?\\nassistant: true\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\u003c/example\\u003e\\n\\u003c/communication_style\\u003e\\n\\n\\u003cproactiveness\\u003e\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\u003c/proactiveness\\u003e\\n\\n\\u003cfollowing_conversations\\u003e\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\u003c/following_conversations\\u003e\\n\\n\\u003ccode_style\\u003e\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\u003c/code_style\\u003e\\n\\n\\u003cdoing_tasks\\u003e\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\u003c/doing_tasks\\u003e\\n\\n\\u003ctool_use\\u003e\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\u003c/tool_use\\u003e\\n\\n\\u003cenv\\u003e\\nWorking directory: /tmp/crush-test/TestCoderAgent/anthropic-sonnet/write_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\u003c/env\\u003e\\n\\u003cmemory\\u003e\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\u003c/memory\\u003e\\n\\n\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"tool_choice\":{\"disable_parallel_tool_use\":false,\"type\":\"auto\"},\"tools\":[{\"input_schema\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"},\"name\":\"bash\",\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\u003ccross_platform\\u003e\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\u003c/cross_platform\\u003e\\n\\n\\u003cexecution_steps\\u003e\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with \\u003ccwd\\u003e\\u003c/cwd\\u003e tags\\n\\u003c/execution_steps\\u003e\\n\\n\\u003cusage_notes\\u003e\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '\\u0026\\u0026', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\u003c/usage_notes\\u003e\\n\\n\\u003cgit_commits\\u003e\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in \\u003ccommit_analysis\\u003e tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\u003ccrush@charm.land\\u003e\\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\u003c/git_commits\\u003e\\n\\n\\u003cpull_requests\\u003e\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in \\u003cpr_analysis\\u003e tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n\\n ## Summary\\n\\n \\u0026lt;1-3 bullet points\\u003e\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\u003c/pull_requests\\u003e\\n\\n\\u003cexamples\\u003e\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar \\u0026\\u0026 pytest tests\\n\\u003c/examples\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"},\"name\":\"download\",\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\u003cusage\\u003e\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"},\"name\":\"edit\",\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\u003c/parameters\\u003e\\n\\n\\u003cspecial_cases\\u003e\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\u003c/special_cases\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\u003c/best_practices\\u003e\\n\\n\\u003cwindows_notes\\u003e\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\u003c/windows_notes\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"},\"name\":\"multiedit\",\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\u003c/parameters\\u003e\\n\\n\\u003coperation\\u003e\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\u003c/operation\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\u003c/best_practices\\u003e\\n\\n\\u003cnew_file_creation\\u003e\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\u003c/new_file_creation\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"},\"name\":\"fetch\",\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\u003cusage\\u003e\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"glob\",\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cpattern_syntax\\u003e\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\u003c/pattern_syntax\\u003e\\n\\n\\u003cexamples\\u003e\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\u003c/examples\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"grep\",\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cregex_syntax\\u003e\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\u003c/regex_syntax\\u003e\\n\\n\\u003cinclude_patterns\\u003e\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\u003c/include_patterns\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003cignore_support\\u003e\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\u003c/ignore_support\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"name\":\"ls\",\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\u003cusage\\u003e\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"},\"name\":\"sourcegraph\",\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\u003cusage\\u003e\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cbasic_syntax\\u003e\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\u003c/basic_syntax\\u003e\\n\\n\\u003ckey_filters\\u003e\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\u003c/key_filters\\u003e\\n\\n\\u003cexamples\\u003e\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\u003c/examples\\u003e\\n\\n\\u003cboolean_operators\\u003e\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\u003c/boolean_operators\\u003e\\n\\n\\u003climitations\\u003e\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"},\"name\":\"view\",\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\u003cusage\\u003e\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines \\u003e2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"},\"name\":\"write\",\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\u003cusage\\u003e\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\u003c/tips\\u003e\\n\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"stream\":true}" headers: Accept: - application/json @@ -84,76 +84,103 @@ interactions: content_length: -1 body: |+ event: message_start - data: {"type":"message_start","message":{"id":"msg_01KvQus42N37gEUxhVSYQHVc","type":"message","role":"assistant","model":"claude-sonnet-4-5-20250929","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":3,"cache_creation_input_tokens":1791,"cache_read_input_tokens":6884,"cache_creation":{"ephemeral_5m_input_tokens":1791,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard"}} } + data: {"type":"message_start","message":{"id":"msg_01XHMxxVeLE1gy2zt3JmAbGC","type":"message","role":"assistant","model":"claude-sonnet-4-5-20250929","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":3,"cache_creation_input_tokens":1791,"cache_read_input_tokens":6904,"cache_creation":{"ephemeral_5m_input_tokens":1791,"ephemeral_1h_input_tokens":0},"output_tokens":1,"service_tier":"standard"}} } event: content_block_start - data: {"type":"content_block_start","index":0,"content_block":{"type":"tool_use","id":"toolu_012BeM4FhMYEzt1ycQEH3pXb","name":"write","input":{}} } + data: {"type":"content_block_start","index":0,"content_block":{"type":"tool_use","id":"toolu_01AEc16mJi7bhgUjjxAnnHXC","name":"write","input":{}} } + + event: content_block_delta + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":""} } + + event: content_block_delta + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"{\"f"} } + + event: content_block_delta + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"ile"} } + + event: content_block_delta + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"_path\": \"/t"} } + + event: content_block_delta + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"mp/crus"} } + + event: content_block_delta + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"h-test/Test"} } + + event: content_block_delta + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"Code"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":""} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"rAge"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"{\"file_path"}} + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"nt/ant"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"\": \"confi"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"hropic-sonn"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"g.jso"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"et/w"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"n\""} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"rite_to"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":", \"cont"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"ol/co"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"ent\": "} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"nfig"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"\"{\\\"name\\\""} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":".json"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":": "}} + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"\""} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"\\\"test\\\","} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":", \"content\":"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":" \\\"version"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":" \"{\\"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"\\\""} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"\"name\\\": "} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":": \\\"1.0"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"\\\"test\\\", "} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":".0\\\"}\"}"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"\\\"version\\\":"} } + + event: content_block_delta + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":" \\\"1.0.0"} } + + event: content_block_delta + data: {"type":"content_block_delta","index":0,"delta":{"type":"input_json_delta","partial_json":"\\\"}\"}"} } event: content_block_stop - data: {"type":"content_block_stop","index":0 } + data: {"type":"content_block_stop","index":0 } event: message_delta - data: {"type":"message_delta","delta":{"stop_reason":"tool_use","stop_sequence":null},"usage":{"input_tokens":3,"cache_creation_input_tokens":1791,"cache_read_input_tokens":6884,"output_tokens":87} } + data: {"type":"message_delta","delta":{"stop_reason":"tool_use","stop_sequence":null},"usage":{"input_tokens":3,"cache_creation_input_tokens":1791,"cache_read_input_tokens":6904,"output_tokens":109} } event: message_stop - data: {"type":"message_stop" } + data: {"type":"message_stop"} headers: Content-Type: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 2.151360667s + duration: 2.09329325s - id: 2 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 32515 + content_length: 32647 host: "" - body: "{\"max_tokens\":10000,\"messages\":[{\"content\":[{\"text\":\"use write to create a new file called config.json with content '{\\\"name\\\": \\\"test\\\", \\\"version\\\": \\\"1.0.0\\\"}'\",\"type\":\"text\"}],\"role\":\"user\"},{\"content\":[{\"id\":\"toolu_012BeM4FhMYEzt1ycQEH3pXb\",\"input\":{\"content\":\"{\\\"name\\\": \\\"test\\\", \\\"version\\\": \\\"1.0.0\\\"}\",\"file_path\":\"config.json\"},\"name\":\"write\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"tool_use\"}],\"role\":\"assistant\"},{\"content\":[{\"tool_use_id\":\"toolu_012BeM4FhMYEzt1ycQEH3pXb\",\"cache_control\":{\"type\":\"ephemeral\"},\"content\":[{\"text\":\"\\u003cresult\\u003e\\nFile successfully written: /tmp/crush-test/TestCoderAgent/anthropic-sonnet/write_tool/config.json\\n\\u003c/result\\u003e\",\"type\":\"text\"}],\"type\":\"tool_result\"}],\"role\":\"user\"}],\"model\":\"claude-sonnet-4-5-20250929\",\"system\":[{\"text\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\u003cmemory_instructions\\u003e\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\u003c/memory_instructions\\u003e\\n\\u003ccommunication_style\\u003e\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\u003cexample\\u003e\\nuser: 2 + 2\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what is 2+2?\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: is 11 a prime number?\\nassistant: true\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\u003c/example\\u003e\\n\\u003c/communication_style\\u003e\\n\\n\\u003cproactiveness\\u003e\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\u003c/proactiveness\\u003e\\n\\n\\u003cfollowing_conversations\\u003e\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\u003c/following_conversations\\u003e\\n\\n\\u003ccode_style\\u003e\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\u003c/code_style\\u003e\\n\\n\\u003cdoing_tasks\\u003e\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\u003c/doing_tasks\\u003e\\n\\n\\u003ctool_use\\u003e\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\u003c/tool_use\\u003e\\n\\n\\u003cenv\\u003e\\nWorking directory: /tmp/crush-test/TestCoderAgent/anthropic-sonnet/write_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\u003c/env\\u003e\\n\\u003cmemory\\u003e\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\u003c/memory\\u003e\\n\\n\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"tool_choice\":{\"disable_parallel_tool_use\":false,\"type\":\"auto\"},\"tools\":[{\"input_schema\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"},\"name\":\"bash\",\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\u003ccross_platform\\u003e\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\u003c/cross_platform\\u003e\\n\\n\\u003cexecution_steps\\u003e\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with \\u003ccwd\\u003e\\u003c/cwd\\u003e tags\\n\\u003c/execution_steps\\u003e\\n\\n\\u003cusage_notes\\u003e\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '\\u0026\\u0026', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\u003c/usage_notes\\u003e\\n\\n\\u003cgit_commits\\u003e\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in \\u003ccommit_analysis\\u003e tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\u003ccrush@charm.land\\u003e\\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\u003c/git_commits\\u003e\\n\\n\\u003cpull_requests\\u003e\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in \\u003cpr_analysis\\u003e tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n\\n ## Summary\\n\\n \\u0026lt;1-3 bullet points\\u003e\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\u003c/pull_requests\\u003e\\n\\n\\u003cexamples\\u003e\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar \\u0026\\u0026 pytest tests\\n\\u003c/examples\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"},\"name\":\"download\",\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\u003cusage\\u003e\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"},\"name\":\"edit\",\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\u003c/parameters\\u003e\\n\\n\\u003cspecial_cases\\u003e\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\u003c/special_cases\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\u003c/best_practices\\u003e\\n\\n\\u003cwindows_notes\\u003e\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\u003c/windows_notes\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"},\"name\":\"multiedit\",\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\u003c/parameters\\u003e\\n\\n\\u003coperation\\u003e\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\u003c/operation\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\u003c/best_practices\\u003e\\n\\n\\u003cnew_file_creation\\u003e\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\u003c/new_file_creation\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"},\"name\":\"fetch\",\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\u003cusage\\u003e\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"glob\",\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cpattern_syntax\\u003e\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\u003c/pattern_syntax\\u003e\\n\\n\\u003cexamples\\u003e\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\u003c/examples\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"grep\",\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cregex_syntax\\u003e\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\u003c/regex_syntax\\u003e\\n\\n\\u003cinclude_patterns\\u003e\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\u003c/include_patterns\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003cignore_support\\u003e\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\u003c/ignore_support\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"name\":\"ls\",\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\u003cusage\\u003e\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"},\"name\":\"sourcegraph\",\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\u003cusage\\u003e\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cbasic_syntax\\u003e\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\u003c/basic_syntax\\u003e\\n\\n\\u003ckey_filters\\u003e\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\u003c/key_filters\\u003e\\n\\n\\u003cexamples\\u003e\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\u003c/examples\\u003e\\n\\n\\u003cboolean_operators\\u003e\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\u003c/boolean_operators\\u003e\\n\\n\\u003climitations\\u003e\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"},\"name\":\"view\",\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\u003cusage\\u003e\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines \\u003e2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"},\"name\":\"write\",\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\u003cusage\\u003e\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\u003c/tips\\u003e\\n\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"stream\":true}" + body: "{\"max_tokens\":10000,\"messages\":[{\"content\":[{\"text\":\"use write to create a new file called config.json with content '{\\\"name\\\": \\\"test\\\", \\\"version\\\": \\\"1.0.0\\\"}'\",\"type\":\"text\"}],\"role\":\"user\"},{\"content\":[{\"id\":\"toolu_01AEc16mJi7bhgUjjxAnnHXC\",\"input\":{\"content\":\"{\\\"name\\\": \\\"test\\\", \\\"version\\\": \\\"1.0.0\\\"}\",\"file_path\":\"/tmp/crush-test/TestCoderAgent/anthropic-sonnet/write_tool/config.json\"},\"name\":\"write\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"tool_use\"}],\"role\":\"assistant\"},{\"content\":[{\"tool_use_id\":\"toolu_01AEc16mJi7bhgUjjxAnnHXC\",\"cache_control\":{\"type\":\"ephemeral\"},\"content\":[{\"text\":\"\\u003cresult\\u003e\\nFile successfully written: /tmp/crush-test/TestCoderAgent/anthropic-sonnet/write_tool/config.json\\n\\u003c/result\\u003e\",\"type\":\"text\"}],\"type\":\"tool_result\"}],\"role\":\"user\"}],\"model\":\"claude-sonnet-4-5-20250929\",\"system\":[{\"text\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\u003cmemory_instructions\\u003e\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\u003c/memory_instructions\\u003e\\n\\u003ccommunication_style\\u003e\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\u003cexample\\u003e\\nuser: 2 + 2\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what is 2+2?\\nassistant: 4\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: is 11 a prime number?\\nassistant: true\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\u003c/example\\u003e\\n\\n\\u003cexample\\u003e\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\u003c/example\\u003e\\n\\u003c/communication_style\\u003e\\n\\n\\u003cproactiveness\\u003e\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\u003c/proactiveness\\u003e\\n\\n\\u003cfollowing_conversations\\u003e\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\u003c/following_conversations\\u003e\\n\\n\\u003ccode_style\\u003e\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\u003c/code_style\\u003e\\n\\n\\u003cdoing_tasks\\u003e\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\u003c/doing_tasks\\u003e\\n\\n\\u003ctool_use\\u003e\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\u003c/tool_use\\u003e\\n\\n\\u003cenv\\u003e\\nWorking directory: /tmp/crush-test/TestCoderAgent/anthropic-sonnet/write_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\u003c/env\\u003e\\n\\u003cmemory\\u003e\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\u003c/memory\\u003e\\n\\n\",\"cache_control\":{\"type\":\"ephemeral\"},\"type\":\"text\"}],\"tool_choice\":{\"disable_parallel_tool_use\":false,\"type\":\"auto\"},\"tools\":[{\"input_schema\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"},\"name\":\"bash\",\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\u003ccross_platform\\u003e\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\u003c/cross_platform\\u003e\\n\\n\\u003cexecution_steps\\u003e\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with \\u003ccwd\\u003e\\u003c/cwd\\u003e tags\\n\\u003c/execution_steps\\u003e\\n\\n\\u003cusage_notes\\u003e\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '\\u0026\\u0026', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\u003c/usage_notes\\u003e\\n\\n\\u003cgit_commits\\u003e\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in \\u003ccommit_analysis\\u003e tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\u003ccrush@charm.land\\u003e\\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\u003c/git_commits\\u003e\\n\\n\\u003cpull_requests\\u003e\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in \\u003cpr_analysis\\u003e tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat \\u0026lt;\\u0026lt;'EOF'\\n\\n ## Summary\\n\\n \\u0026lt;1-3 bullet points\\u003e\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\u003c/pull_requests\\u003e\\n\\n\\u003cexamples\\u003e\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar \\u0026\\u0026 pytest tests\\n\\u003c/examples\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"},\"name\":\"download\",\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\u003cusage\\u003e\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"},\"name\":\"edit\",\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\u003c/parameters\\u003e\\n\\n\\u003cspecial_cases\\u003e\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\u003c/special_cases\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\u003c/best_practices\\u003e\\n\\n\\u003cwindows_notes\\u003e\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\u003c/windows_notes\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"},\"name\":\"multiedit\",\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\u003cprerequisites\\u003e\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\u003c/prerequisites\\u003e\\n\\n\\u003cparameters\\u003e\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\u003c/parameters\\u003e\\n\\n\\u003coperation\\u003e\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\u003c/operation\\u003e\\n\\n\\u003ccritical_requirements\\u003e\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\u003c/critical_requirements\\u003e\\n\\n\\u003cwarnings\\u003e\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\u003c/warnings\\u003e\\n\\n\\u003cbest_practices\\u003e\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\u003c/best_practices\\u003e\\n\\n\\u003cnew_file_creation\\u003e\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\u003c/new_file_creation\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"},\"name\":\"fetch\",\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\u003cusage\\u003e\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"glob\",\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cpattern_syntax\\u003e\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\u003c/pattern_syntax\\u003e\\n\\n\\u003cexamples\\u003e\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\u003c/examples\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"},\"name\":\"grep\",\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\u003cusage\\u003e\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\u003c/usage\\u003e\\n\\n\\u003cregex_syntax\\u003e\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\u003c/regex_syntax\\u003e\\n\\n\\u003cinclude_patterns\\u003e\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\u003c/include_patterns\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\u003c/limitations\\u003e\\n\\n\\u003cignore_support\\u003e\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\u003c/ignore_support\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"},\"name\":\"ls\",\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\u003cusage\\u003e\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"},\"name\":\"sourcegraph\",\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\u003cusage\\u003e\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\u003c/usage\\u003e\\n\\n\\u003cbasic_syntax\\u003e\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\u003c/basic_syntax\\u003e\\n\\n\\u003ckey_filters\\u003e\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\u003c/key_filters\\u003e\\n\\n\\u003cexamples\\u003e\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\u003c/examples\\u003e\\n\\n\\u003cboolean_operators\\u003e\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\u003c/boolean_operators\\u003e\\n\\n\\u003climitations\\u003e\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\u003c/limitations\\u003e\\n\\n\\u003ctips\\u003e\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"},\"name\":\"view\",\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\u003cusage\\u003e\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines \\u003e2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\u003c/tips\\u003e\\n\"},{\"input_schema\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"},\"name\":\"write\",\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\u003cusage\\u003e\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\u003c/usage\\u003e\\n\\n\\u003cfeatures\\u003e\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\u003c/features\\u003e\\n\\n\\u003climitations\\u003e\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\u003c/limitations\\u003e\\n\\n\\u003ccross_platform\\u003e\\n\\n- Use forward slashes (/) for compatibility\\n \\u003c/cross_platform\\u003e\\n\\n\\u003ctips\\u003e\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\u003c/tips\\u003e\\n\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"stream\":true}" headers: Accept: - application/json @@ -170,29 +197,29 @@ interactions: content_length: -1 body: |+ event: message_start - data: {"type":"message_start","message":{"id":"msg_01NuxY9Yduf3GJnN67sqhGq3","type":"message","role":"assistant","model":"claude-sonnet-4-5-20250929","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":3,"cache_creation_input_tokens":133,"cache_read_input_tokens":8675,"cache_creation":{"ephemeral_5m_input_tokens":133,"ephemeral_1h_input_tokens":0},"output_tokens":2,"service_tier":"standard"}} } + data: {"type":"message_start","message":{"id":"msg_01BL4d2qYhGLmaV89UnHtgHz","type":"message","role":"assistant","model":"claude-sonnet-4-5-20250929","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":3,"cache_creation_input_tokens":155,"cache_read_input_tokens":8695,"cache_creation":{"ephemeral_5m_input_tokens":155,"ephemeral_1h_input_tokens":0},"output_tokens":2,"service_tier":"standard"}} } event: content_block_start - data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } + data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"\n\nFile"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"\n\nCreate"} } event: content_block_delta - data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":" created at config.json"} } + data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"d config.json"} } event: content_block_stop - data: {"type":"content_block_stop","index":0 } + data: {"type":"content_block_stop","index":0 } event: message_delta - data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":3,"cache_creation_input_tokens":133,"cache_read_input_tokens":8675,"output_tokens":10} } + data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":3,"cache_creation_input_tokens":155,"cache_read_input_tokens":8695,"output_tokens":8} } event: message_stop - data: {"type":"message_stop" } + data: {"type":"message_stop" } headers: Content-Type: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 2.306125959s + duration: 2.212741083s diff --git a/internal/agent/testdata/TestCoderAgent/openai-gpt-5/bash_tool.yaml b/internal/agent/testdata/TestCoderAgent/openai-gpt-5/bash_tool.yaml index 8b16cc40ce5a46bae12fe3818cfcc80047ab9db7..8a71c0aa651edbef7191800be630d2ca7208c110 100644 --- a/internal/agent/testdata/TestCoderAgent/openai-gpt-5/bash_tool.yaml +++ b/internal/agent/testdata/TestCoderAgent/openai-gpt-5/bash_tool.yaml @@ -24,27 +24,100 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"chatcmpl-CLu8QRD1umrue04IcTVqAvUlUT2nV","object":"chat.completion.chunk","created":1759336706,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"JU6dRaODQHfgSE"} + data: {"id":"chatcmpl-CLuSgiKkXhyOjDorCUlST2AUWFtQX","object":"chat.completion.chunk","created":1759337962,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"IqF1t260jyfkmS"} - data: {"id":"chatcmpl-CLu8QRD1umrue04IcTVqAvUlUT2nV","object":"chat.completion.chunk","created":1759336706,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":"Creating"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"NJZxxDLC"} + data: {"id":"chatcmpl-CLuSgiKkXhyOjDorCUlST2AUWFtQX","object":"chat.completion.chunk","created":1759337962,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":"Creating"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"UTmSyAyK"} - data: {"id":"chatcmpl-CLu8QRD1umrue04IcTVqAvUlUT2nV","object":"chat.completion.chunk","created":1759336706,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":" a"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"0MWUP899YFxaal"} + data: {"id":"chatcmpl-CLuSgiKkXhyOjDorCUlST2AUWFtQX","object":"chat.completion.chunk","created":1759337962,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":" a"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"7bFe3Val0yi424"} - data: {"id":"chatcmpl-CLu8QRD1umrue04IcTVqAvUlUT2nV","object":"chat.completion.chunk","created":1759336706,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":" File"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"MrNbBcK8cO2"} + data: {"id":"chatcmpl-CLuSgiKkXhyOjDorCUlST2AUWFtQX","object":"chat.completion.chunk","created":1759337962,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":" File"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"Pa8Dkpe7h0f"} - data: {"id":"chatcmpl-CLu8QRD1umrue04IcTVqAvUlUT2nV","object":"chat.completion.chunk","created":1759336706,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":" with"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"ReIxnmqqltG"} + data: {"id":"chatcmpl-CLuSgiKkXhyOjDorCUlST2AUWFtQX","object":"chat.completion.chunk","created":1759337962,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":" with"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"2MaFDarCPOr"} - data: {"id":"chatcmpl-CLu8QRD1umrue04IcTVqAvUlUT2nV","object":"chat.completion.chunk","created":1759336706,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":" Bash"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"IksZHXvi7T8"} + data: {"id":"chatcmpl-CLuSgiKkXhyOjDorCUlST2AUWFtQX","object":"chat.completion.chunk","created":1759337962,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":" Bash"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"jmzcGHDwoBz"} - data: {"id":"chatcmpl-CLu8QRD1umrue04IcTVqAvUlUT2nV","object":"chat.completion.chunk","created":1759336706,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":" Cont"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"CWPgOeSwYAV"} + data: {"id":"chatcmpl-CLuSgiKkXhyOjDorCUlST2AUWFtQX","object":"chat.completion.chunk","created":1759337962,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":" Command"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"QGA5LMno"} - data: {"id":"chatcmpl-CLu8QRD1umrue04IcTVqAvUlUT2nV","object":"chat.completion.chunk","created":1759336706,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":"aining"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"aZhEYV6FGA"} + data: {"id":"chatcmpl-CLuSgiKkXhyOjDorCUlST2AUWFtQX","object":"chat.completion.chunk","created":1759337962,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"x8QZ3ohcfn"} - data: {"id":"chatcmpl-CLu8QRD1umrue04IcTVqAvUlUT2nV","object":"chat.completion.chunk","created":1759336706,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":" Text"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"Y4ZmtaWeeyb"} + data: {"id":"chatcmpl-CLuSgiKkXhyOjDorCUlST2AUWFtQX","object":"chat.completion.chunk","created":1759337962,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[],"usage":{"prompt_tokens":123,"completion_tokens":6,"total_tokens":129,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"p0sEbLTxMZ0e2b"} - data: {"id":"chatcmpl-CLu8QRD1umrue04IcTVqAvUlUT2nV","object":"chat.completion.chunk","created":1759336706,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"6gSj1fd2bg"} + data: [DONE] + + headers: + Content-Type: + - text/event-stream; charset=utf-8 + status: 200 OK + code: 200 + duration: 1.414818625s +- id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 30654 + host: "" + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/bash_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use bash to create a file named test.txt with content 'hello bash'\",\"role\":\"user\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://api.openai.com/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: |+ + data: {"id":"chatcmpl-CLuShvvcU6PKsGepP1mNlxPywtFRO","object":"chat.completion.chunk","created":1759337963,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"call_iThmRuWrEf4um0WjWGEDKVP9","type":"function","function":{"name":"ls","arguments":""}}],"refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"AgkO9uzjbbVuBT"} + + data: {"id":"chatcmpl-CLuShvvcU6PKsGepP1mNlxPywtFRO","object":"chat.completion.chunk","created":1759337963,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"uvTX9mguXxnrRzW"} + + data: {"id":"chatcmpl-CLuShvvcU6PKsGepP1mNlxPywtFRO","object":"chat.completion.chunk","created":1759337963,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"path"}}]},"finish_reason":null}],"usage":null,"obfuscation":"OR07gqoFWfo6IE"} + + data: {"id":"chatcmpl-CLuShvvcU6PKsGepP1mNlxPywtFRO","object":"chat.completion.chunk","created":1759337963,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":"}}]},"finish_reason":null}],"usage":null,"obfuscation":"0O4DgYsWvvIB2sU"} + + data: {"id":"chatcmpl-CLuShvvcU6PKsGepP1mNlxPywtFRO","object":"chat.completion.chunk","created":1759337963,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" \"/"}}]},"finish_reason":null}],"usage":null,"obfuscation":"sE0N8UPhhvgOXN"} - data: {"id":"chatcmpl-CLu8QRD1umrue04IcTVqAvUlUT2nV","object":"chat.completion.chunk","created":1759336706,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[],"usage":{"prompt_tokens":123,"completion_tokens":8,"total_tokens":131,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"wKNK51k4XWDpTx"} + data: {"id":"chatcmpl-CLuShvvcU6PKsGepP1mNlxPywtFRO","object":"chat.completion.chunk","created":1759337963,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"tmp"}}]},"finish_reason":null}],"usage":null,"obfuscation":"VyOPG1KWb6HQLZz"} + + data: {"id":"chatcmpl-CLuShvvcU6PKsGepP1mNlxPywtFRO","object":"chat.completion.chunk","created":1759337963,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/cr"}}]},"finish_reason":null}],"usage":null,"obfuscation":"e4l2XLPuORvHpnL"} + + data: {"id":"chatcmpl-CLuShvvcU6PKsGepP1mNlxPywtFRO","object":"chat.completion.chunk","created":1759337963,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ush"}}]},"finish_reason":null}],"usage":null,"obfuscation":"GEUWhaT64cNLU3K"} + + data: {"id":"chatcmpl-CLuShvvcU6PKsGepP1mNlxPywtFRO","object":"chat.completion.chunk","created":1759337963,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"-test"}}]},"finish_reason":null}],"usage":null,"obfuscation":"G7FyQhIpaK5j9"} + + data: {"id":"chatcmpl-CLuShvvcU6PKsGepP1mNlxPywtFRO","object":"chat.completion.chunk","created":1759337963,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/Test"}}]},"finish_reason":null}],"usage":null,"obfuscation":"MQ5uJRuV1sPWQ"} + + data: {"id":"chatcmpl-CLuShvvcU6PKsGepP1mNlxPywtFRO","object":"chat.completion.chunk","created":1759337963,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Coder"}}]},"finish_reason":null}],"usage":null,"obfuscation":"KuhQ8h8xaNyTF"} + + data: {"id":"chatcmpl-CLuShvvcU6PKsGepP1mNlxPywtFRO","object":"chat.completion.chunk","created":1759337963,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Agent"}}]},"finish_reason":null}],"usage":null,"obfuscation":"luYX2kXJTcuHo"} + + data: {"id":"chatcmpl-CLuShvvcU6PKsGepP1mNlxPywtFRO","object":"chat.completion.chunk","created":1759337963,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/open"}}]},"finish_reason":null}],"usage":null,"obfuscation":"3zvnBtSQrvAit"} + + data: {"id":"chatcmpl-CLuShvvcU6PKsGepP1mNlxPywtFRO","object":"chat.completion.chunk","created":1759337963,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ai"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + + data: {"id":"chatcmpl-CLuShvvcU6PKsGepP1mNlxPywtFRO","object":"chat.completion.chunk","created":1759337963,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"-g"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + + data: {"id":"chatcmpl-CLuShvvcU6PKsGepP1mNlxPywtFRO","object":"chat.completion.chunk","created":1759337963,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"pt"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + + data: {"id":"chatcmpl-CLuShvvcU6PKsGepP1mNlxPywtFRO","object":"chat.completion.chunk","created":1759337963,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"-"}}]},"finish_reason":null}],"usage":null,"obfuscation":"y"} + + data: {"id":"chatcmpl-CLuShvvcU6PKsGepP1mNlxPywtFRO","object":"chat.completion.chunk","created":1759337963,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"5"}}]},"finish_reason":null}],"usage":null,"obfuscation":"Q"} + + data: {"id":"chatcmpl-CLuShvvcU6PKsGepP1mNlxPywtFRO","object":"chat.completion.chunk","created":1759337963,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/bash"}}]},"finish_reason":null}],"usage":null,"obfuscation":"8fn8VxDjyWpnz"} + + data: {"id":"chatcmpl-CLuShvvcU6PKsGepP1mNlxPywtFRO","object":"chat.completion.chunk","created":1759337963,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_tool"}}]},"finish_reason":null}],"usage":null,"obfuscation":"DRWiw6jDfeCsr"} + + data: {"id":"chatcmpl-CLuShvvcU6PKsGepP1mNlxPywtFRO","object":"chat.completion.chunk","created":1759337963,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"}"}}]},"finish_reason":null}],"usage":null,"obfuscation":"WuRpp6juqfvp3vv"} + + data: {"id":"chatcmpl-CLuShvvcU6PKsGepP1mNlxPywtFRO","object":"chat.completion.chunk","created":1759337963,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"tool_calls"}],"usage":null,"obfuscation":""} + + data: {"id":"chatcmpl-CLuShvvcU6PKsGepP1mNlxPywtFRO","object":"chat.completion.chunk","created":1759337963,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6565,"completion_tokens":1190,"total_tokens":7755,"prompt_tokens_details":{"cached_tokens":1024,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":1152,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"LI39a8W9tOazRwA"} data: [DONE] @@ -53,15 +126,15 @@ interactions: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 574.452291ms -- id: 1 + duration: 26.914605667s +- id: 2 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 30581 + content_length: 31017 host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/bash_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use bash to create a file named test.txt with content 'hello bash'\",\"role\":\"user\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/bash_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use bash to create a file named test.txt with content 'hello bash'\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"call_iThmRuWrEf4um0WjWGEDKVP9\",\"function\":{\"arguments\":\"{\\\"path\\\": \\\"/tmp/crush-test/TestCoderAgent/openai-gpt-5/bash_tool\\\"}\",\"name\":\"ls\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"\\n- /tmp/crush-test/TestCoderAgent/openai-gpt-5/bash_tool/\\n - go.mod\\n - main.go\\n\",\"tool_call_id\":\"call_iThmRuWrEf4um0WjWGEDKVP9\",\"role\":\"tool\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" headers: Accept: - application/json @@ -77,63 +150,109 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"chatcmpl-CLu8QvxQ7ixLuUOsXqkOLUMfyAZFg","object":"chat.completion.chunk","created":1759336706,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"call_PKAZWFdeGn6acNZv9McuTXSJ","type":"function","function":{"name":"bash","arguments":""}}],"refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"ejKhuOsvUMQk"} + data: {"id":"chatcmpl-CLuT8Q5zAcpBZ78ZIYcJitpNuaJi7","object":"chat.completion.chunk","created":1759337990,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"call_y7Qtxv3GotPubJ8J9Sj5oFeG","type":"function","function":{"name":"bash","arguments":""}}],"refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"38f1V21zeK0P"} + + data: {"id":"chatcmpl-CLuT8Q5zAcpBZ78ZIYcJitpNuaJi7","object":"chat.completion.chunk","created":1759337990,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"90Y0K0TIRpZYhf8"} + + data: {"id":"chatcmpl-CLuT8Q5zAcpBZ78ZIYcJitpNuaJi7","object":"chat.completion.chunk","created":1759337990,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"command"}}]},"finish_reason":null}],"usage":null,"obfuscation":"euslSUGhQan"} + + data: {"id":"chatcmpl-CLuT8Q5zAcpBZ78ZIYcJitpNuaJi7","object":"chat.completion.chunk","created":1759337990,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"6je3cK1IFEgZD"} + + data: {"id":"chatcmpl-CLuT8Q5zAcpBZ78ZIYcJitpNuaJi7","object":"chat.completion.chunk","created":1759337990,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"printf"}}]},"finish_reason":null}],"usage":null,"obfuscation":"cVaws1GQnw63"} + + data: {"id":"chatcmpl-CLuT8Q5zAcpBZ78ZIYcJitpNuaJi7","object":"chat.completion.chunk","created":1759337990,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" %"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + + data: {"id":"chatcmpl-CLuT8Q5zAcpBZ78ZIYcJitpNuaJi7","object":"chat.completion.chunk","created":1759337990,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"s"}}]},"finish_reason":null}],"usage":null,"obfuscation":"3"} + + data: {"id":"chatcmpl-CLuT8Q5zAcpBZ78ZIYcJitpNuaJi7","object":"chat.completion.chunk","created":1759337990,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" '"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + + data: {"id":"chatcmpl-CLuT8Q5zAcpBZ78ZIYcJitpNuaJi7","object":"chat.completion.chunk","created":1759337990,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"hello"}}]},"finish_reason":null}],"usage":null,"obfuscation":"VZsnFQJ96ByGu"} + + data: {"id":"chatcmpl-CLuT8Q5zAcpBZ78ZIYcJitpNuaJi7","object":"chat.completion.chunk","created":1759337990,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" bash"}}]},"finish_reason":null}],"usage":null,"obfuscation":"zrkFvRCkbSHaY"} + + data: {"id":"chatcmpl-CLuT8Q5zAcpBZ78ZIYcJitpNuaJi7","object":"chat.completion.chunk","created":1759337990,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"'"}}]},"finish_reason":null}],"usage":null,"obfuscation":"R"} + + data: {"id":"chatcmpl-CLuT8Q5zAcpBZ78ZIYcJitpNuaJi7","object":"chat.completion.chunk","created":1759337990,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" >"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + + data: {"id":"chatcmpl-CLuT8Q5zAcpBZ78ZIYcJitpNuaJi7","object":"chat.completion.chunk","created":1759337990,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" /"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + + data: {"id":"chatcmpl-CLuT8Q5zAcpBZ78ZIYcJitpNuaJi7","object":"chat.completion.chunk","created":1759337990,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"tmp"}}]},"finish_reason":null}],"usage":null,"obfuscation":"r3n8fhmt4NTEmPX"} - data: {"id":"chatcmpl-CLu8QvxQ7ixLuUOsXqkOLUMfyAZFg","object":"chat.completion.chunk","created":1759336706,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"bpFI37HQ7csAGcl"} + data: {"id":"chatcmpl-CLuT8Q5zAcpBZ78ZIYcJitpNuaJi7","object":"chat.completion.chunk","created":1759337990,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/cr"}}]},"finish_reason":null}],"usage":null,"obfuscation":"kstuaayT3ntptBN"} - data: {"id":"chatcmpl-CLu8QvxQ7ixLuUOsXqkOLUMfyAZFg","object":"chat.completion.chunk","created":1759336706,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"command"}}]},"finish_reason":null}],"usage":null,"obfuscation":"OXMwyt0t7gb"} + data: {"id":"chatcmpl-CLuT8Q5zAcpBZ78ZIYcJitpNuaJi7","object":"chat.completion.chunk","created":1759337990,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ush"}}]},"finish_reason":null}],"usage":null,"obfuscation":"Dxc5UCB8aVll8m0"} - data: {"id":"chatcmpl-CLu8QvxQ7ixLuUOsXqkOLUMfyAZFg","object":"chat.completion.chunk","created":1759336706,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"jh8Q36KXZz7cL"} + data: {"id":"chatcmpl-CLuT8Q5zAcpBZ78ZIYcJitpNuaJi7","object":"chat.completion.chunk","created":1759337990,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"-test"}}]},"finish_reason":null}],"usage":null,"obfuscation":"nNq5m75V2ROLk"} - data: {"id":"chatcmpl-CLu8QvxQ7ixLuUOsXqkOLUMfyAZFg","object":"chat.completion.chunk","created":1759336706,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"printf"}}]},"finish_reason":null}],"usage":null,"obfuscation":"Zajiz11BiAAf"} + data: {"id":"chatcmpl-CLuT8Q5zAcpBZ78ZIYcJitpNuaJi7","object":"chat.completion.chunk","created":1759337990,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/Test"}}]},"finish_reason":null}],"usage":null,"obfuscation":"sBIvOM0FC6lKD"} - data: {"id":"chatcmpl-CLu8QvxQ7ixLuUOsXqkOLUMfyAZFg","object":"chat.completion.chunk","created":1759336706,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" '"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuT8Q5zAcpBZ78ZIYcJitpNuaJi7","object":"chat.completion.chunk","created":1759337990,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Coder"}}]},"finish_reason":null}],"usage":null,"obfuscation":"XJnavzn3qCIvL"} - data: {"id":"chatcmpl-CLu8QvxQ7ixLuUOsXqkOLUMfyAZFg","object":"chat.completion.chunk","created":1759336706,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"hello"}}]},"finish_reason":null}],"usage":null,"obfuscation":"WEqcFpBoJIXcz"} + data: {"id":"chatcmpl-CLuT8Q5zAcpBZ78ZIYcJitpNuaJi7","object":"chat.completion.chunk","created":1759337990,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Agent"}}]},"finish_reason":null}],"usage":null,"obfuscation":"MCQdmhrbBUJOh"} - data: {"id":"chatcmpl-CLu8QvxQ7ixLuUOsXqkOLUMfyAZFg","object":"chat.completion.chunk","created":1759336706,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" bash"}}]},"finish_reason":null}],"usage":null,"obfuscation":"j3ugURnVe7WUu"} + data: {"id":"chatcmpl-CLuT8Q5zAcpBZ78ZIYcJitpNuaJi7","object":"chat.completion.chunk","created":1759337990,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/open"}}]},"finish_reason":null}],"usage":null,"obfuscation":"yqeTKsg2CBMCV"} - data: {"id":"chatcmpl-CLu8QvxQ7ixLuUOsXqkOLUMfyAZFg","object":"chat.completion.chunk","created":1759336706,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"'"}}]},"finish_reason":null}],"usage":null,"obfuscation":"o"} + data: {"id":"chatcmpl-CLuT8Q5zAcpBZ78ZIYcJitpNuaJi7","object":"chat.completion.chunk","created":1759337990,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ai"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLu8QvxQ7ixLuUOsXqkOLUMfyAZFg","object":"chat.completion.chunk","created":1759336706,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" >"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuT8Q5zAcpBZ78ZIYcJitpNuaJi7","object":"chat.completion.chunk","created":1759337990,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"-g"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLu8QvxQ7ixLuUOsXqkOLUMfyAZFg","object":"chat.completion.chunk","created":1759336706,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" test"}}]},"finish_reason":null}],"usage":null,"obfuscation":"LzbLY3sk6HRU6"} + data: {"id":"chatcmpl-CLuT8Q5zAcpBZ78ZIYcJitpNuaJi7","object":"chat.completion.chunk","created":1759337990,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"pt"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLu8QvxQ7ixLuUOsXqkOLUMfyAZFg","object":"chat.completion.chunk","created":1759336706,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":".txt"}}]},"finish_reason":null}],"usage":null,"obfuscation":"D7gB6AJlw3BghH"} + data: {"id":"chatcmpl-CLuT8Q5zAcpBZ78ZIYcJitpNuaJi7","object":"chat.completion.chunk","created":1759337990,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"-"}}]},"finish_reason":null}],"usage":null,"obfuscation":"i"} - data: {"id":"chatcmpl-CLu8QvxQ7ixLuUOsXqkOLUMfyAZFg","object":"chat.completion.chunk","created":1759336706,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\",\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"N3Ezo2CoIcT16"} + data: {"id":"chatcmpl-CLuT8Q5zAcpBZ78ZIYcJitpNuaJi7","object":"chat.completion.chunk","created":1759337990,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"5"}}]},"finish_reason":null}],"usage":null,"obfuscation":"9"} - data: {"id":"chatcmpl-CLu8QvxQ7ixLuUOsXqkOLUMfyAZFg","object":"chat.completion.chunk","created":1759336706,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"description"}}]},"finish_reason":null}],"usage":null,"obfuscation":"zyGHFDt"} + data: {"id":"chatcmpl-CLuT8Q5zAcpBZ78ZIYcJitpNuaJi7","object":"chat.completion.chunk","created":1759337990,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/bash"}}]},"finish_reason":null}],"usage":null,"obfuscation":"5p5TDrMmKQ33B"} - data: {"id":"chatcmpl-CLu8QvxQ7ixLuUOsXqkOLUMfyAZFg","object":"chat.completion.chunk","created":1759336706,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"i9vLiF33quEs9"} + data: {"id":"chatcmpl-CLuT8Q5zAcpBZ78ZIYcJitpNuaJi7","object":"chat.completion.chunk","created":1759337990,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_tool"}}]},"finish_reason":null}],"usage":null,"obfuscation":"LooloQHaxF4ni"} - data: {"id":"chatcmpl-CLu8QvxQ7ixLuUOsXqkOLUMfyAZFg","object":"chat.completion.chunk","created":1759336706,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Create"}}]},"finish_reason":null}],"usage":null,"obfuscation":"spV9nq8wPYXL"} + data: {"id":"chatcmpl-CLuT8Q5zAcpBZ78ZIYcJitpNuaJi7","object":"chat.completion.chunk","created":1759337990,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/test"}}]},"finish_reason":null}],"usage":null,"obfuscation":"U5t27NIBs0Bfu"} - data: {"id":"chatcmpl-CLu8QvxQ7ixLuUOsXqkOLUMfyAZFg","object":"chat.completion.chunk","created":1759336706,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" test"}}]},"finish_reason":null}],"usage":null,"obfuscation":"YHDBLZVvZNe6W"} + data: {"id":"chatcmpl-CLuT8Q5zAcpBZ78ZIYcJitpNuaJi7","object":"chat.completion.chunk","created":1759337990,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":".txt"}}]},"finish_reason":null}],"usage":null,"obfuscation":"ynU03nP9Ja5iUz"} - data: {"id":"chatcmpl-CLu8QvxQ7ixLuUOsXqkOLUMfyAZFg","object":"chat.completion.chunk","created":1759336706,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":".txt"}}]},"finish_reason":null}],"usage":null,"obfuscation":"fFmER2PfmIbkh3"} + data: {"id":"chatcmpl-CLuT8Q5zAcpBZ78ZIYcJitpNuaJi7","object":"chat.completion.chunk","created":1759337990,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\",\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"IDqOxF4vaLq0i"} - data: {"id":"chatcmpl-CLu8QvxQ7ixLuUOsXqkOLUMfyAZFg","object":"chat.completion.chunk","created":1759336706,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" containing"}}]},"finish_reason":null}],"usage":null,"obfuscation":"Ar1XRrr"} + data: {"id":"chatcmpl-CLuT8Q5zAcpBZ78ZIYcJitpNuaJi7","object":"chat.completion.chunk","created":1759337990,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"description"}}]},"finish_reason":null}],"usage":null,"obfuscation":"FtPche7"} - data: {"id":"chatcmpl-CLu8QvxQ7ixLuUOsXqkOLUMfyAZFg","object":"chat.completion.chunk","created":1759336706,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" '"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuT8Q5zAcpBZ78ZIYcJitpNuaJi7","object":"chat.completion.chunk","created":1759337990,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"7lw90bJdJtogK"} - data: {"id":"chatcmpl-CLu8QvxQ7ixLuUOsXqkOLUMfyAZFg","object":"chat.completion.chunk","created":1759336706,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"hello"}}]},"finish_reason":null}],"usage":null,"obfuscation":"DZKwvkFVQ71Zx"} + data: {"id":"chatcmpl-CLuT8Q5zAcpBZ78ZIYcJitpNuaJi7","object":"chat.completion.chunk","created":1759337990,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Create"}}]},"finish_reason":null}],"usage":null,"obfuscation":"yX7HMs8yVp3Y"} - data: {"id":"chatcmpl-CLu8QvxQ7ixLuUOsXqkOLUMfyAZFg","object":"chat.completion.chunk","created":1759336706,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" bash"}}]},"finish_reason":null}],"usage":null,"obfuscation":"XX8UsXQuLfyt7"} + data: {"id":"chatcmpl-CLuT8Q5zAcpBZ78ZIYcJitpNuaJi7","object":"chat.completion.chunk","created":1759337990,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" test"}}]},"finish_reason":null}],"usage":null,"obfuscation":"ra88CMDjAT5FF"} - data: {"id":"chatcmpl-CLu8QvxQ7ixLuUOsXqkOLUMfyAZFg","object":"chat.completion.chunk","created":1759336706,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"'"}}]},"finish_reason":null}],"usage":null,"obfuscation":"R"} + data: {"id":"chatcmpl-CLuT8Q5zAcpBZ78ZIYcJitpNuaJi7","object":"chat.completion.chunk","created":1759337990,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":".txt"}}]},"finish_reason":null}],"usage":null,"obfuscation":"Wa2r1DXdH4tNmT"} - data: {"id":"chatcmpl-CLu8QvxQ7ixLuUOsXqkOLUMfyAZFg","object":"chat.completion.chunk","created":1759336706,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" without"}}]},"finish_reason":null}],"usage":null,"obfuscation":"BrzsVCKeGK"} + data: {"id":"chatcmpl-CLuT8Q5zAcpBZ78ZIYcJitpNuaJi7","object":"chat.completion.chunk","created":1759337990,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" with"}}]},"finish_reason":null}],"usage":null,"obfuscation":"XftP5rcnNgokO"} - data: {"id":"chatcmpl-CLu8QvxQ7ixLuUOsXqkOLUMfyAZFg","object":"chat.completion.chunk","created":1759336706,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" trailing"}}]},"finish_reason":null}],"usage":null,"obfuscation":"cGGGhG5cw"} + data: {"id":"chatcmpl-CLuT8Q5zAcpBZ78ZIYcJitpNuaJi7","object":"chat.completion.chunk","created":1759337990,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" exact"}}]},"finish_reason":null}],"usage":null,"obfuscation":"K6QQeBD1Q8fq"} - data: {"id":"chatcmpl-CLu8QvxQ7ixLuUOsXqkOLUMfyAZFg","object":"chat.completion.chunk","created":1759336706,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" newline"}}]},"finish_reason":null}],"usage":null,"obfuscation":"8lQX93OdZZ"} + data: {"id":"chatcmpl-CLuT8Q5zAcpBZ78ZIYcJitpNuaJi7","object":"chat.completion.chunk","created":1759337990,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" content"}}]},"finish_reason":null}],"usage":null,"obfuscation":"wLoqi1V4fO"} - data: {"id":"chatcmpl-CLu8QvxQ7ixLuUOsXqkOLUMfyAZFg","object":"chat.completion.chunk","created":1759336706,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"}"}}]},"finish_reason":null}],"usage":null,"obfuscation":"CapYetTSYPzTvlQ"} + data: {"id":"chatcmpl-CLuT8Q5zAcpBZ78ZIYcJitpNuaJi7","object":"chat.completion.chunk","created":1759337990,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" '"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLu8QvxQ7ixLuUOsXqkOLUMfyAZFg","object":"chat.completion.chunk","created":1759336706,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"tool_calls"}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuT8Q5zAcpBZ78ZIYcJitpNuaJi7","object":"chat.completion.chunk","created":1759337990,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"hello"}}]},"finish_reason":null}],"usage":null,"obfuscation":"LEsj4A6EnY04X"} - data: {"id":"chatcmpl-CLu8QvxQ7ixLuUOsXqkOLUMfyAZFg","object":"chat.completion.chunk","created":1759336706,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6555,"completion_tokens":620,"total_tokens":7175,"prompt_tokens_details":{"cached_tokens":1024,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":576,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"A"} + data: {"id":"chatcmpl-CLuT8Q5zAcpBZ78ZIYcJitpNuaJi7","object":"chat.completion.chunk","created":1759337990,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" bash"}}]},"finish_reason":null}],"usage":null,"obfuscation":"8VGIjCODt07Tg"} + + data: {"id":"chatcmpl-CLuT8Q5zAcpBZ78ZIYcJitpNuaJi7","object":"chat.completion.chunk","created":1759337990,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"'"}}]},"finish_reason":null}],"usage":null,"obfuscation":"e"} + + data: {"id":"chatcmpl-CLuT8Q5zAcpBZ78ZIYcJitpNuaJi7","object":"chat.completion.chunk","created":1759337990,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" in"}}]},"finish_reason":null}],"usage":null,"obfuscation":"F5lN6oaCuMuTghh"} + + data: {"id":"chatcmpl-CLuT8Q5zAcpBZ78ZIYcJitpNuaJi7","object":"chat.completion.chunk","created":1759337990,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" the"}}]},"finish_reason":null}],"usage":null,"obfuscation":"XMBeQiQqG1Majf"} + + data: {"id":"chatcmpl-CLuT8Q5zAcpBZ78ZIYcJitpNuaJi7","object":"chat.completion.chunk","created":1759337990,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" current"}}]},"finish_reason":null}],"usage":null,"obfuscation":"i52xbU1d0R"} + + data: {"id":"chatcmpl-CLuT8Q5zAcpBZ78ZIYcJitpNuaJi7","object":"chat.completion.chunk","created":1759337990,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" project"}}]},"finish_reason":null}],"usage":null,"obfuscation":"OEKpxNvfhH"} + + data: {"id":"chatcmpl-CLuT8Q5zAcpBZ78ZIYcJitpNuaJi7","object":"chat.completion.chunk","created":1759337990,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" directory"}}]},"finish_reason":null}],"usage":null,"obfuscation":"A5IkhU9v"} + + data: {"id":"chatcmpl-CLuT8Q5zAcpBZ78ZIYcJitpNuaJi7","object":"chat.completion.chunk","created":1759337990,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":".\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"4LsTSiRXMeT42f0"} + + data: {"id":"chatcmpl-CLuT8Q5zAcpBZ78ZIYcJitpNuaJi7","object":"chat.completion.chunk","created":1759337990,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"}"}}]},"finish_reason":null}],"usage":null,"obfuscation":"J"} + + data: {"id":"chatcmpl-CLuT8Q5zAcpBZ78ZIYcJitpNuaJi7","object":"chat.completion.chunk","created":1759337990,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"tool_calls"}],"usage":null,"obfuscation":""} + + data: {"id":"chatcmpl-CLuT8Q5zAcpBZ78ZIYcJitpNuaJi7","object":"chat.completion.chunk","created":1759337990,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6636,"completion_tokens":579,"total_tokens":7215,"prompt_tokens_details":{"cached_tokens":6528,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":512,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"a"} data: [DONE] @@ -142,15 +261,98 @@ interactions: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 13.102269291s -- id: 2 + duration: 9.640859125s +- id: 3 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 31444 + host: "" + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/bash_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use bash to create a file named test.txt with content 'hello bash'\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"call_iThmRuWrEf4um0WjWGEDKVP9\",\"function\":{\"arguments\":\"{\\\"path\\\": \\\"/tmp/crush-test/TestCoderAgent/openai-gpt-5/bash_tool\\\"}\",\"name\":\"ls\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"\\n- /tmp/crush-test/TestCoderAgent/openai-gpt-5/bash_tool/\\n - go.mod\\n - main.go\\n\",\"tool_call_id\":\"call_iThmRuWrEf4um0WjWGEDKVP9\",\"role\":\"tool\"},{\"tool_calls\":[{\"id\":\"call_y7Qtxv3GotPubJ8J9Sj5oFeG\",\"function\":{\"arguments\":\"{\\\"command\\\":\\\"printf %s 'hello bash' > /tmp/crush-test/TestCoderAgent/openai-gpt-5/bash_tool/test.txt\\\",\\\"description\\\":\\\"Create test.txt with exact content 'hello bash' in the current project directory.\\\"}\",\"name\":\"bash\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"no output\",\"tool_call_id\":\"call_y7Qtxv3GotPubJ8J9Sj5oFeG\",\"role\":\"tool\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://api.openai.com/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: |+ + data: {"id":"chatcmpl-CLuTHAaTVsp8OsvvS0iE8hCQ4sjxd","object":"chat.completion.chunk","created":1759337999,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"call_LITAJ86OKR49X11rVJxrl2fs","type":"function","function":{"name":"view","arguments":""}}],"refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"tlnDU97Vl3AP"} + + data: {"id":"chatcmpl-CLuTHAaTVsp8OsvvS0iE8hCQ4sjxd","object":"chat.completion.chunk","created":1759337999,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"VFGlM2lxWygF5MF"} + + data: {"id":"chatcmpl-CLuTHAaTVsp8OsvvS0iE8hCQ4sjxd","object":"chat.completion.chunk","created":1759337999,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"file"}}]},"finish_reason":null}],"usage":null,"obfuscation":"gRbqNdHELrtqAS"} + + data: {"id":"chatcmpl-CLuTHAaTVsp8OsvvS0iE8hCQ4sjxd","object":"chat.completion.chunk","created":1759337999,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_path"}}]},"finish_reason":null}],"usage":null,"obfuscation":"LevCeayMMnoEs"} + + data: {"id":"chatcmpl-CLuTHAaTVsp8OsvvS0iE8hCQ4sjxd","object":"chat.completion.chunk","created":1759337999,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":"}}]},"finish_reason":null}],"usage":null,"obfuscation":"XpnTN4qmlxR6cLb"} + + data: {"id":"chatcmpl-CLuTHAaTVsp8OsvvS0iE8hCQ4sjxd","object":"chat.completion.chunk","created":1759337999,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"/"}}]},"finish_reason":null}],"usage":null,"obfuscation":"WIkkvzd8jGWJHs0"} + + data: {"id":"chatcmpl-CLuTHAaTVsp8OsvvS0iE8hCQ4sjxd","object":"chat.completion.chunk","created":1759337999,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"tmp"}}]},"finish_reason":null}],"usage":null,"obfuscation":"vdJiygwCIJiGj9K"} + + data: {"id":"chatcmpl-CLuTHAaTVsp8OsvvS0iE8hCQ4sjxd","object":"chat.completion.chunk","created":1759337999,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/cr"}}]},"finish_reason":null}],"usage":null,"obfuscation":"hqlx9Y0a8lZaLti"} + + data: {"id":"chatcmpl-CLuTHAaTVsp8OsvvS0iE8hCQ4sjxd","object":"chat.completion.chunk","created":1759337999,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ush"}}]},"finish_reason":null}],"usage":null,"obfuscation":"bVkmBlD8u2r0C8A"} + + data: {"id":"chatcmpl-CLuTHAaTVsp8OsvvS0iE8hCQ4sjxd","object":"chat.completion.chunk","created":1759337999,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"-test"}}]},"finish_reason":null}],"usage":null,"obfuscation":"d402oL6PluXhM"} + + data: {"id":"chatcmpl-CLuTHAaTVsp8OsvvS0iE8hCQ4sjxd","object":"chat.completion.chunk","created":1759337999,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/Test"}}]},"finish_reason":null}],"usage":null,"obfuscation":"7qSNUHdPMIjP8"} + + data: {"id":"chatcmpl-CLuTHAaTVsp8OsvvS0iE8hCQ4sjxd","object":"chat.completion.chunk","created":1759337999,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Coder"}}]},"finish_reason":null}],"usage":null,"obfuscation":"wXchQ2CX0jvGI"} + + data: {"id":"chatcmpl-CLuTHAaTVsp8OsvvS0iE8hCQ4sjxd","object":"chat.completion.chunk","created":1759337999,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Agent"}}]},"finish_reason":null}],"usage":null,"obfuscation":"oW83oAqN8LN0j"} + + data: {"id":"chatcmpl-CLuTHAaTVsp8OsvvS0iE8hCQ4sjxd","object":"chat.completion.chunk","created":1759337999,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/open"}}]},"finish_reason":null}],"usage":null,"obfuscation":"Ct3CYw4jlEfnN"} + + data: {"id":"chatcmpl-CLuTHAaTVsp8OsvvS0iE8hCQ4sjxd","object":"chat.completion.chunk","created":1759337999,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ai"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + + data: {"id":"chatcmpl-CLuTHAaTVsp8OsvvS0iE8hCQ4sjxd","object":"chat.completion.chunk","created":1759337999,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"-g"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + + data: {"id":"chatcmpl-CLuTHAaTVsp8OsvvS0iE8hCQ4sjxd","object":"chat.completion.chunk","created":1759337999,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"pt"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + + data: {"id":"chatcmpl-CLuTHAaTVsp8OsvvS0iE8hCQ4sjxd","object":"chat.completion.chunk","created":1759337999,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"-"}}]},"finish_reason":null}],"usage":null,"obfuscation":"Z"} + + data: {"id":"chatcmpl-CLuTHAaTVsp8OsvvS0iE8hCQ4sjxd","object":"chat.completion.chunk","created":1759337999,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"5"}}]},"finish_reason":null}],"usage":null,"obfuscation":"b"} + + data: {"id":"chatcmpl-CLuTHAaTVsp8OsvvS0iE8hCQ4sjxd","object":"chat.completion.chunk","created":1759337999,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/bash"}}]},"finish_reason":null}],"usage":null,"obfuscation":"k1lop4IHyg5oD"} + + data: {"id":"chatcmpl-CLuTHAaTVsp8OsvvS0iE8hCQ4sjxd","object":"chat.completion.chunk","created":1759337999,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_tool"}}]},"finish_reason":null}],"usage":null,"obfuscation":"fGcA2cnhpBoXx"} + + data: {"id":"chatcmpl-CLuTHAaTVsp8OsvvS0iE8hCQ4sjxd","object":"chat.completion.chunk","created":1759337999,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/test"}}]},"finish_reason":null}],"usage":null,"obfuscation":"0NQ1uk9M6gykw"} + + data: {"id":"chatcmpl-CLuTHAaTVsp8OsvvS0iE8hCQ4sjxd","object":"chat.completion.chunk","created":1759337999,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":".txt"}}]},"finish_reason":null}],"usage":null,"obfuscation":"5kjeiDqHkF67pU"} + + data: {"id":"chatcmpl-CLuTHAaTVsp8OsvvS0iE8hCQ4sjxd","object":"chat.completion.chunk","created":1759337999,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"}"}}]},"finish_reason":null}],"usage":null,"obfuscation":"87oT49enICsqPUP"} + + data: {"id":"chatcmpl-CLuTHAaTVsp8OsvvS0iE8hCQ4sjxd","object":"chat.completion.chunk","created":1759337999,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"tool_calls"}],"usage":null,"obfuscation":""} + + data: {"id":"chatcmpl-CLuTHAaTVsp8OsvvS0iE8hCQ4sjxd","object":"chat.completion.chunk","created":1759337999,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6709,"completion_tokens":232,"total_tokens":6941,"prompt_tokens_details":{"cached_tokens":6528,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":192,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"Y"} + + data: [DONE] + + headers: + Content-Type: + - text/event-stream; charset=utf-8 + status: 200 OK + code: 200 + duration: 5.900767917s +- id: 4 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 30934 + content_length: 31773 host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/bash_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use bash to create a file named test.txt with content 'hello bash'\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"call_PKAZWFdeGn6acNZv9McuTXSJ\",\"function\":{\"arguments\":\"{\\\"command\\\":\\\"printf 'hello bash' > test.txt\\\",\\\"description\\\":\\\"Create test.txt containing 'hello bash' without trailing newline\\\"}\",\"name\":\"bash\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"no output\",\"tool_call_id\":\"call_PKAZWFdeGn6acNZv9McuTXSJ\",\"role\":\"tool\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/bash_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use bash to create a file named test.txt with content 'hello bash'\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"call_iThmRuWrEf4um0WjWGEDKVP9\",\"function\":{\"arguments\":\"{\\\"path\\\": \\\"/tmp/crush-test/TestCoderAgent/openai-gpt-5/bash_tool\\\"}\",\"name\":\"ls\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"\\n- /tmp/crush-test/TestCoderAgent/openai-gpt-5/bash_tool/\\n - go.mod\\n - main.go\\n\",\"tool_call_id\":\"call_iThmRuWrEf4um0WjWGEDKVP9\",\"role\":\"tool\"},{\"tool_calls\":[{\"id\":\"call_y7Qtxv3GotPubJ8J9Sj5oFeG\",\"function\":{\"arguments\":\"{\\\"command\\\":\\\"printf %s 'hello bash' > /tmp/crush-test/TestCoderAgent/openai-gpt-5/bash_tool/test.txt\\\",\\\"description\\\":\\\"Create test.txt with exact content 'hello bash' in the current project directory.\\\"}\",\"name\":\"bash\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"no output\",\"tool_call_id\":\"call_y7Qtxv3GotPubJ8J9Sj5oFeG\",\"role\":\"tool\"},{\"tool_calls\":[{\"id\":\"call_LITAJ86OKR49X11rVJxrl2fs\",\"function\":{\"arguments\":\"{\\\"file_path\\\":\\\"/tmp/crush-test/TestCoderAgent/openai-gpt-5/bash_tool/test.txt\\\"}\",\"name\":\"view\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"\\n 1|hello bash\\n\\n\",\"tool_call_id\":\"call_LITAJ86OKR49X11rVJxrl2fs\",\"role\":\"tool\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" headers: Accept: - application/json @@ -166,13 +368,13 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"chatcmpl-CLu8dMuetJeLkpoDlq4GEupbiLWiH","object":"chat.completion.chunk","created":1759336719,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"laAuocXRgC"} + data: {"id":"chatcmpl-CLuTOEjGlmHd7uRRFC3fltsg3z6VU","object":"chat.completion.chunk","created":1759338006,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"WdhUTy2Uoi"} - data: {"id":"chatcmpl-CLu8dMuetJeLkpoDlq4GEupbiLWiH","object":"chat.completion.chunk","created":1759336719,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"done"},"finish_reason":null}],"usage":null,"obfuscation":"fQEGD0M8"} + data: {"id":"chatcmpl-CLuTOEjGlmHd7uRRFC3fltsg3z6VU","object":"chat.completion.chunk","created":1759338006,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"done"},"finish_reason":null}],"usage":null,"obfuscation":"AGXieqjy"} - data: {"id":"chatcmpl-CLu8dMuetJeLkpoDlq4GEupbiLWiH","object":"chat.completion.chunk","created":1759336719,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"stop"}],"usage":null,"obfuscation":"any7ua"} + data: {"id":"chatcmpl-CLuTOEjGlmHd7uRRFC3fltsg3z6VU","object":"chat.completion.chunk","created":1759338006,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"stop"}],"usage":null,"obfuscation":"YzYgLf"} - data: {"id":"chatcmpl-CLu8dMuetJeLkpoDlq4GEupbiLWiH","object":"chat.completion.chunk","created":1759336719,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6605,"completion_tokens":4,"total_tokens":6609,"prompt_tokens_details":{"cached_tokens":6528,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"ft1at"} + data: {"id":"chatcmpl-CLuTOEjGlmHd7uRRFC3fltsg3z6VU","object":"chat.completion.chunk","created":1759338006,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6766,"completion_tokens":4,"total_tokens":6770,"prompt_tokens_details":{"cached_tokens":6656,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"0zlBc"} data: [DONE] @@ -181,4 +383,4 @@ interactions: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 2.177676042s + duration: 2.866661208s diff --git a/internal/agent/testdata/TestCoderAgent/openai-gpt-5/download_tool.yaml b/internal/agent/testdata/TestCoderAgent/openai-gpt-5/download_tool.yaml index 41276ae6b88d2be9dcc4d9d09dfa90af2dd7144b..ca9451cd0dcd1257c25eccb65af8210e26a62a3c 100644 --- a/internal/agent/testdata/TestCoderAgent/openai-gpt-5/download_tool.yaml +++ b/internal/agent/testdata/TestCoderAgent/openai-gpt-5/download_tool.yaml @@ -24,23 +24,25 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"chatcmpl-CLu8fLNREV3nFHUQT1Yo6URgEheKQ","object":"chat.completion.chunk","created":1759336721,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"R56sQfdQhlr97L"} + data: {"id":"chatcmpl-CLuTQdlXjkMiYRWMf7AHC2GVmn5vg","object":"chat.completion.chunk","created":1759338008,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"3pINgDb7EjG7Bu"} - data: {"id":"chatcmpl-CLu8fLNREV3nFHUQT1Yo6URgEheKQ","object":"chat.completion.chunk","created":1759336721,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"Download"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"bIHe5Edu"} + data: {"id":"chatcmpl-CLuTQdlXjkMiYRWMf7AHC2GVmn5vg","object":"chat.completion.chunk","created":1759338008,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"Download"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"IVG3y00i"} - data: {"id":"chatcmpl-CLu8fLNREV3nFHUQT1Yo6URgEheKQ","object":"chat.completion.chunk","created":1759336721,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" and"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"IVmQrrkAAxgU"} + data: {"id":"chatcmpl-CLuTQdlXjkMiYRWMf7AHC2GVmn5vg","object":"chat.completion.chunk","created":1759338008,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" and"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"mLi9mcvlihsS"} - data: {"id":"chatcmpl-CLu8fLNREV3nFHUQT1Yo6URgEheKQ","object":"chat.completion.chunk","created":1759336721,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Save"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"HF4cvdPYhVO"} + data: {"id":"chatcmpl-CLuTQdlXjkMiYRWMf7AHC2GVmn5vg","object":"chat.completion.chunk","created":1759338008,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Save"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"gGiUqwTqKFt"} - data: {"id":"chatcmpl-CLu8fLNREV3nFHUQT1Yo6URgEheKQ","object":"chat.completion.chunk","created":1759336721,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" File"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"dYlMboYzKkE"} + data: {"id":"chatcmpl-CLuTQdlXjkMiYRWMf7AHC2GVmn5vg","object":"chat.completion.chunk","created":1759338008,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" robots"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"JQdi4ipuU"} - data: {"id":"chatcmpl-CLu8fLNREV3nFHUQT1Yo6URgEheKQ","object":"chat.completion.chunk","created":1759336721,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" from"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"tVyQojoiriI"} + data: {"id":"chatcmpl-CLuTQdlXjkMiYRWMf7AHC2GVmn5vg","object":"chat.completion.chunk","created":1759338008,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":".txt"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"VJDAu0it7YNp"} - data: {"id":"chatcmpl-CLu8fLNREV3nFHUQT1Yo6URgEheKQ","object":"chat.completion.chunk","created":1759336721,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" URL"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"fBUfut1Iq1C0"} + data: {"id":"chatcmpl-CLuTQdlXjkMiYRWMf7AHC2GVmn5vg","object":"chat.completion.chunk","created":1759338008,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" from"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"hfhMOapEM5w"} - data: {"id":"chatcmpl-CLu8fLNREV3nFHUQT1Yo6URgEheKQ","object":"chat.completion.chunk","created":1759336721,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"v7SYBbIKSC"} + data: {"id":"chatcmpl-CLuTQdlXjkMiYRWMf7AHC2GVmn5vg","object":"chat.completion.chunk","created":1759338008,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" URL"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"SE7K0yBXk0ng"} - data: {"id":"chatcmpl-CLu8fLNREV3nFHUQT1Yo6URgEheKQ","object":"chat.completion.chunk","created":1759336721,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[],"usage":{"prompt_tokens":126,"completion_tokens":6,"total_tokens":132,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"B4rzpzyA5MlGnm"} + data: {"id":"chatcmpl-CLuTQdlXjkMiYRWMf7AHC2GVmn5vg","object":"chat.completion.chunk","created":1759338008,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"cM9ZqBhMeE"} + + data: {"id":"chatcmpl-CLuTQdlXjkMiYRWMf7AHC2GVmn5vg","object":"chat.completion.chunk","created":1759338008,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[],"usage":{"prompt_tokens":126,"completion_tokens":7,"total_tokens":133,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"NcZiVzFNt8fXIn"} data: [DONE] @@ -49,15 +51,15 @@ interactions: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 887.479375ms + duration: 1.219465584s - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 30598 + content_length: 30671 host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/download_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"download the file from https://httpbin.org/robots.txt and save it as robots.txt\",\"role\":\"user\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/download_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"download the file from https://httpbin.org/robots.txt and save it as robots.txt\",\"role\":\"user\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" headers: Accept: - application/json @@ -73,55 +75,55 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"chatcmpl-CLu8fJWqj8M5Arjte6G5eKgAFBVJu","object":"chat.completion.chunk","created":1759336721,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"call_1mCBTElvjDZ9QEJY3Bor46sw","type":"function","function":{"name":"download","arguments":""}}],"refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"Z2i6BeEe"} + data: {"id":"chatcmpl-CLuTQNtUuuZFtak9rsPg4o25mQPep","object":"chat.completion.chunk","created":1759338008,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"call_lO5rUd6OeUJVNhJdS9PkX1r6","type":"function","function":{"name":"download","arguments":""}}],"refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"qM8ddeZk"} - data: {"id":"chatcmpl-CLu8fJWqj8M5Arjte6G5eKgAFBVJu","object":"chat.completion.chunk","created":1759336721,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"vDMH9VkwmuqY8Nu"} + data: {"id":"chatcmpl-CLuTQNtUuuZFtak9rsPg4o25mQPep","object":"chat.completion.chunk","created":1759338008,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"CfF5meHcZiylxBi"} - data: {"id":"chatcmpl-CLu8fJWqj8M5Arjte6G5eKgAFBVJu","object":"chat.completion.chunk","created":1759336721,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"file"}}]},"finish_reason":null}],"usage":null,"obfuscation":"LB6NFeMs2J2vZ9"} + data: {"id":"chatcmpl-CLuTQNtUuuZFtak9rsPg4o25mQPep","object":"chat.completion.chunk","created":1759338008,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"url"}}]},"finish_reason":null}],"usage":null,"obfuscation":"vNvGfR8FDUIzAIb"} - data: {"id":"chatcmpl-CLu8fJWqj8M5Arjte6G5eKgAFBVJu","object":"chat.completion.chunk","created":1759336721,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_path"}}]},"finish_reason":null}],"usage":null,"obfuscation":"laAMxUOgkoiLe"} + data: {"id":"chatcmpl-CLuTQNtUuuZFtak9rsPg4o25mQPep","object":"chat.completion.chunk","created":1759338008,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"ylTDHfoDVuU2j"} - data: {"id":"chatcmpl-CLu8fJWqj8M5Arjte6G5eKgAFBVJu","object":"chat.completion.chunk","created":1759336721,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"hIbdRmeVnWveY"} + data: {"id":"chatcmpl-CLuTQNtUuuZFtak9rsPg4o25mQPep","object":"chat.completion.chunk","created":1759338008,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"https"}}]},"finish_reason":null}],"usage":null,"obfuscation":"lz5YGo3wrhcXu"} - data: {"id":"chatcmpl-CLu8fJWqj8M5Arjte6G5eKgAFBVJu","object":"chat.completion.chunk","created":1759336721,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"robots"}}]},"finish_reason":null}],"usage":null,"obfuscation":"mocMRDkTgN1k"} + data: {"id":"chatcmpl-CLuTQNtUuuZFtak9rsPg4o25mQPep","object":"chat.completion.chunk","created":1759338008,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"://"}}]},"finish_reason":null}],"usage":null,"obfuscation":"I1uDCdI4v6o6NKn"} - data: {"id":"chatcmpl-CLu8fJWqj8M5Arjte6G5eKgAFBVJu","object":"chat.completion.chunk","created":1759336721,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":".txt"}}]},"finish_reason":null}],"usage":null,"obfuscation":"VthK2ZQSucoSKt"} + data: {"id":"chatcmpl-CLuTQNtUuuZFtak9rsPg4o25mQPep","object":"chat.completion.chunk","created":1759338008,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"http"}}]},"finish_reason":null}],"usage":null,"obfuscation":"fQp8hXR3XutTVN"} - data: {"id":"chatcmpl-CLu8fJWqj8M5Arjte6G5eKgAFBVJu","object":"chat.completion.chunk","created":1759336721,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\",\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"FC1RmzDf0hmxw"} + data: {"id":"chatcmpl-CLuTQNtUuuZFtak9rsPg4o25mQPep","object":"chat.completion.chunk","created":1759338008,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"bin"}}]},"finish_reason":null}],"usage":null,"obfuscation":"yuJlDuZiBmDWcfb"} - data: {"id":"chatcmpl-CLu8fJWqj8M5Arjte6G5eKgAFBVJu","object":"chat.completion.chunk","created":1759336721,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"url"}}]},"finish_reason":null}],"usage":null,"obfuscation":"f2eXBFp4C1Fg7KH"} + data: {"id":"chatcmpl-CLuTQNtUuuZFtak9rsPg4o25mQPep","object":"chat.completion.chunk","created":1759338008,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":".org"}}]},"finish_reason":null}],"usage":null,"obfuscation":"vBwnNi50zxX5fH"} - data: {"id":"chatcmpl-CLu8fJWqj8M5Arjte6G5eKgAFBVJu","object":"chat.completion.chunk","created":1759336721,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"lJUoTlJlXCEbf"} + data: {"id":"chatcmpl-CLuTQNtUuuZFtak9rsPg4o25mQPep","object":"chat.completion.chunk","created":1759338008,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/"}}]},"finish_reason":null}],"usage":null,"obfuscation":"2"} - data: {"id":"chatcmpl-CLu8fJWqj8M5Arjte6G5eKgAFBVJu","object":"chat.completion.chunk","created":1759336721,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"https"}}]},"finish_reason":null}],"usage":null,"obfuscation":"59ouJEjdJ0gHP"} + data: {"id":"chatcmpl-CLuTQNtUuuZFtak9rsPg4o25mQPep","object":"chat.completion.chunk","created":1759338008,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"robots"}}]},"finish_reason":null}],"usage":null,"obfuscation":"wz24mBovproZ"} - data: {"id":"chatcmpl-CLu8fJWqj8M5Arjte6G5eKgAFBVJu","object":"chat.completion.chunk","created":1759336721,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"://"}}]},"finish_reason":null}],"usage":null,"obfuscation":"VHWhK5tI97l1Cgn"} + data: {"id":"chatcmpl-CLuTQNtUuuZFtak9rsPg4o25mQPep","object":"chat.completion.chunk","created":1759338008,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":".txt"}}]},"finish_reason":null}],"usage":null,"obfuscation":"YVGNwjzLjDkla8"} - data: {"id":"chatcmpl-CLu8fJWqj8M5Arjte6G5eKgAFBVJu","object":"chat.completion.chunk","created":1759336721,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"http"}}]},"finish_reason":null}],"usage":null,"obfuscation":"0lxuBa0iDkPJvK"} + data: {"id":"chatcmpl-CLuTQNtUuuZFtak9rsPg4o25mQPep","object":"chat.completion.chunk","created":1759338008,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\",\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"sW8KMYRGymxWt"} - data: {"id":"chatcmpl-CLu8fJWqj8M5Arjte6G5eKgAFBVJu","object":"chat.completion.chunk","created":1759336721,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"bin"}}]},"finish_reason":null}],"usage":null,"obfuscation":"6uOF5ZFCZOjqhSm"} + data: {"id":"chatcmpl-CLuTQNtUuuZFtak9rsPg4o25mQPep","object":"chat.completion.chunk","created":1759338008,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"file"}}]},"finish_reason":null}],"usage":null,"obfuscation":"9nEYzANtPRDkBk"} - data: {"id":"chatcmpl-CLu8fJWqj8M5Arjte6G5eKgAFBVJu","object":"chat.completion.chunk","created":1759336721,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":".org"}}]},"finish_reason":null}],"usage":null,"obfuscation":"kw7sJwONmtckWL"} + data: {"id":"chatcmpl-CLuTQNtUuuZFtak9rsPg4o25mQPep","object":"chat.completion.chunk","created":1759338008,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_path"}}]},"finish_reason":null}],"usage":null,"obfuscation":"EKX5Kv5h8yHDt"} - data: {"id":"chatcmpl-CLu8fJWqj8M5Arjte6G5eKgAFBVJu","object":"chat.completion.chunk","created":1759336721,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/"}}]},"finish_reason":null}],"usage":null,"obfuscation":"7"} + data: {"id":"chatcmpl-CLuTQNtUuuZFtak9rsPg4o25mQPep","object":"chat.completion.chunk","created":1759338008,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"0Az1FhF7BV1BV"} - data: {"id":"chatcmpl-CLu8fJWqj8M5Arjte6G5eKgAFBVJu","object":"chat.completion.chunk","created":1759336721,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"robots"}}]},"finish_reason":null}],"usage":null,"obfuscation":"tgPkgN9j4L5p"} + data: {"id":"chatcmpl-CLuTQNtUuuZFtak9rsPg4o25mQPep","object":"chat.completion.chunk","created":1759338008,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"robots"}}]},"finish_reason":null}],"usage":null,"obfuscation":"Zyk57ZGto4iX"} - data: {"id":"chatcmpl-CLu8fJWqj8M5Arjte6G5eKgAFBVJu","object":"chat.completion.chunk","created":1759336721,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":".txt"}}]},"finish_reason":null}],"usage":null,"obfuscation":"uWXu5OMqn6bk9p"} + data: {"id":"chatcmpl-CLuTQNtUuuZFtak9rsPg4o25mQPep","object":"chat.completion.chunk","created":1759338008,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":".txt"}}]},"finish_reason":null}],"usage":null,"obfuscation":"fbGZB5g43KHzuK"} - data: {"id":"chatcmpl-CLu8fJWqj8M5Arjte6G5eKgAFBVJu","object":"chat.completion.chunk","created":1759336721,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\",\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"djIFILQhn3rcK"} + data: {"id":"chatcmpl-CLuTQNtUuuZFtak9rsPg4o25mQPep","object":"chat.completion.chunk","created":1759338008,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\",\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"9MKcSeiKrfY7U"} - data: {"id":"chatcmpl-CLu8fJWqj8M5Arjte6G5eKgAFBVJu","object":"chat.completion.chunk","created":1759336721,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"timeout"}}]},"finish_reason":null}],"usage":null,"obfuscation":"KtxdPrqJVJx"} + data: {"id":"chatcmpl-CLuTQNtUuuZFtak9rsPg4o25mQPep","object":"chat.completion.chunk","created":1759338008,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"timeout"}}]},"finish_reason":null}],"usage":null,"obfuscation":"NYOImPhymQn"} - data: {"id":"chatcmpl-CLu8fJWqj8M5Arjte6G5eKgAFBVJu","object":"chat.completion.chunk","created":1759336721,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":"}}]},"finish_reason":null}],"usage":null,"obfuscation":"OjU6SpC7jtteS68"} + data: {"id":"chatcmpl-CLuTQNtUuuZFtak9rsPg4o25mQPep","object":"chat.completion.chunk","created":1759338008,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":"}}]},"finish_reason":null}],"usage":null,"obfuscation":"IvDak7MqqYyIYGe"} - data: {"id":"chatcmpl-CLu8fJWqj8M5Arjte6G5eKgAFBVJu","object":"chat.completion.chunk","created":1759336721,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"60"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuTQNtUuuZFtak9rsPg4o25mQPep","object":"chat.completion.chunk","created":1759338008,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"60"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLu8fJWqj8M5Arjte6G5eKgAFBVJu","object":"chat.completion.chunk","created":1759336721,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"}"}}]},"finish_reason":null}],"usage":null,"obfuscation":"t"} + data: {"id":"chatcmpl-CLuTQNtUuuZFtak9rsPg4o25mQPep","object":"chat.completion.chunk","created":1759338008,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"}"}}]},"finish_reason":null}],"usage":null,"obfuscation":"W"} - data: {"id":"chatcmpl-CLu8fJWqj8M5Arjte6G5eKgAFBVJu","object":"chat.completion.chunk","created":1759336721,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"tool_calls"}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuTQNtUuuZFtak9rsPg4o25mQPep","object":"chat.completion.chunk","created":1759338008,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"tool_calls"}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLu8fJWqj8M5Arjte6G5eKgAFBVJu","object":"chat.completion.chunk","created":1759336721,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6558,"completion_tokens":103,"total_tokens":6661,"prompt_tokens_details":{"cached_tokens":1024,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":64,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"Jq"} + data: {"id":"chatcmpl-CLuTQNtUuuZFtak9rsPg4o25mQPep","object":"chat.completion.chunk","created":1759338008,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6568,"completion_tokens":231,"total_tokens":6799,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":192,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"vwQu"} data: [DONE] @@ -130,7 +132,7 @@ interactions: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 3.524579958s + duration: 6.379873834s - id: 2 request: proto: HTTP/1.1 @@ -143,319 +145,6 @@ interactions: - crush/1.0 url: https://httpbin.org/robots.txt method: GET - response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - content_length: 162 - body: "\r\n503 Service Temporarily Unavailable\r\n\r\n

503 Service Temporarily Unavailable

\r\n\r\n\r\n" - headers: - Content-Type: - - text/html - status: 503 Service Unavailable - code: 503 - duration: 622.665625ms -- id: 3 - request: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - content_length: 30937 - host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/download_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"download the file from https://httpbin.org/robots.txt and save it as robots.txt\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"call_1mCBTElvjDZ9QEJY3Bor46sw\",\"function\":{\"arguments\":\"{\\\"file_path\\\":\\\"robots.txt\\\",\\\"url\\\":\\\"https://httpbin.org/robots.txt\\\",\\\"timeout\\\":60}\",\"name\":\"download\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"Request failed with status code: 503\",\"tool_call_id\":\"call_1mCBTElvjDZ9QEJY3Bor46sw\",\"role\":\"tool\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" - headers: - Accept: - - application/json - Content-Type: - - application/json - User-Agent: - - OpenAI/Go 2.3.0 - url: https://api.openai.com/v1/chat/completions - method: POST - response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - content_length: -1 - body: |+ - data: {"id":"chatcmpl-CLu8kYlFwFeAf2X2bKo311MWB8ZiD","object":"chat.completion.chunk","created":1759336726,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"call_MYyfodKjeLZfFAkDCERUwzQ6","type":"function","function":{"name":"fetch","arguments":""}}],"refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"T0iUI66IY37"} - - data: {"id":"chatcmpl-CLu8kYlFwFeAf2X2bKo311MWB8ZiD","object":"chat.completion.chunk","created":1759336726,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"Ib8EGaNyBImMAFH"} - - data: {"id":"chatcmpl-CLu8kYlFwFeAf2X2bKo311MWB8ZiD","object":"chat.completion.chunk","created":1759336726,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"url"}}]},"finish_reason":null}],"usage":null,"obfuscation":"R0b1WmxAYLhaTCc"} - - data: {"id":"chatcmpl-CLu8kYlFwFeAf2X2bKo311MWB8ZiD","object":"chat.completion.chunk","created":1759336726,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"e2zTef6w13zWC"} - - data: {"id":"chatcmpl-CLu8kYlFwFeAf2X2bKo311MWB8ZiD","object":"chat.completion.chunk","created":1759336726,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"https"}}]},"finish_reason":null}],"usage":null,"obfuscation":"bEhbx0Z0iONMq"} - - data: {"id":"chatcmpl-CLu8kYlFwFeAf2X2bKo311MWB8ZiD","object":"chat.completion.chunk","created":1759336726,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"://"}}]},"finish_reason":null}],"usage":null,"obfuscation":"OBWAu62WUlqnS5j"} - - data: {"id":"chatcmpl-CLu8kYlFwFeAf2X2bKo311MWB8ZiD","object":"chat.completion.chunk","created":1759336726,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"http"}}]},"finish_reason":null}],"usage":null,"obfuscation":"QnZqbbylbcZ4GF"} - - data: {"id":"chatcmpl-CLu8kYlFwFeAf2X2bKo311MWB8ZiD","object":"chat.completion.chunk","created":1759336726,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"bin"}}]},"finish_reason":null}],"usage":null,"obfuscation":"3HvwLu6ofWubfhC"} - - data: {"id":"chatcmpl-CLu8kYlFwFeAf2X2bKo311MWB8ZiD","object":"chat.completion.chunk","created":1759336726,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":".org"}}]},"finish_reason":null}],"usage":null,"obfuscation":"j5SjRJC5krU0Ng"} - - data: {"id":"chatcmpl-CLu8kYlFwFeAf2X2bKo311MWB8ZiD","object":"chat.completion.chunk","created":1759336726,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/"}}]},"finish_reason":null}],"usage":null,"obfuscation":"8"} - - data: {"id":"chatcmpl-CLu8kYlFwFeAf2X2bKo311MWB8ZiD","object":"chat.completion.chunk","created":1759336726,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"robots"}}]},"finish_reason":null}],"usage":null,"obfuscation":"XXciZIiT8lfT"} - - data: {"id":"chatcmpl-CLu8kYlFwFeAf2X2bKo311MWB8ZiD","object":"chat.completion.chunk","created":1759336726,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":".txt"}}]},"finish_reason":null}],"usage":null,"obfuscation":"JeWcYX8abfkdH3"} - - data: {"id":"chatcmpl-CLu8kYlFwFeAf2X2bKo311MWB8ZiD","object":"chat.completion.chunk","created":1759336726,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\",\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"KBBBlQHkJNLJj"} - - data: {"id":"chatcmpl-CLu8kYlFwFeAf2X2bKo311MWB8ZiD","object":"chat.completion.chunk","created":1759336726,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"format"}}]},"finish_reason":null}],"usage":null,"obfuscation":"NGytdKjDHFQn"} - - data: {"id":"chatcmpl-CLu8kYlFwFeAf2X2bKo311MWB8ZiD","object":"chat.completion.chunk","created":1759336726,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"xLSqVPoDYTO8a"} - - data: {"id":"chatcmpl-CLu8kYlFwFeAf2X2bKo311MWB8ZiD","object":"chat.completion.chunk","created":1759336726,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"text"}}]},"finish_reason":null}],"usage":null,"obfuscation":"jMVcudOZWirbKA"} - - data: {"id":"chatcmpl-CLu8kYlFwFeAf2X2bKo311MWB8ZiD","object":"chat.completion.chunk","created":1759336726,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\",\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"096nWrJRDarTG"} - - data: {"id":"chatcmpl-CLu8kYlFwFeAf2X2bKo311MWB8ZiD","object":"chat.completion.chunk","created":1759336726,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"timeout"}}]},"finish_reason":null}],"usage":null,"obfuscation":"zv51Lj9Q2H9"} - - data: {"id":"chatcmpl-CLu8kYlFwFeAf2X2bKo311MWB8ZiD","object":"chat.completion.chunk","created":1759336726,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":"}}]},"finish_reason":null}],"usage":null,"obfuscation":"YOq6q3zsmJDZtTc"} - - data: {"id":"chatcmpl-CLu8kYlFwFeAf2X2bKo311MWB8ZiD","object":"chat.completion.chunk","created":1759336726,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"60"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - - data: {"id":"chatcmpl-CLu8kYlFwFeAf2X2bKo311MWB8ZiD","object":"chat.completion.chunk","created":1759336726,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"}"}}]},"finish_reason":null}],"usage":null,"obfuscation":"y"} - - data: {"id":"chatcmpl-CLu8kYlFwFeAf2X2bKo311MWB8ZiD","object":"chat.completion.chunk","created":1759336726,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"tool_calls"}],"usage":null,"obfuscation":""} - - data: {"id":"chatcmpl-CLu8kYlFwFeAf2X2bKo311MWB8ZiD","object":"chat.completion.chunk","created":1759336726,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6609,"completion_tokens":293,"total_tokens":6902,"prompt_tokens_details":{"cached_tokens":6528,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":256,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"4"} - - data: [DONE] - - headers: - Content-Type: - - text/event-stream; charset=utf-8 - status: 200 OK - code: 200 - duration: 6.070651875s -- id: 4 - request: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - content_length: 0 - host: httpbin.org - headers: - User-Agent: - - crush/1.0 - url: https://httpbin.org/robots.txt - method: GET - response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - content_length: 162 - body: "\r\n503 Service Temporarily Unavailable\r\n\r\n

503 Service Temporarily Unavailable

\r\n\r\n\r\n" - headers: - Content-Type: - - text/html - status: 503 Service Unavailable - code: 503 - duration: 132.621375ms -- id: 5 - request: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - content_length: 31264 - host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/download_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"download the file from https://httpbin.org/robots.txt and save it as robots.txt\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"call_1mCBTElvjDZ9QEJY3Bor46sw\",\"function\":{\"arguments\":\"{\\\"file_path\\\":\\\"robots.txt\\\",\\\"url\\\":\\\"https://httpbin.org/robots.txt\\\",\\\"timeout\\\":60}\",\"name\":\"download\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"Request failed with status code: 503\",\"tool_call_id\":\"call_1mCBTElvjDZ9QEJY3Bor46sw\",\"role\":\"tool\"},{\"tool_calls\":[{\"id\":\"call_MYyfodKjeLZfFAkDCERUwzQ6\",\"function\":{\"arguments\":\"{\\\"url\\\":\\\"https://httpbin.org/robots.txt\\\",\\\"format\\\":\\\"text\\\",\\\"timeout\\\":60}\",\"name\":\"fetch\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"Request failed with status code: 503\",\"tool_call_id\":\"call_MYyfodKjeLZfFAkDCERUwzQ6\",\"role\":\"tool\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" - headers: - Accept: - - application/json - Content-Type: - - application/json - User-Agent: - - OpenAI/Go 2.3.0 - url: https://api.openai.com/v1/chat/completions - method: POST - response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - content_length: -1 - body: |+ - data: {"id":"chatcmpl-CLu8qFDtjucgxNLWoeTxOL10nBbvT","object":"chat.completion.chunk","created":1759336732,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"call_Bj50giAxqbkCB3Vija34LmgI","type":"function","function":{"name":"download","arguments":""}}],"refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"8egiGtkJ"} - - data: {"id":"chatcmpl-CLu8qFDtjucgxNLWoeTxOL10nBbvT","object":"chat.completion.chunk","created":1759336732,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"zrlzgOrNdUfXHJO"} - - data: {"id":"chatcmpl-CLu8qFDtjucgxNLWoeTxOL10nBbvT","object":"chat.completion.chunk","created":1759336732,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"file"}}]},"finish_reason":null}],"usage":null,"obfuscation":"KxnDdh4iUkN9Ur"} - - data: {"id":"chatcmpl-CLu8qFDtjucgxNLWoeTxOL10nBbvT","object":"chat.completion.chunk","created":1759336732,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_path"}}]},"finish_reason":null}],"usage":null,"obfuscation":"mzhvKVe0CFjtb"} - - data: {"id":"chatcmpl-CLu8qFDtjucgxNLWoeTxOL10nBbvT","object":"chat.completion.chunk","created":1759336732,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"I5OTa0z2FszII"} - - data: {"id":"chatcmpl-CLu8qFDtjucgxNLWoeTxOL10nBbvT","object":"chat.completion.chunk","created":1759336732,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"robots"}}]},"finish_reason":null}],"usage":null,"obfuscation":"Xvtqvvx9y8Ov"} - - data: {"id":"chatcmpl-CLu8qFDtjucgxNLWoeTxOL10nBbvT","object":"chat.completion.chunk","created":1759336732,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":".txt"}}]},"finish_reason":null}],"usage":null,"obfuscation":"R4Oq7covfbQH9E"} - - data: {"id":"chatcmpl-CLu8qFDtjucgxNLWoeTxOL10nBbvT","object":"chat.completion.chunk","created":1759336732,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\",\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"pst4cklHbLHpk"} - - data: {"id":"chatcmpl-CLu8qFDtjucgxNLWoeTxOL10nBbvT","object":"chat.completion.chunk","created":1759336732,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"url"}}]},"finish_reason":null}],"usage":null,"obfuscation":"aIY2IXkEBSLVEc5"} - - data: {"id":"chatcmpl-CLu8qFDtjucgxNLWoeTxOL10nBbvT","object":"chat.completion.chunk","created":1759336732,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"pPhq1PLTTNZId"} - - data: {"id":"chatcmpl-CLu8qFDtjucgxNLWoeTxOL10nBbvT","object":"chat.completion.chunk","created":1759336732,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"http"}}]},"finish_reason":null}],"usage":null,"obfuscation":"FAELnlcZPhGKFt"} - - data: {"id":"chatcmpl-CLu8qFDtjucgxNLWoeTxOL10nBbvT","object":"chat.completion.chunk","created":1759336732,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"://"}}]},"finish_reason":null}],"usage":null,"obfuscation":"kLj8oSuSJ3g6FdR"} - - data: {"id":"chatcmpl-CLu8qFDtjucgxNLWoeTxOL10nBbvT","object":"chat.completion.chunk","created":1759336732,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"http"}}]},"finish_reason":null}],"usage":null,"obfuscation":"wUqXDVmVkLi3Ty"} - - data: {"id":"chatcmpl-CLu8qFDtjucgxNLWoeTxOL10nBbvT","object":"chat.completion.chunk","created":1759336732,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"bin"}}]},"finish_reason":null}],"usage":null,"obfuscation":"iqIqBLMcKukBEq6"} - - data: {"id":"chatcmpl-CLu8qFDtjucgxNLWoeTxOL10nBbvT","object":"chat.completion.chunk","created":1759336732,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":".org"}}]},"finish_reason":null}],"usage":null,"obfuscation":"134YNg5Qjtj5cu"} - - data: {"id":"chatcmpl-CLu8qFDtjucgxNLWoeTxOL10nBbvT","object":"chat.completion.chunk","created":1759336732,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/"}}]},"finish_reason":null}],"usage":null,"obfuscation":"8"} - - data: {"id":"chatcmpl-CLu8qFDtjucgxNLWoeTxOL10nBbvT","object":"chat.completion.chunk","created":1759336732,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"robots"}}]},"finish_reason":null}],"usage":null,"obfuscation":"lznsvPhVsoxi"} - - data: {"id":"chatcmpl-CLu8qFDtjucgxNLWoeTxOL10nBbvT","object":"chat.completion.chunk","created":1759336732,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":".txt"}}]},"finish_reason":null}],"usage":null,"obfuscation":"AlCGBJIpsCCKRO"} - - data: {"id":"chatcmpl-CLu8qFDtjucgxNLWoeTxOL10nBbvT","object":"chat.completion.chunk","created":1759336732,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\",\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"y11zxSZfYrC2p"} - - data: {"id":"chatcmpl-CLu8qFDtjucgxNLWoeTxOL10nBbvT","object":"chat.completion.chunk","created":1759336732,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"timeout"}}]},"finish_reason":null}],"usage":null,"obfuscation":"sbaQrUrHvQg"} - - data: {"id":"chatcmpl-CLu8qFDtjucgxNLWoeTxOL10nBbvT","object":"chat.completion.chunk","created":1759336732,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":"}}]},"finish_reason":null}],"usage":null,"obfuscation":"DTVdCtIkhgOOtdy"} - - data: {"id":"chatcmpl-CLu8qFDtjucgxNLWoeTxOL10nBbvT","object":"chat.completion.chunk","created":1759336732,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"60"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - - data: {"id":"chatcmpl-CLu8qFDtjucgxNLWoeTxOL10nBbvT","object":"chat.completion.chunk","created":1759336732,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"}"}}]},"finish_reason":null}],"usage":null,"obfuscation":"X"} - - data: {"id":"chatcmpl-CLu8qFDtjucgxNLWoeTxOL10nBbvT","object":"chat.completion.chunk","created":1759336732,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"tool_calls"}],"usage":null,"obfuscation":""} - - data: {"id":"chatcmpl-CLu8qFDtjucgxNLWoeTxOL10nBbvT","object":"chat.completion.chunk","created":1759336732,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6658,"completion_tokens":743,"total_tokens":7401,"prompt_tokens_details":{"cached_tokens":6528,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":704,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"I"} - - data: [DONE] - - headers: - Content-Type: - - text/event-stream; charset=utf-8 - status: 200 OK - code: 200 - duration: 14.287837875s -- id: 6 - request: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - content_length: 0 - host: httpbin.org - headers: - User-Agent: - - crush/1.0 - url: http://httpbin.org/robots.txt - method: GET - response: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - content_length: 162 - body: "\r\n503 Service Temporarily Unavailable\r\n\r\n

503 Service Temporarily Unavailable

\r\n\r\n\r\n" - headers: - Content-Type: - - text/html - status: 503 Service Temporarily Unavailable - code: 503 - duration: 299.229667ms -- id: 7 - request: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - content_length: 31602 - host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/download_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"download the file from https://httpbin.org/robots.txt and save it as robots.txt\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"call_1mCBTElvjDZ9QEJY3Bor46sw\",\"function\":{\"arguments\":\"{\\\"file_path\\\":\\\"robots.txt\\\",\\\"url\\\":\\\"https://httpbin.org/robots.txt\\\",\\\"timeout\\\":60}\",\"name\":\"download\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"Request failed with status code: 503\",\"tool_call_id\":\"call_1mCBTElvjDZ9QEJY3Bor46sw\",\"role\":\"tool\"},{\"tool_calls\":[{\"id\":\"call_MYyfodKjeLZfFAkDCERUwzQ6\",\"function\":{\"arguments\":\"{\\\"url\\\":\\\"https://httpbin.org/robots.txt\\\",\\\"format\\\":\\\"text\\\",\\\"timeout\\\":60}\",\"name\":\"fetch\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"Request failed with status code: 503\",\"tool_call_id\":\"call_MYyfodKjeLZfFAkDCERUwzQ6\",\"role\":\"tool\"},{\"tool_calls\":[{\"id\":\"call_Bj50giAxqbkCB3Vija34LmgI\",\"function\":{\"arguments\":\"{\\\"file_path\\\":\\\"robots.txt\\\",\\\"url\\\":\\\"http://httpbin.org/robots.txt\\\",\\\"timeout\\\":60}\",\"name\":\"download\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"Request failed with status code: 503\",\"tool_call_id\":\"call_Bj50giAxqbkCB3Vija34LmgI\",\"role\":\"tool\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" - headers: - Accept: - - application/json - Content-Type: - - application/json - User-Agent: - - OpenAI/Go 2.3.0 - url: https://api.openai.com/v1/chat/completions - method: POST - response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - content_length: -1 - body: |+ - data: {"id":"chatcmpl-CLu95LYig6Li95eV5YKUvHw8BPzV7","object":"chat.completion.chunk","created":1759336747,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"call_U4ztN2ncSZSqPu91xU3MhXwM","type":"function","function":{"name":"download","arguments":""}}],"refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"30cbT1HW"} - - data: {"id":"chatcmpl-CLu95LYig6Li95eV5YKUvHw8BPzV7","object":"chat.completion.chunk","created":1759336747,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"1MrkMTW4Q6zQIRq"} - - data: {"id":"chatcmpl-CLu95LYig6Li95eV5YKUvHw8BPzV7","object":"chat.completion.chunk","created":1759336747,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"file"}}]},"finish_reason":null}],"usage":null,"obfuscation":"1OmVRwZ6auadhO"} - - data: {"id":"chatcmpl-CLu95LYig6Li95eV5YKUvHw8BPzV7","object":"chat.completion.chunk","created":1759336747,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_path"}}]},"finish_reason":null}],"usage":null,"obfuscation":"izIH9DIE3HYKA"} - - data: {"id":"chatcmpl-CLu95LYig6Li95eV5YKUvHw8BPzV7","object":"chat.completion.chunk","created":1759336747,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"Y6wZ3atuSlXa7"} - - data: {"id":"chatcmpl-CLu95LYig6Li95eV5YKUvHw8BPzV7","object":"chat.completion.chunk","created":1759336747,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"robots"}}]},"finish_reason":null}],"usage":null,"obfuscation":"sVRkjd9AeU3k"} - - data: {"id":"chatcmpl-CLu95LYig6Li95eV5YKUvHw8BPzV7","object":"chat.completion.chunk","created":1759336747,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":".txt"}}]},"finish_reason":null}],"usage":null,"obfuscation":"3h26gVIsXs1XEM"} - - data: {"id":"chatcmpl-CLu95LYig6Li95eV5YKUvHw8BPzV7","object":"chat.completion.chunk","created":1759336747,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\",\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"pBy96GWLGD70h"} - - data: {"id":"chatcmpl-CLu95LYig6Li95eV5YKUvHw8BPzV7","object":"chat.completion.chunk","created":1759336747,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"url"}}]},"finish_reason":null}],"usage":null,"obfuscation":"n8pJvxFmlhtJQBa"} - - data: {"id":"chatcmpl-CLu95LYig6Li95eV5YKUvHw8BPzV7","object":"chat.completion.chunk","created":1759336747,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"4SlL7yV3Stl7j"} - - data: {"id":"chatcmpl-CLu95LYig6Li95eV5YKUvHw8BPzV7","object":"chat.completion.chunk","created":1759336747,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"https"}}]},"finish_reason":null}],"usage":null,"obfuscation":"sM6kRrKvfR8Tx"} - - data: {"id":"chatcmpl-CLu95LYig6Li95eV5YKUvHw8BPzV7","object":"chat.completion.chunk","created":1759336747,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"://"}}]},"finish_reason":null}],"usage":null,"obfuscation":"TKvkiK27gLzyDH6"} - - data: {"id":"chatcmpl-CLu95LYig6Li95eV5YKUvHw8BPzV7","object":"chat.completion.chunk","created":1759336747,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"www"}}]},"finish_reason":null}],"usage":null,"obfuscation":"UenoSmXQv5JhtbX"} - - data: {"id":"chatcmpl-CLu95LYig6Li95eV5YKUvHw8BPzV7","object":"chat.completion.chunk","created":1759336747,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":".http"}}]},"finish_reason":null}],"usage":null,"obfuscation":"lVbjnGdIf9HJ0"} - - data: {"id":"chatcmpl-CLu95LYig6Li95eV5YKUvHw8BPzV7","object":"chat.completion.chunk","created":1759336747,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"bin"}}]},"finish_reason":null}],"usage":null,"obfuscation":"hqZDbDvtpmP7RSU"} - - data: {"id":"chatcmpl-CLu95LYig6Li95eV5YKUvHw8BPzV7","object":"chat.completion.chunk","created":1759336747,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":".org"}}]},"finish_reason":null}],"usage":null,"obfuscation":"lbwuDxI5C7clNf"} - - data: {"id":"chatcmpl-CLu95LYig6Li95eV5YKUvHw8BPzV7","object":"chat.completion.chunk","created":1759336747,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/"}}]},"finish_reason":null}],"usage":null,"obfuscation":"X"} - - data: {"id":"chatcmpl-CLu95LYig6Li95eV5YKUvHw8BPzV7","object":"chat.completion.chunk","created":1759336747,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"robots"}}]},"finish_reason":null}],"usage":null,"obfuscation":"MQpWNqm0Uqyy"} - - data: {"id":"chatcmpl-CLu95LYig6Li95eV5YKUvHw8BPzV7","object":"chat.completion.chunk","created":1759336747,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":".txt"}}]},"finish_reason":null}],"usage":null,"obfuscation":"cDF5oDMCbzft7b"} - - data: {"id":"chatcmpl-CLu95LYig6Li95eV5YKUvHw8BPzV7","object":"chat.completion.chunk","created":1759336747,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\",\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"cos77GVtm3kTH"} - - data: {"id":"chatcmpl-CLu95LYig6Li95eV5YKUvHw8BPzV7","object":"chat.completion.chunk","created":1759336747,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"timeout"}}]},"finish_reason":null}],"usage":null,"obfuscation":"HSnBDt15XXH"} - - data: {"id":"chatcmpl-CLu95LYig6Li95eV5YKUvHw8BPzV7","object":"chat.completion.chunk","created":1759336747,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":"}}]},"finish_reason":null}],"usage":null,"obfuscation":"dTlvFmvvPNLVPXa"} - - data: {"id":"chatcmpl-CLu95LYig6Li95eV5YKUvHw8BPzV7","object":"chat.completion.chunk","created":1759336747,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"60"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - - data: {"id":"chatcmpl-CLu95LYig6Li95eV5YKUvHw8BPzV7","object":"chat.completion.chunk","created":1759336747,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"}"}}]},"finish_reason":null}],"usage":null,"obfuscation":"s"} - - data: {"id":"chatcmpl-CLu95LYig6Li95eV5YKUvHw8BPzV7","object":"chat.completion.chunk","created":1759336747,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"tool_calls"}],"usage":null,"obfuscation":""} - - data: {"id":"chatcmpl-CLu95LYig6Li95eV5YKUvHw8BPzV7","object":"chat.completion.chunk","created":1759336747,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6709,"completion_tokens":296,"total_tokens":7005,"prompt_tokens_details":{"cached_tokens":6656,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":256,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"W"} - - data: [DONE] - - headers: - Content-Type: - - text/event-stream; charset=utf-8 - status: 200 OK - code: 200 - duration: 10.225250291s -- id: 8 - request: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - content_length: 0 - host: www.httpbin.org - headers: - User-Agent: - - crush/1.0 - url: https://www.httpbin.org/robots.txt - method: GET response: proto: HTTP/2.0 proto_major: 2 @@ -469,15 +158,15 @@ interactions: - text/plain status: 200 OK code: 200 - duration: 2.082776833s -- id: 9 + duration: 1.056495458s +- id: 3 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 32040 + content_length: 31105 host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/download_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"download the file from https://httpbin.org/robots.txt and save it as robots.txt\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"call_1mCBTElvjDZ9QEJY3Bor46sw\",\"function\":{\"arguments\":\"{\\\"file_path\\\":\\\"robots.txt\\\",\\\"url\\\":\\\"https://httpbin.org/robots.txt\\\",\\\"timeout\\\":60}\",\"name\":\"download\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"Request failed with status code: 503\",\"tool_call_id\":\"call_1mCBTElvjDZ9QEJY3Bor46sw\",\"role\":\"tool\"},{\"tool_calls\":[{\"id\":\"call_MYyfodKjeLZfFAkDCERUwzQ6\",\"function\":{\"arguments\":\"{\\\"url\\\":\\\"https://httpbin.org/robots.txt\\\",\\\"format\\\":\\\"text\\\",\\\"timeout\\\":60}\",\"name\":\"fetch\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"Request failed with status code: 503\",\"tool_call_id\":\"call_MYyfodKjeLZfFAkDCERUwzQ6\",\"role\":\"tool\"},{\"tool_calls\":[{\"id\":\"call_Bj50giAxqbkCB3Vija34LmgI\",\"function\":{\"arguments\":\"{\\\"file_path\\\":\\\"robots.txt\\\",\\\"url\\\":\\\"http://httpbin.org/robots.txt\\\",\\\"timeout\\\":60}\",\"name\":\"download\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"Request failed with status code: 503\",\"tool_call_id\":\"call_Bj50giAxqbkCB3Vija34LmgI\",\"role\":\"tool\"},{\"tool_calls\":[{\"id\":\"call_U4ztN2ncSZSqPu91xU3MhXwM\",\"function\":{\"arguments\":\"{\\\"file_path\\\":\\\"robots.txt\\\",\\\"url\\\":\\\"https://www.httpbin.org/robots.txt\\\",\\\"timeout\\\":60}\",\"name\":\"download\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"Successfully downloaded 30 bytes to /tmp/crush-test/TestCoderAgent/openai-gpt-5/download_tool/robots.txt (Content-Type: text/plain)\",\"tool_call_id\":\"call_U4ztN2ncSZSqPu91xU3MhXwM\",\"role\":\"tool\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/download_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"download the file from https://httpbin.org/robots.txt and save it as robots.txt\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"call_lO5rUd6OeUJVNhJdS9PkX1r6\",\"function\":{\"arguments\":\"{\\\"url\\\":\\\"https://httpbin.org/robots.txt\\\",\\\"file_path\\\":\\\"robots.txt\\\",\\\"timeout\\\":60}\",\"name\":\"download\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"Successfully downloaded 30 bytes to /tmp/crush-test/TestCoderAgent/openai-gpt-5/download_tool/robots.txt (Content-Type: text/plain)\",\"tool_call_id\":\"call_lO5rUd6OeUJVNhJdS9PkX1r6\",\"role\":\"tool\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" headers: Accept: - application/json @@ -493,13 +182,19 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"chatcmpl-CLu9HagA9a52ZIzbjmtF8O3nyxQpZ","object":"chat.completion.chunk","created":1759336759,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"YGPNY3U1Gl"} + data: {"id":"chatcmpl-CLuTYqlCIUmXuOwVVRKKHzm7N4LwP","object":"chat.completion.chunk","created":1759338016,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"diMMsDj0Zz"} + + data: {"id":"chatcmpl-CLuTYqlCIUmXuOwVVRKKHzm7N4LwP","object":"chat.completion.chunk","created":1759338016,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"Saved"},"finish_reason":null}],"usage":null,"obfuscation":"S7wbQvc"} + + data: {"id":"chatcmpl-CLuTYqlCIUmXuOwVVRKKHzm7N4LwP","object":"chat.completion.chunk","created":1759338016,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" to"},"finish_reason":null}],"usage":null,"obfuscation":"MlIZ8nmad"} + + data: {"id":"chatcmpl-CLuTYqlCIUmXuOwVVRKKHzm7N4LwP","object":"chat.completion.chunk","created":1759338016,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" robots"},"finish_reason":null}],"usage":null,"obfuscation":"69Exy"} - data: {"id":"chatcmpl-CLu9HagA9a52ZIzbjmtF8O3nyxQpZ","object":"chat.completion.chunk","created":1759336759,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"done"},"finish_reason":null}],"usage":null,"obfuscation":"pBgrxrFF"} + data: {"id":"chatcmpl-CLuTYqlCIUmXuOwVVRKKHzm7N4LwP","object":"chat.completion.chunk","created":1759338016,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":".txt"},"finish_reason":null}],"usage":null,"obfuscation":"UhWXamUV"} - data: {"id":"chatcmpl-CLu9HagA9a52ZIzbjmtF8O3nyxQpZ","object":"chat.completion.chunk","created":1759336759,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"stop"}],"usage":null,"obfuscation":"GHGaMa"} + data: {"id":"chatcmpl-CLuTYqlCIUmXuOwVVRKKHzm7N4LwP","object":"chat.completion.chunk","created":1759338016,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"stop"}],"usage":null,"obfuscation":"cUCgO8"} - data: {"id":"chatcmpl-CLu9HagA9a52ZIzbjmtF8O3nyxQpZ","object":"chat.completion.chunk","created":1759336759,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6785,"completion_tokens":4,"total_tokens":6789,"prompt_tokens_details":{"cached_tokens":6656,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"Qavye"} + data: {"id":"chatcmpl-CLuTYqlCIUmXuOwVVRKKHzm7N4LwP","object":"chat.completion.chunk","created":1759338016,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6643,"completion_tokens":141,"total_tokens":6784,"prompt_tokens_details":{"cached_tokens":1024,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":128,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"L"} data: [DONE] @@ -508,4 +203,4 @@ interactions: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 1.24487425s + duration: 4.3443295s diff --git a/internal/agent/testdata/TestCoderAgent/openai-gpt-5/fetch_tool.yaml b/internal/agent/testdata/TestCoderAgent/openai-gpt-5/fetch_tool.yaml index af07d3f4c8993b4a36eff2ce154f520eb0f593ce..177d68008e821c6ec5f23e156bd076b14effd6e3 100644 --- a/internal/agent/testdata/TestCoderAgent/openai-gpt-5/fetch_tool.yaml +++ b/internal/agent/testdata/TestCoderAgent/openai-gpt-5/fetch_tool.yaml @@ -24,35 +24,27 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"chatcmpl-CLu9InV3jEubsFkVE1D5vPeVErzcm","object":"chat.completion.chunk","created":1759336760,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"CakBDWOg1iXzYg"} + data: {"id":"chatcmpl-CLuTcBUMssq5FPVAZL1TdzXvUBOlO","object":"chat.completion.chunk","created":1759338020,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"kLKSTcGwqTcCvX"} - data: {"id":"chatcmpl-CLu9InV3jEubsFkVE1D5vPeVErzcm","object":"chat.completion.chunk","created":1759336760,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":"Check"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"T7tKd7tVZfL"} + data: {"id":"chatcmpl-CLuTcBUMssq5FPVAZL1TdzXvUBOlO","object":"chat.completion.chunk","created":1759338020,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":"Check"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"uWaar4YZjWt"} - data: {"id":"chatcmpl-CLu9InV3jEubsFkVE1D5vPeVErzcm","object":"chat.completion.chunk","created":1759336760,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":" for"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"dbNWqSblLn1W"} + data: {"id":"chatcmpl-CLuTcBUMssq5FPVAZL1TdzXvUBOlO","object":"chat.completion.chunk","created":1759338020,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":" Word"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"4AdfsQk5ymW"} - data: {"id":"chatcmpl-CLu9InV3jEubsFkVE1D5vPeVErzcm","object":"chat.completion.chunk","created":1759336760,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":" '"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"SSIgYcemP2z2LP"} + data: {"id":"chatcmpl-CLuTcBUMssq5FPVAZL1TdzXvUBOlO","object":"chat.completion.chunk","created":1759338020,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":" in"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"mp2KaahzdBvK2"} - data: {"id":"chatcmpl-CLu9InV3jEubsFkVE1D5vPeVErzcm","object":"chat.completion.chunk","created":1759336760,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":"H"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"Pl1YiJXF6Cc6A29"} + data: {"id":"chatcmpl-CLuTcBUMssq5FPVAZL1TdzXvUBOlO","object":"chat.completion.chunk","created":1759338020,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":" F"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"a8lVkTYoCCfs2g"} - data: {"id":"chatcmpl-CLu9InV3jEubsFkVE1D5vPeVErzcm","object":"chat.completion.chunk","created":1759336760,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":"erman"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"9nOFNYSZ4Gt"} + data: {"id":"chatcmpl-CLuTcBUMssq5FPVAZL1TdzXvUBOlO","object":"chat.completion.chunk","created":1759338020,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":"etched"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"AgPASxboOi"} - data: {"id":"chatcmpl-CLu9InV3jEubsFkVE1D5vPeVErzcm","object":"chat.completion.chunk","created":1759336760,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":"'"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"eJlNQrapNKxHdmv"} + data: {"id":"chatcmpl-CLuTcBUMssq5FPVAZL1TdzXvUBOlO","object":"chat.completion.chunk","created":1759338020,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":" Content"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"bCb0DU5Q"} - data: {"id":"chatcmpl-CLu9InV3jEubsFkVE1D5vPeVErzcm","object":"chat.completion.chunk","created":1759336760,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":" in"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"7kFQl7DIhpyF0"} + data: {"id":"chatcmpl-CLuTcBUMssq5FPVAZL1TdzXvUBOlO","object":"chat.completion.chunk","created":1759338020,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":" from"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"XdFcY6DyYsB"} - data: {"id":"chatcmpl-CLu9InV3jEubsFkVE1D5vPeVErzcm","object":"chat.completion.chunk","created":1759336760,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":" http"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"VmI9vkBsnLQ"} + data: {"id":"chatcmpl-CLuTcBUMssq5FPVAZL1TdzXvUBOlO","object":"chat.completion.chunk","created":1759338020,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":" URL"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"xbSgclbIAQW7"} - data: {"id":"chatcmpl-CLu9InV3jEubsFkVE1D5vPeVErzcm","object":"chat.completion.chunk","created":1759336760,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":"bin"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"0PvqarlSbLKfP"} + data: {"id":"chatcmpl-CLuTcBUMssq5FPVAZL1TdzXvUBOlO","object":"chat.completion.chunk","created":1759338020,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"W55zgKyCBG"} - data: {"id":"chatcmpl-CLu9InV3jEubsFkVE1D5vPeVErzcm","object":"chat.completion.chunk","created":1759336760,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":".org"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"ak19E8RwY6YW"} - - data: {"id":"chatcmpl-CLu9InV3jEubsFkVE1D5vPeVErzcm","object":"chat.completion.chunk","created":1759336760,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":" HTML"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"LaLRZSDd1KM"} - - data: {"id":"chatcmpl-CLu9InV3jEubsFkVE1D5vPeVErzcm","object":"chat.completion.chunk","created":1759336760,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":" content"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"tuP0UP1O"} - - data: {"id":"chatcmpl-CLu9InV3jEubsFkVE1D5vPeVErzcm","object":"chat.completion.chunk","created":1759336760,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"CgraHmWtaj"} - - data: {"id":"chatcmpl-CLu9InV3jEubsFkVE1D5vPeVErzcm","object":"chat.completion.chunk","created":1759336760,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[],"usage":{"prompt_tokens":130,"completion_tokens":12,"total_tokens":142,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"0aN5Ohg3MAPkn"} + data: {"id":"chatcmpl-CLuTcBUMssq5FPVAZL1TdzXvUBOlO","object":"chat.completion.chunk","created":1759338020,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[],"usage":{"prompt_tokens":130,"completion_tokens":8,"total_tokens":138,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"ylBGqLCKIKpPuw"} data: [DONE] @@ -61,15 +53,15 @@ interactions: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 501.407834ms + duration: 872.376125ms - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 30608 + content_length: 30681 host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/fetch_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"fetch the content from https://httpbin.org/html and tell me if it contains the word 'Herman'\",\"role\":\"user\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/fetch_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"fetch the content from https://httpbin.org/html and tell me if it contains the word 'Herman'\",\"role\":\"user\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" headers: Accept: - application/json @@ -85,47 +77,47 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"chatcmpl-CLu9IJ4u4pWhGosZiU0S2raHwGprt","object":"chat.completion.chunk","created":1759336760,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"call_40H4xSy9h72wiuQtEOY97TOC","type":"function","function":{"name":"fetch","arguments":""}}],"refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"doLhXgKxQGD"} + data: {"id":"chatcmpl-CLuTd41bbBwFTjer57ZFHMYCdHB16","object":"chat.completion.chunk","created":1759338021,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"call_BqkvjKW1xSl4IINdAO2ZbjSI","type":"function","function":{"name":"fetch","arguments":""}}],"refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"J4PFk9nC2nQ"} - data: {"id":"chatcmpl-CLu9IJ4u4pWhGosZiU0S2raHwGprt","object":"chat.completion.chunk","created":1759336760,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"GIoVsb7RmZFu2VR"} + data: {"id":"chatcmpl-CLuTd41bbBwFTjer57ZFHMYCdHB16","object":"chat.completion.chunk","created":1759338021,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"KjiwzDENLfzzdAg"} - data: {"id":"chatcmpl-CLu9IJ4u4pWhGosZiU0S2raHwGprt","object":"chat.completion.chunk","created":1759336760,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"url"}}]},"finish_reason":null}],"usage":null,"obfuscation":"ItVar6rZMtYJLDN"} + data: {"id":"chatcmpl-CLuTd41bbBwFTjer57ZFHMYCdHB16","object":"chat.completion.chunk","created":1759338021,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"url"}}]},"finish_reason":null}],"usage":null,"obfuscation":"73GnqPw5YAIWDWY"} - data: {"id":"chatcmpl-CLu9IJ4u4pWhGosZiU0S2raHwGprt","object":"chat.completion.chunk","created":1759336760,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"z6kTJ31wut0KH"} + data: {"id":"chatcmpl-CLuTd41bbBwFTjer57ZFHMYCdHB16","object":"chat.completion.chunk","created":1759338021,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"SMnlfYa8IB9g3"} - data: {"id":"chatcmpl-CLu9IJ4u4pWhGosZiU0S2raHwGprt","object":"chat.completion.chunk","created":1759336760,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"https"}}]},"finish_reason":null}],"usage":null,"obfuscation":"2HFXGwXshr9Ub"} + data: {"id":"chatcmpl-CLuTd41bbBwFTjer57ZFHMYCdHB16","object":"chat.completion.chunk","created":1759338021,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"https"}}]},"finish_reason":null}],"usage":null,"obfuscation":"Sc58Vo2NuezmP"} - data: {"id":"chatcmpl-CLu9IJ4u4pWhGosZiU0S2raHwGprt","object":"chat.completion.chunk","created":1759336760,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"://"}}]},"finish_reason":null}],"usage":null,"obfuscation":"BvDXjT39CnjVZt3"} + data: {"id":"chatcmpl-CLuTd41bbBwFTjer57ZFHMYCdHB16","object":"chat.completion.chunk","created":1759338021,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"://"}}]},"finish_reason":null}],"usage":null,"obfuscation":"tfaG4Fch6Px6gYn"} - data: {"id":"chatcmpl-CLu9IJ4u4pWhGosZiU0S2raHwGprt","object":"chat.completion.chunk","created":1759336760,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"http"}}]},"finish_reason":null}],"usage":null,"obfuscation":"PPRH1piuNcgdRO"} + data: {"id":"chatcmpl-CLuTd41bbBwFTjer57ZFHMYCdHB16","object":"chat.completion.chunk","created":1759338021,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"http"}}]},"finish_reason":null}],"usage":null,"obfuscation":"gZWWw5YQdTCzlw"} - data: {"id":"chatcmpl-CLu9IJ4u4pWhGosZiU0S2raHwGprt","object":"chat.completion.chunk","created":1759336760,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"bin"}}]},"finish_reason":null}],"usage":null,"obfuscation":"3isse0Z1GEAyWcs"} + data: {"id":"chatcmpl-CLuTd41bbBwFTjer57ZFHMYCdHB16","object":"chat.completion.chunk","created":1759338021,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"bin"}}]},"finish_reason":null}],"usage":null,"obfuscation":"JY31YEbVDfG82YP"} - data: {"id":"chatcmpl-CLu9IJ4u4pWhGosZiU0S2raHwGprt","object":"chat.completion.chunk","created":1759336760,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":".org"}}]},"finish_reason":null}],"usage":null,"obfuscation":"KlR3DHrDJ0cbke"} + data: {"id":"chatcmpl-CLuTd41bbBwFTjer57ZFHMYCdHB16","object":"chat.completion.chunk","created":1759338021,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":".org"}}]},"finish_reason":null}],"usage":null,"obfuscation":"rNuPYRc9N065S8"} - data: {"id":"chatcmpl-CLu9IJ4u4pWhGosZiU0S2raHwGprt","object":"chat.completion.chunk","created":1759336760,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/html"}}]},"finish_reason":null}],"usage":null,"obfuscation":"yCT37F9QWIpEc"} + data: {"id":"chatcmpl-CLuTd41bbBwFTjer57ZFHMYCdHB16","object":"chat.completion.chunk","created":1759338021,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/html"}}]},"finish_reason":null}],"usage":null,"obfuscation":"VTYRRGC1nmSvT"} - data: {"id":"chatcmpl-CLu9IJ4u4pWhGosZiU0S2raHwGprt","object":"chat.completion.chunk","created":1759336760,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\",\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"jKXwRGDsYzj9I"} + data: {"id":"chatcmpl-CLuTd41bbBwFTjer57ZFHMYCdHB16","object":"chat.completion.chunk","created":1759338021,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\",\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"34LvzPEKaZz02"} - data: {"id":"chatcmpl-CLu9IJ4u4pWhGosZiU0S2raHwGprt","object":"chat.completion.chunk","created":1759336760,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"format"}}]},"finish_reason":null}],"usage":null,"obfuscation":"SARJQ5uiwOLJ"} + data: {"id":"chatcmpl-CLuTd41bbBwFTjer57ZFHMYCdHB16","object":"chat.completion.chunk","created":1759338021,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"format"}}]},"finish_reason":null}],"usage":null,"obfuscation":"8qhxzxIC2zjg"} - data: {"id":"chatcmpl-CLu9IJ4u4pWhGosZiU0S2raHwGprt","object":"chat.completion.chunk","created":1759336760,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"5r917L6yfvZdX"} + data: {"id":"chatcmpl-CLuTd41bbBwFTjer57ZFHMYCdHB16","object":"chat.completion.chunk","created":1759338021,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"Ov4UWCYKMbqkr"} - data: {"id":"chatcmpl-CLu9IJ4u4pWhGosZiU0S2raHwGprt","object":"chat.completion.chunk","created":1759336760,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"text"}}]},"finish_reason":null}],"usage":null,"obfuscation":"3WM7tZGB3r1Mpo"} + data: {"id":"chatcmpl-CLuTd41bbBwFTjer57ZFHMYCdHB16","object":"chat.completion.chunk","created":1759338021,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"text"}}]},"finish_reason":null}],"usage":null,"obfuscation":"uWk9D5bGV56vAG"} - data: {"id":"chatcmpl-CLu9IJ4u4pWhGosZiU0S2raHwGprt","object":"chat.completion.chunk","created":1759336760,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\",\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"fDo6Ks0qeIDUC"} + data: {"id":"chatcmpl-CLuTd41bbBwFTjer57ZFHMYCdHB16","object":"chat.completion.chunk","created":1759338021,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\",\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"UEdtbGASUUXf1"} - data: {"id":"chatcmpl-CLu9IJ4u4pWhGosZiU0S2raHwGprt","object":"chat.completion.chunk","created":1759336760,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"timeout"}}]},"finish_reason":null}],"usage":null,"obfuscation":"vV9v8BQ74Jp"} + data: {"id":"chatcmpl-CLuTd41bbBwFTjer57ZFHMYCdHB16","object":"chat.completion.chunk","created":1759338021,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"timeout"}}]},"finish_reason":null}],"usage":null,"obfuscation":"NvjJlER6kZ8"} - data: {"id":"chatcmpl-CLu9IJ4u4pWhGosZiU0S2raHwGprt","object":"chat.completion.chunk","created":1759336760,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":"}}]},"finish_reason":null}],"usage":null,"obfuscation":"xhMV14bM0yd02bB"} + data: {"id":"chatcmpl-CLuTd41bbBwFTjer57ZFHMYCdHB16","object":"chat.completion.chunk","created":1759338021,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":"}}]},"finish_reason":null}],"usage":null,"obfuscation":"fSlSIbFylOVxEui"} - data: {"id":"chatcmpl-CLu9IJ4u4pWhGosZiU0S2raHwGprt","object":"chat.completion.chunk","created":1759336760,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"30"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuTd41bbBwFTjer57ZFHMYCdHB16","object":"chat.completion.chunk","created":1759338021,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"30"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLu9IJ4u4pWhGosZiU0S2raHwGprt","object":"chat.completion.chunk","created":1759336760,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"}"}}]},"finish_reason":null}],"usage":null,"obfuscation":"V"} + data: {"id":"chatcmpl-CLuTd41bbBwFTjer57ZFHMYCdHB16","object":"chat.completion.chunk","created":1759338021,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"}"}}]},"finish_reason":null}],"usage":null,"obfuscation":"f"} - data: {"id":"chatcmpl-CLu9IJ4u4pWhGosZiU0S2raHwGprt","object":"chat.completion.chunk","created":1759336760,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"tool_calls"}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuTd41bbBwFTjer57ZFHMYCdHB16","object":"chat.completion.chunk","created":1759338021,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"tool_calls"}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLu9IJ4u4pWhGosZiU0S2raHwGprt","object":"chat.completion.chunk","created":1759336760,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6563,"completion_tokens":99,"total_tokens":6662,"prompt_tokens_details":{"cached_tokens":1024,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":64,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"f5d"} + data: {"id":"chatcmpl-CLuTd41bbBwFTjer57ZFHMYCdHB16","object":"chat.completion.chunk","created":1759338021,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6573,"completion_tokens":227,"total_tokens":6800,"prompt_tokens_details":{"cached_tokens":1024,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":192,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"i"} data: [DONE] @@ -134,7 +126,7 @@ interactions: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 4.408745625s + duration: 6.404613958s - id: 2 request: proto: HTTP/1.1 @@ -151,216 +143,36 @@ interactions: proto: HTTP/2.0 proto_major: 2 proto_minor: 0 - content_length: 162 - body: "\r\n503 Service Temporarily Unavailable\r\n\r\n

503 Service Temporarily Unavailable

\r\n\r\n\r\n" - headers: - Content-Type: - - text/html - status: 503 Service Unavailable - code: 503 - duration: 132.683417ms -- id: 3 - request: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - content_length: 30929 - host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/fetch_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"fetch the content from https://httpbin.org/html and tell me if it contains the word 'Herman'\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"call_40H4xSy9h72wiuQtEOY97TOC\",\"function\":{\"arguments\":\"{\\\"url\\\":\\\"https://httpbin.org/html\\\",\\\"format\\\":\\\"text\\\",\\\"timeout\\\":30}\",\"name\":\"fetch\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"Request failed with status code: 503\",\"tool_call_id\":\"call_40H4xSy9h72wiuQtEOY97TOC\",\"role\":\"tool\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" - headers: - Accept: - - application/json - Content-Type: - - application/json - User-Agent: - - OpenAI/Go 2.3.0 - url: https://api.openai.com/v1/chat/completions - method: POST - response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - content_length: -1 - body: |+ - data: {"id":"chatcmpl-CLu9Nfa3tGtRXsPth1NaYssJCH06j","object":"chat.completion.chunk","created":1759336765,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"call_MS1UrWqtwOzkXYMMH9sBRtBN","type":"function","function":{"name":"fetch","arguments":""}}],"refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"NRwvt7YWH7M"} - - data: {"id":"chatcmpl-CLu9Nfa3tGtRXsPth1NaYssJCH06j","object":"chat.completion.chunk","created":1759336765,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"3o0YZnvj2qsrGF2"} - - data: {"id":"chatcmpl-CLu9Nfa3tGtRXsPth1NaYssJCH06j","object":"chat.completion.chunk","created":1759336765,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"url"}}]},"finish_reason":null}],"usage":null,"obfuscation":"Ch6mqijmvKetkpD"} - - data: {"id":"chatcmpl-CLu9Nfa3tGtRXsPth1NaYssJCH06j","object":"chat.completion.chunk","created":1759336765,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"FdITTY3mbPW6v"} - - data: {"id":"chatcmpl-CLu9Nfa3tGtRXsPth1NaYssJCH06j","object":"chat.completion.chunk","created":1759336765,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"https"}}]},"finish_reason":null}],"usage":null,"obfuscation":"OCKa3AYpokTq1"} - - data: {"id":"chatcmpl-CLu9Nfa3tGtRXsPth1NaYssJCH06j","object":"chat.completion.chunk","created":1759336765,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"://"}}]},"finish_reason":null}],"usage":null,"obfuscation":"Nnnqb9hhwUhAsEe"} - - data: {"id":"chatcmpl-CLu9Nfa3tGtRXsPth1NaYssJCH06j","object":"chat.completion.chunk","created":1759336765,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"http"}}]},"finish_reason":null}],"usage":null,"obfuscation":"0YpL02MorBbXU7"} - - data: {"id":"chatcmpl-CLu9Nfa3tGtRXsPth1NaYssJCH06j","object":"chat.completion.chunk","created":1759336765,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"bin"}}]},"finish_reason":null}],"usage":null,"obfuscation":"zhHxf6BSZjbDDEO"} - - data: {"id":"chatcmpl-CLu9Nfa3tGtRXsPth1NaYssJCH06j","object":"chat.completion.chunk","created":1759336765,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":".org"}}]},"finish_reason":null}],"usage":null,"obfuscation":"c5Kt2I3xogdCB8"} - - data: {"id":"chatcmpl-CLu9Nfa3tGtRXsPth1NaYssJCH06j","object":"chat.completion.chunk","created":1759336765,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/html"}}]},"finish_reason":null}],"usage":null,"obfuscation":"cqGVonhEw8IES"} - - data: {"id":"chatcmpl-CLu9Nfa3tGtRXsPth1NaYssJCH06j","object":"chat.completion.chunk","created":1759336765,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\",\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"7AM5eXH9JiXVN"} - - data: {"id":"chatcmpl-CLu9Nfa3tGtRXsPth1NaYssJCH06j","object":"chat.completion.chunk","created":1759336765,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"format"}}]},"finish_reason":null}],"usage":null,"obfuscation":"2olTZ327RcGL"} - - data: {"id":"chatcmpl-CLu9Nfa3tGtRXsPth1NaYssJCH06j","object":"chat.completion.chunk","created":1759336765,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"oqIRGCJHFKVae"} - - data: {"id":"chatcmpl-CLu9Nfa3tGtRXsPth1NaYssJCH06j","object":"chat.completion.chunk","created":1759336765,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"text"}}]},"finish_reason":null}],"usage":null,"obfuscation":"48DKfSHrYk91mo"} - - data: {"id":"chatcmpl-CLu9Nfa3tGtRXsPth1NaYssJCH06j","object":"chat.completion.chunk","created":1759336765,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\",\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"s0ztikcoxJxji"} - - data: {"id":"chatcmpl-CLu9Nfa3tGtRXsPth1NaYssJCH06j","object":"chat.completion.chunk","created":1759336765,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"timeout"}}]},"finish_reason":null}],"usage":null,"obfuscation":"PuZv5A9n9Wv"} - - data: {"id":"chatcmpl-CLu9Nfa3tGtRXsPth1NaYssJCH06j","object":"chat.completion.chunk","created":1759336765,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":"}}]},"finish_reason":null}],"usage":null,"obfuscation":"AxzrlinEPErF4O7"} - - data: {"id":"chatcmpl-CLu9Nfa3tGtRXsPth1NaYssJCH06j","object":"chat.completion.chunk","created":1759336765,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"60"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - - data: {"id":"chatcmpl-CLu9Nfa3tGtRXsPth1NaYssJCH06j","object":"chat.completion.chunk","created":1759336765,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"}"}}]},"finish_reason":null}],"usage":null,"obfuscation":"t"} - - data: {"id":"chatcmpl-CLu9Nfa3tGtRXsPth1NaYssJCH06j","object":"chat.completion.chunk","created":1759336765,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"tool_calls"}],"usage":null,"obfuscation":""} - - data: {"id":"chatcmpl-CLu9Nfa3tGtRXsPth1NaYssJCH06j","object":"chat.completion.chunk","created":1759336765,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6610,"completion_tokens":227,"total_tokens":6837,"prompt_tokens_details":{"cached_tokens":1024,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":192,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"F"} - - data: [DONE] - - headers: - Content-Type: - - text/event-stream; charset=utf-8 - status: 200 OK - code: 200 - duration: 9.228616041s -- id: 4 - request: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - content_length: 0 - host: httpbin.org - headers: - User-Agent: - - crush/1.0 - url: https://httpbin.org/html - method: GET - response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - content_length: 162 - body: "\r\n503 Service Temporarily Unavailable\r\n\r\n

503 Service Temporarily Unavailable

\r\n\r\n\r\n" - headers: - Content-Type: - - text/html - status: 503 Service Unavailable - code: 503 - duration: 132.614541ms -- id: 5 - request: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - content_length: 31250 - host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/fetch_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"fetch the content from https://httpbin.org/html and tell me if it contains the word 'Herman'\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"call_40H4xSy9h72wiuQtEOY97TOC\",\"function\":{\"arguments\":\"{\\\"url\\\":\\\"https://httpbin.org/html\\\",\\\"format\\\":\\\"text\\\",\\\"timeout\\\":30}\",\"name\":\"fetch\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"Request failed with status code: 503\",\"tool_call_id\":\"call_40H4xSy9h72wiuQtEOY97TOC\",\"role\":\"tool\"},{\"tool_calls\":[{\"id\":\"call_MS1UrWqtwOzkXYMMH9sBRtBN\",\"function\":{\"arguments\":\"{\\\"url\\\":\\\"https://httpbin.org/html\\\",\\\"format\\\":\\\"text\\\",\\\"timeout\\\":60}\",\"name\":\"fetch\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"Request failed with status code: 503\",\"tool_call_id\":\"call_MS1UrWqtwOzkXYMMH9sBRtBN\",\"role\":\"tool\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" - headers: - Accept: - - application/json - Content-Type: - - application/json - User-Agent: - - OpenAI/Go 2.3.0 - url: https://api.openai.com/v1/chat/completions - method: POST - response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - content_length: -1 - body: |+ - data: {"id":"chatcmpl-CLu9XkNUHdfIqyIDldXXrlPb5wBhT","object":"chat.completion.chunk","created":1759336775,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"call_7gNFkEIkPox88HdYYCg7HPTy","type":"function","function":{"name":"fetch","arguments":""}}],"refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"p2ECYP0X1Sb"} - - data: {"id":"chatcmpl-CLu9XkNUHdfIqyIDldXXrlPb5wBhT","object":"chat.completion.chunk","created":1759336775,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"DH7leeoG9Bm3TCY"} - - data: {"id":"chatcmpl-CLu9XkNUHdfIqyIDldXXrlPb5wBhT","object":"chat.completion.chunk","created":1759336775,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"url"}}]},"finish_reason":null}],"usage":null,"obfuscation":"1hjLGWa33KxFISe"} - - data: {"id":"chatcmpl-CLu9XkNUHdfIqyIDldXXrlPb5wBhT","object":"chat.completion.chunk","created":1759336775,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"qg6hBaJB5wzIV"} - - data: {"id":"chatcmpl-CLu9XkNUHdfIqyIDldXXrlPb5wBhT","object":"chat.completion.chunk","created":1759336775,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"https"}}]},"finish_reason":null}],"usage":null,"obfuscation":"1nkG4BKgV6DyQ"} - - data: {"id":"chatcmpl-CLu9XkNUHdfIqyIDldXXrlPb5wBhT","object":"chat.completion.chunk","created":1759336775,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"://"}}]},"finish_reason":null}],"usage":null,"obfuscation":"vjIr4DHVDJmGj8O"} - - data: {"id":"chatcmpl-CLu9XkNUHdfIqyIDldXXrlPb5wBhT","object":"chat.completion.chunk","created":1759336775,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"http"}}]},"finish_reason":null}],"usage":null,"obfuscation":"yBsGox1tFuhzjZ"} - - data: {"id":"chatcmpl-CLu9XkNUHdfIqyIDldXXrlPb5wBhT","object":"chat.completion.chunk","created":1759336775,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"bin"}}]},"finish_reason":null}],"usage":null,"obfuscation":"hNuPCpAXjk4y0Mn"} - - data: {"id":"chatcmpl-CLu9XkNUHdfIqyIDldXXrlPb5wBhT","object":"chat.completion.chunk","created":1759336775,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":".org"}}]},"finish_reason":null}],"usage":null,"obfuscation":"PPEBOMaLPRqkcp"} - - data: {"id":"chatcmpl-CLu9XkNUHdfIqyIDldXXrlPb5wBhT","object":"chat.completion.chunk","created":1759336775,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/html"}}]},"finish_reason":null}],"usage":null,"obfuscation":"9rBGfPWkl9I2i"} - - data: {"id":"chatcmpl-CLu9XkNUHdfIqyIDldXXrlPb5wBhT","object":"chat.completion.chunk","created":1759336775,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\",\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"HMH5twskX3W5Z"} - - data: {"id":"chatcmpl-CLu9XkNUHdfIqyIDldXXrlPb5wBhT","object":"chat.completion.chunk","created":1759336775,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"format"}}]},"finish_reason":null}],"usage":null,"obfuscation":"WNoMiCpohSh9"} - - data: {"id":"chatcmpl-CLu9XkNUHdfIqyIDldXXrlPb5wBhT","object":"chat.completion.chunk","created":1759336775,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"UPceTIxv8yba7"} - - data: {"id":"chatcmpl-CLu9XkNUHdfIqyIDldXXrlPb5wBhT","object":"chat.completion.chunk","created":1759336775,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"text"}}]},"finish_reason":null}],"usage":null,"obfuscation":"Xl3k8jGiIw0Jzi"} - - data: {"id":"chatcmpl-CLu9XkNUHdfIqyIDldXXrlPb5wBhT","object":"chat.completion.chunk","created":1759336775,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\",\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"ZaLsvuA57VCTB"} - - data: {"id":"chatcmpl-CLu9XkNUHdfIqyIDldXXrlPb5wBhT","object":"chat.completion.chunk","created":1759336775,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"timeout"}}]},"finish_reason":null}],"usage":null,"obfuscation":"awL7sDwNZK1"} - - data: {"id":"chatcmpl-CLu9XkNUHdfIqyIDldXXrlPb5wBhT","object":"chat.completion.chunk","created":1759336775,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":"}}]},"finish_reason":null}],"usage":null,"obfuscation":"FbjcUJjDigZRwkz"} - - data: {"id":"chatcmpl-CLu9XkNUHdfIqyIDldXXrlPb5wBhT","object":"chat.completion.chunk","created":1759336775,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"120"}}]},"finish_reason":null}],"usage":null,"obfuscation":"cGeJpNxV3MuZURp"} - - data: {"id":"chatcmpl-CLu9XkNUHdfIqyIDldXXrlPb5wBhT","object":"chat.completion.chunk","created":1759336775,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"}"}}]},"finish_reason":null}],"usage":null,"obfuscation":"V"} - - data: {"id":"chatcmpl-CLu9XkNUHdfIqyIDldXXrlPb5wBhT","object":"chat.completion.chunk","created":1759336775,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"tool_calls"}],"usage":null,"obfuscation":""} - - data: {"id":"chatcmpl-CLu9XkNUHdfIqyIDldXXrlPb5wBhT","object":"chat.completion.chunk","created":1759336775,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6657,"completion_tokens":291,"total_tokens":6948,"prompt_tokens_details":{"cached_tokens":6528,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":256,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"5"} - - data: [DONE] - + content_length: 3741 + body: |- + + + + + +

Herman Melville - Moby-Dick

+ +
+

+ Availing himself of the mild, summer-cool weather that now reigned in these latitudes, and in preparation for the peculiarly active pursuits shortly to be anticipated, Perth, the begrimed, blistered old blacksmith, had not removed his portable forge to the hold again, after concluding his contributory work for Ahab's leg, but still retained it on deck, fast lashed to ringbolts by the foremast; being now almost incessantly invoked by the headsmen, and harpooneers, and bowsmen to do some little job for them; altering, or repairing, or new shaping their various weapons and boat furniture. Often he would be surrounded by an eager circle, all waiting to be served; holding boat-spades, pike-heads, harpoons, and lances, and jealously watching his every sooty movement, as he toiled. Nevertheless, this old man's was a patient hammer wielded by a patient arm. No murmur, no impatience, no petulance did come from him. Silent, slow, and solemn; bowing over still further his chronically broken back, he toiled away, as if toil were life itself, and the heavy beating of his hammer the heavy beating of his heart. And so it was.—Most miserable! A peculiar walk in this old man, a certain slight but painful appearing yawing in his gait, had at an early period of the voyage excited the curiosity of the mariners. And to the importunity of their persisted questionings he had finally given in; and so it came to pass that every one now knew the shameful story of his wretched fate. Belated, and not innocently, one bitter winter's midnight, on the road running between two country towns, the blacksmith half-stupidly felt the deadly numbness stealing over him, and sought refuge in a leaning, dilapidated barn. The issue was, the loss of the extremities of both feet. Out of this revelation, part by part, at last came out the four acts of the gladness, and the one long, and as yet uncatastrophied fifth act of the grief of his life's drama. He was an old man, who, at the age of nearly sixty, had postponedly encountered that thing in sorrow's technicals called ruin. He had been an artisan of famed excellence, and with plenty to do; owned a house and garden; embraced a youthful, daughter-like, loving wife, and three blithe, ruddy children; every Sunday went to a cheerful-looking church, planted in a grove. But one night, under cover of darkness, and further concealed in a most cunning disguisement, a desperate burglar slid into his happy home, and robbed them all of everything. And darker yet to tell, the blacksmith himself did ignorantly conduct this burglar into his family's heart. It was the Bottle Conjuror! Upon the opening of that fatal cork, forth flew the fiend, and shrivelled up his home. Now, for prudent, most wise, and economic reasons, the blacksmith's shop was in the basement of his dwelling, but with a separate entrance to it; so that always had the young and loving healthy wife listened with no unhappy nervousness, but with vigorous pleasure, to the stout ringing of her young-armed old husband's hammer; whose reverberations, muffled by passing through the floors and walls, came up to her, not unsweetly, in her nursery; and so, to stout Labor's iron lullaby, the blacksmith's infants were rocked to slumber. Oh, woe on woe! Oh, Death, why canst thou not sometimes be timely? Hadst thou taken this old blacksmith to thyself ere his full ruin came upon him, then had the young widow had a delicious grief, and her orphans a truly venerable, legendary sire to dream of in their after years; and all of them a care-killing competency. +

+
+ + headers: Content-Type: - - text/event-stream; charset=utf-8 + - text/html; charset=utf-8 status: 200 OK code: 200 - duration: 5.964991875s -- id: 6 - request: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - content_length: 0 - host: httpbin.org - headers: - User-Agent: - - crush/1.0 - url: https://httpbin.org/html - method: GET - response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - content_length: 162 - body: "\r\n503 Service Temporarily Unavailable\r\n\r\n

503 Service Temporarily Unavailable

\r\n\r\n\r\n" - headers: - Content-Type: - - text/html - status: 503 Service Unavailable - code: 503 - duration: 155.702917ms -- id: 7 + duration: 3.280142958s +- id: 3 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 31572 + content_length: 34562 host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/fetch_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"fetch the content from https://httpbin.org/html and tell me if it contains the word 'Herman'\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"call_40H4xSy9h72wiuQtEOY97TOC\",\"function\":{\"arguments\":\"{\\\"url\\\":\\\"https://httpbin.org/html\\\",\\\"format\\\":\\\"text\\\",\\\"timeout\\\":30}\",\"name\":\"fetch\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"Request failed with status code: 503\",\"tool_call_id\":\"call_40H4xSy9h72wiuQtEOY97TOC\",\"role\":\"tool\"},{\"tool_calls\":[{\"id\":\"call_MS1UrWqtwOzkXYMMH9sBRtBN\",\"function\":{\"arguments\":\"{\\\"url\\\":\\\"https://httpbin.org/html\\\",\\\"format\\\":\\\"text\\\",\\\"timeout\\\":60}\",\"name\":\"fetch\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"Request failed with status code: 503\",\"tool_call_id\":\"call_MS1UrWqtwOzkXYMMH9sBRtBN\",\"role\":\"tool\"},{\"tool_calls\":[{\"id\":\"call_7gNFkEIkPox88HdYYCg7HPTy\",\"function\":{\"arguments\":\"{\\\"url\\\":\\\"https://httpbin.org/html\\\",\\\"format\\\":\\\"text\\\",\\\"timeout\\\":120}\",\"name\":\"fetch\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"Request failed with status code: 503\",\"tool_call_id\":\"call_7gNFkEIkPox88HdYYCg7HPTy\",\"role\":\"tool\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/fetch_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"fetch the content from https://httpbin.org/html and tell me if it contains the word 'Herman'\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"call_BqkvjKW1xSl4IINdAO2ZbjSI\",\"function\":{\"arguments\":\"{\\\"url\\\":\\\"https://httpbin.org/html\\\",\\\"format\\\":\\\"text\\\",\\\"timeout\\\":30}\",\"name\":\"fetch\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"Herman Melville - Moby-Dick Availing himself of the mild, summer-cool weather that now reigned in these latitudes, and in preparation for the peculiarly active pursuits shortly to be anticipated, Perth, the begrimed, blistered old blacksmith, had not removed his portable forge to the hold again, after concluding his contributory work for Ahab's leg, but still retained it on deck, fast lashed to ringbolts by the foremast; being now almost incessantly invoked by the headsmen, and harpooneers, and bowsmen to do some little job for them; altering, or repairing, or new shaping their various weapons and boat furniture. Often he would be surrounded by an eager circle, all waiting to be served; holding boat-spades, pike-heads, harpoons, and lances, and jealously watching his every sooty movement, as he toiled. Nevertheless, this old man's was a patient hammer wielded by a patient arm. No murmur, no impatience, no petulance did come from him. Silent, slow, and solemn; bowing over still further his chronically broken back, he toiled away, as if toil were life itself, and the heavy beating of his hammer the heavy beating of his heart. And so it was.—Most miserable! A peculiar walk in this old man, a certain slight but painful appearing yawing in his gait, had at an early period of the voyage excited the curiosity of the mariners. And to the importunity of their persisted questionings he had finally given in; and so it came to pass that every one now knew the shameful story of his wretched fate. Belated, and not innocently, one bitter winter's midnight, on the road running between two country towns, the blacksmith half-stupidly felt the deadly numbness stealing over him, and sought refuge in a leaning, dilapidated barn. The issue was, the loss of the extremities of both feet. Out of this revelation, part by part, at last came out the four acts of the gladness, and the one long, and as yet uncatastrophied fifth act of the grief of his life's drama. He was an old man, who, at the age of nearly sixty, had postponedly encountered that thing in sorrow's technicals called ruin. He had been an artisan of famed excellence, and with plenty to do; owned a house and garden; embraced a youthful, daughter-like, loving wife, and three blithe, ruddy children; every Sunday went to a cheerful-looking church, planted in a grove. But one night, under cover of darkness, and further concealed in a most cunning disguisement, a desperate burglar slid into his happy home, and robbed them all of everything. And darker yet to tell, the blacksmith himself did ignorantly conduct this burglar into his family's heart. It was the Bottle Conjuror! Upon the opening of that fatal cork, forth flew the fiend, and shrivelled up his home. Now, for prudent, most wise, and economic reasons, the blacksmith's shop was in the basement of his dwelling, but with a separate entrance to it; so that always had the young and loving healthy wife listened with no unhappy nervousness, but with vigorous pleasure, to the stout ringing of her young-armed old husband's hammer; whose reverberations, muffled by passing through the floors and walls, came up to her, not unsweetly, in her nursery; and so, to stout Labor's iron lullaby, the blacksmith's infants were rocked to slumber. Oh, woe on woe! Oh, Death, why canst thou not sometimes be timely? Hadst thou taken this old blacksmith to thyself ere his full ruin came upon him, then had the young widow had a delicious grief, and her orphans a truly venerable, legendary sire to dream of in their after years; and all of them a care-killing competency.\",\"tool_call_id\":\"call_BqkvjKW1xSl4IINdAO2ZbjSI\",\"role\":\"tool\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" headers: Accept: - application/json @@ -376,45 +188,13 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"chatcmpl-CLu9dxoFJkbid18oCN7qm4jdZaDko","object":"chat.completion.chunk","created":1759336781,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"oLMycuy9Qb"} - - data: {"id":"chatcmpl-CLu9dxoFJkbid18oCN7qm4jdZaDko","object":"chat.completion.chunk","created":1759336781,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"Unable"},"finish_reason":null}],"usage":null,"obfuscation":"AQkKhu"} - - data: {"id":"chatcmpl-CLu9dxoFJkbid18oCN7qm4jdZaDko","object":"chat.completion.chunk","created":1759336781,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" to"},"finish_reason":null}],"usage":null,"obfuscation":"ESfNIzs6F"} - - data: {"id":"chatcmpl-CLu9dxoFJkbid18oCN7qm4jdZaDko","object":"chat.completion.chunk","created":1759336781,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" fetch"},"finish_reason":null}],"usage":null,"obfuscation":"XWxY4y"} - - data: {"id":"chatcmpl-CLu9dxoFJkbid18oCN7qm4jdZaDko","object":"chat.completion.chunk","created":1759336781,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" ("},"finish_reason":null}],"usage":null,"obfuscation":"AHeO2NrYfB"} - - data: {"id":"chatcmpl-CLu9dxoFJkbid18oCN7qm4jdZaDko","object":"chat.completion.chunk","created":1759336781,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"503"},"finish_reason":null}],"usage":null,"obfuscation":"fWSipLW83"} - - data: {"id":"chatcmpl-CLu9dxoFJkbid18oCN7qm4jdZaDko","object":"chat.completion.chunk","created":1759336781,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" Service"},"finish_reason":null}],"usage":null,"obfuscation":"9yxj"} - - data: {"id":"chatcmpl-CLu9dxoFJkbid18oCN7qm4jdZaDko","object":"chat.completion.chunk","created":1759336781,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" Un"},"finish_reason":null}],"usage":null,"obfuscation":"FvCrJoFFQ"} - - data: {"id":"chatcmpl-CLu9dxoFJkbid18oCN7qm4jdZaDko","object":"chat.completion.chunk","created":1759336781,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"available"},"finish_reason":null}],"usage":null,"obfuscation":"7SJ"} - - data: {"id":"chatcmpl-CLu9dxoFJkbid18oCN7qm4jdZaDko","object":"chat.completion.chunk","created":1759336781,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"),"},"finish_reason":null}],"usage":null,"obfuscation":"XapsmUsKoa"} - - data: {"id":"chatcmpl-CLu9dxoFJkbid18oCN7qm4jdZaDko","object":"chat.completion.chunk","created":1759336781,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" so"},"finish_reason":null}],"usage":null,"obfuscation":"sH17H0ZjF"} - - data: {"id":"chatcmpl-CLu9dxoFJkbid18oCN7qm4jdZaDko","object":"chat.completion.chunk","created":1759336781,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" I"},"finish_reason":null}],"usage":null,"obfuscation":"dzCGT9mJMw"} - - data: {"id":"chatcmpl-CLu9dxoFJkbid18oCN7qm4jdZaDko","object":"chat.completion.chunk","created":1759336781,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" can"},"finish_reason":null}],"usage":null,"obfuscation":"U8G3VL1o"} - - data: {"id":"chatcmpl-CLu9dxoFJkbid18oCN7qm4jdZaDko","object":"chat.completion.chunk","created":1759336781,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"’t"},"finish_reason":null}],"usage":null,"obfuscation":"LQuBvZm3fS"} - - data: {"id":"chatcmpl-CLu9dxoFJkbid18oCN7qm4jdZaDko","object":"chat.completion.chunk","created":1759336781,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" verify"},"finish_reason":null}],"usage":null,"obfuscation":"UhiSn"} - - data: {"id":"chatcmpl-CLu9dxoFJkbid18oCN7qm4jdZaDko","object":"chat.completion.chunk","created":1759336781,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":".\n"},"finish_reason":null}],"usage":null,"obfuscation":"yK9YcleoM"} - - data: {"id":"chatcmpl-CLu9dxoFJkbid18oCN7qm4jdZaDko","object":"chat.completion.chunk","created":1759336781,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"Retry"},"finish_reason":null}],"usage":null,"obfuscation":"o2BBVjN"} + data: {"id":"chatcmpl-CLuTmCGgQh2VjM7aZpGhyt4YMcOiq","object":"chat.completion.chunk","created":1759338030,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"tZb8BZNKMa"} - data: {"id":"chatcmpl-CLu9dxoFJkbid18oCN7qm4jdZaDko","object":"chat.completion.chunk","created":1759336781,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"?"},"finish_reason":null}],"usage":null,"obfuscation":"yS5du1TskXI"} + data: {"id":"chatcmpl-CLuTmCGgQh2VjM7aZpGhyt4YMcOiq","object":"chat.completion.chunk","created":1759338030,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"Yes"},"finish_reason":null}],"usage":null,"obfuscation":"ZuxjF0LcG"} - data: {"id":"chatcmpl-CLu9dxoFJkbid18oCN7qm4jdZaDko","object":"chat.completion.chunk","created":1759336781,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"stop"}],"usage":null,"obfuscation":"QXIJa4"} + data: {"id":"chatcmpl-CLuTmCGgQh2VjM7aZpGhyt4YMcOiq","object":"chat.completion.chunk","created":1759338030,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"stop"}],"usage":null,"obfuscation":"BrILUO"} - data: {"id":"chatcmpl-CLu9dxoFJkbid18oCN7qm4jdZaDko","object":"chat.completion.chunk","created":1759336781,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6704,"completion_tokens":602,"total_tokens":7306,"prompt_tokens_details":{"cached_tokens":6656,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":576,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"V"} + data: {"id":"chatcmpl-CLuTmCGgQh2VjM7aZpGhyt4YMcOiq","object":"chat.completion.chunk","created":1759338030,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":7436,"completion_tokens":202,"total_tokens":7638,"prompt_tokens_details":{"cached_tokens":6528,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":192,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"X"} data: [DONE] @@ -423,4 +203,4 @@ interactions: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 17.2619865s + duration: 4.356599416s diff --git a/internal/agent/testdata/TestCoderAgent/openai-gpt-5/glob_tool.yaml b/internal/agent/testdata/TestCoderAgent/openai-gpt-5/glob_tool.yaml index 315a608f8a8566bc3b18e0b6a09e4f247e1cdb7a..be21f4d40fbef326cb51dea6a313253938ec13c0 100644 --- a/internal/agent/testdata/TestCoderAgent/openai-gpt-5/glob_tool.yaml +++ b/internal/agent/testdata/TestCoderAgent/openai-gpt-5/glob_tool.yaml @@ -24,29 +24,29 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"chatcmpl-CLu9uaVAbIQSfN7mh5jjMJcvxrb02","object":"chat.completion.chunk","created":1759336798,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"FME7dIDZ9RLuUU"} + data: {"id":"chatcmpl-CLuTqBHUnM1vkhnO9OrX8h1ZLEFus","object":"chat.completion.chunk","created":1759338034,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"rUXw1FEMu6ZOsN"} - data: {"id":"chatcmpl-CLu9uaVAbIQSfN7mh5jjMJcvxrb02","object":"chat.completion.chunk","created":1759336798,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":"Finding"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"wYUbKIVPm"} + data: {"id":"chatcmpl-CLuTqBHUnM1vkhnO9OrX8h1ZLEFus","object":"chat.completion.chunk","created":1759338034,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":"Finding"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"tI4UF9LtL"} - data: {"id":"chatcmpl-CLu9uaVAbIQSfN7mh5jjMJcvxrb02","object":"chat.completion.chunk","created":1759336798,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":" ."},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"0OpO79Yo6sek5W"} + data: {"id":"chatcmpl-CLuTqBHUnM1vkhnO9OrX8h1ZLEFus","object":"chat.completion.chunk","created":1759338034,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":" ."},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"KGBg4SYncyyPYu"} - data: {"id":"chatcmpl-CLu9uaVAbIQSfN7mh5jjMJcvxrb02","object":"chat.completion.chunk","created":1759336798,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":"go"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"LfZg1SQz8unIiu"} + data: {"id":"chatcmpl-CLuTqBHUnM1vkhnO9OrX8h1ZLEFus","object":"chat.completion.chunk","created":1759338034,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":"go"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"nO25eF9hlIdNHL"} - data: {"id":"chatcmpl-CLu9uaVAbIQSfN7mh5jjMJcvxrb02","object":"chat.completion.chunk","created":1759336798,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":" Files"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"tgWRqv5DXN"} + data: {"id":"chatcmpl-CLuTqBHUnM1vkhnO9OrX8h1ZLEFus","object":"chat.completion.chunk","created":1759338034,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":" Files"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"TZi0Xf9tHS"} - data: {"id":"chatcmpl-CLu9uaVAbIQSfN7mh5jjMJcvxrb02","object":"chat.completion.chunk","created":1759336798,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":" with"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"6Q9xjOU2V3E"} + data: {"id":"chatcmpl-CLuTqBHUnM1vkhnO9OrX8h1ZLEFus","object":"chat.completion.chunk","created":1759338034,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":" with"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"PPNjDHfUHfu"} - data: {"id":"chatcmpl-CLu9uaVAbIQSfN7mh5jjMJcvxrb02","object":"chat.completion.chunk","created":1759336798,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":" Glob"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"bvhzWxyDrkq"} + data: {"id":"chatcmpl-CLuTqBHUnM1vkhnO9OrX8h1ZLEFus","object":"chat.completion.chunk","created":1759338034,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":" Glob"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"kh05SzrGkJO"} - data: {"id":"chatcmpl-CLu9uaVAbIQSfN7mh5jjMJcvxrb02","object":"chat.completion.chunk","created":1759336798,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":" in"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"1TGeucsSnWfKA"} + data: {"id":"chatcmpl-CLuTqBHUnM1vkhnO9OrX8h1ZLEFus","object":"chat.completion.chunk","created":1759338034,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":" in"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"C5wECDjxA7vzy"} - data: {"id":"chatcmpl-CLu9uaVAbIQSfN7mh5jjMJcvxrb02","object":"chat.completion.chunk","created":1759336798,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":" Current"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"TpYB6Yr0"} + data: {"id":"chatcmpl-CLuTqBHUnM1vkhnO9OrX8h1ZLEFus","object":"chat.completion.chunk","created":1759338034,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":" Current"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"pHSOeDci"} - data: {"id":"chatcmpl-CLu9uaVAbIQSfN7mh5jjMJcvxrb02","object":"chat.completion.chunk","created":1759336798,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":" Directory"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"VSNINr"} + data: {"id":"chatcmpl-CLuTqBHUnM1vkhnO9OrX8h1ZLEFus","object":"chat.completion.chunk","created":1759338034,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":" Directory"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"vWU5aK"} - data: {"id":"chatcmpl-CLu9uaVAbIQSfN7mh5jjMJcvxrb02","object":"chat.completion.chunk","created":1759336798,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"jrphG2UWAu"} + data: {"id":"chatcmpl-CLuTqBHUnM1vkhnO9OrX8h1ZLEFus","object":"chat.completion.chunk","created":1759338034,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"1NpNdqJ7nf"} - data: {"id":"chatcmpl-CLu9uaVAbIQSfN7mh5jjMJcvxrb02","object":"chat.completion.chunk","created":1759336798,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[],"usage":{"prompt_tokens":120,"completion_tokens":9,"total_tokens":129,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"5Mkbja79daMBao"} + data: {"id":"chatcmpl-CLuTqBHUnM1vkhnO9OrX8h1ZLEFus","object":"chat.completion.chunk","created":1759338034,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[],"usage":{"prompt_tokens":120,"completion_tokens":9,"total_tokens":129,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"Bf8ozc44y43SCk"} data: [DONE] @@ -55,15 +55,15 @@ interactions: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 1.170671583s + duration: 456.047458ms - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 30570 + content_length: 30643 host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/glob_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use glob to find all .go files in the current directory\",\"role\":\"user\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/glob_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use glob to find all .go files in the current directory\",\"role\":\"user\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" headers: Accept: - application/json @@ -79,23 +79,23 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"chatcmpl-CLu9vkTcRTI3i1e5jMIhUcHOQSvLg","object":"chat.completion.chunk","created":1759336799,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"call_qJByXV28TjZqpBUkSpByfVCx","type":"function","function":{"name":"glob","arguments":""}}],"refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"N2dwsc9z6f3J"} + data: {"id":"chatcmpl-CLuTr0QexCNcblZucdUCImuMs5nKH","object":"chat.completion.chunk","created":1759338035,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"call_QmmZp8jVXQun7ChnvnaIoq46","type":"function","function":{"name":"glob","arguments":""}}],"refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"THCIM4vp2bHM"} - data: {"id":"chatcmpl-CLu9vkTcRTI3i1e5jMIhUcHOQSvLg","object":"chat.completion.chunk","created":1759336799,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"gmLMTpNsp0HxC0Y"} + data: {"id":"chatcmpl-CLuTr0QexCNcblZucdUCImuMs5nKH","object":"chat.completion.chunk","created":1759338035,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"c0dBKS7q6H7gpMh"} - data: {"id":"chatcmpl-CLu9vkTcRTI3i1e5jMIhUcHOQSvLg","object":"chat.completion.chunk","created":1759336799,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"pattern"}}]},"finish_reason":null}],"usage":null,"obfuscation":"c5Ue9uc7NSf"} + data: {"id":"chatcmpl-CLuTr0QexCNcblZucdUCImuMs5nKH","object":"chat.completion.chunk","created":1759338035,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"pattern"}}]},"finish_reason":null}],"usage":null,"obfuscation":"ngxWuDRq86F"} - data: {"id":"chatcmpl-CLu9vkTcRTI3i1e5jMIhUcHOQSvLg","object":"chat.completion.chunk","created":1759336799,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"2h9qTh6pPEycL"} + data: {"id":"chatcmpl-CLuTr0QexCNcblZucdUCImuMs5nKH","object":"chat.completion.chunk","created":1759338035,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"cdw0CeJkO13Rm"} - data: {"id":"chatcmpl-CLu9vkTcRTI3i1e5jMIhUcHOQSvLg","object":"chat.completion.chunk","created":1759336799,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"*."}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuTr0QexCNcblZucdUCImuMs5nKH","object":"chat.completion.chunk","created":1759338035,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"*."}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLu9vkTcRTI3i1e5jMIhUcHOQSvLg","object":"chat.completion.chunk","created":1759336799,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"go"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuTr0QexCNcblZucdUCImuMs5nKH","object":"chat.completion.chunk","created":1759338035,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"go"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLu9vkTcRTI3i1e5jMIhUcHOQSvLg","object":"chat.completion.chunk","created":1759336799,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"}"}}]},"finish_reason":null}],"usage":null,"obfuscation":"kQVrCwUzlW5iAV7"} + data: {"id":"chatcmpl-CLuTr0QexCNcblZucdUCImuMs5nKH","object":"chat.completion.chunk","created":1759338035,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"}"}}]},"finish_reason":null}],"usage":null,"obfuscation":"PDNqJHESUqeL0n0"} - data: {"id":"chatcmpl-CLu9vkTcRTI3i1e5jMIhUcHOQSvLg","object":"chat.completion.chunk","created":1759336799,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"tool_calls"}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuTr0QexCNcblZucdUCImuMs5nKH","object":"chat.completion.chunk","created":1759338035,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"tool_calls"}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLu9vkTcRTI3i1e5jMIhUcHOQSvLg","object":"chat.completion.chunk","created":1759336799,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6553,"completion_tokens":151,"total_tokens":6704,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":128,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"ZOEe"} + data: {"id":"chatcmpl-CLuTr0QexCNcblZucdUCImuMs5nKH","object":"chat.completion.chunk","created":1759338035,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6563,"completion_tokens":151,"total_tokens":6714,"prompt_tokens_details":{"cached_tokens":1024,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":128,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"G"} data: [DONE] @@ -104,15 +104,15 @@ interactions: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 4.968985125s + duration: 5.143914375s - id: 2 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 30864 + content_length: 30937 host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/glob_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use glob to find all .go files in the current directory\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"call_qJByXV28TjZqpBUkSpByfVCx\",\"function\":{\"arguments\":\"{\\\"pattern\\\":\\\"*.go\\\"}\",\"name\":\"glob\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"/tmp/crush-test/TestCoderAgent/openai-gpt-5/glob_tool/main.go\",\"tool_call_id\":\"call_qJByXV28TjZqpBUkSpByfVCx\",\"role\":\"tool\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/glob_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use glob to find all .go files in the current directory\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"call_QmmZp8jVXQun7ChnvnaIoq46\",\"function\":{\"arguments\":\"{\\\"pattern\\\":\\\"*.go\\\"}\",\"name\":\"glob\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"/tmp/crush-test/TestCoderAgent/openai-gpt-5/glob_tool/main.go\",\"tool_call_id\":\"call_QmmZp8jVXQun7ChnvnaIoq46\",\"role\":\"tool\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" headers: Accept: - application/json @@ -128,49 +128,15 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"chatcmpl-CLu9z0WuXs4iRySqEws82JxOD8AK5","object":"chat.completion.chunk","created":1759336803,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"YxLsevw8Qv"} + data: {"id":"chatcmpl-CLuTw20qPGa2sbxUQNbEFQ7ITGcAH","object":"chat.completion.chunk","created":1759338040,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"JylYX6Pf55"} - data: {"id":"chatcmpl-CLu9z0WuXs4iRySqEws82JxOD8AK5","object":"chat.completion.chunk","created":1759336803,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"/"},"finish_reason":null}],"usage":null,"obfuscation":"ENop7KT0bZS"} + data: {"id":"chatcmpl-CLuTw20qPGa2sbxUQNbEFQ7ITGcAH","object":"chat.completion.chunk","created":1759338040,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"main"},"finish_reason":null}],"usage":null,"obfuscation":"QUX7tdDB"} - data: {"id":"chatcmpl-CLu9z0WuXs4iRySqEws82JxOD8AK5","object":"chat.completion.chunk","created":1759336803,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"tmp"},"finish_reason":null}],"usage":null,"obfuscation":"OMHCfa0jB"} + data: {"id":"chatcmpl-CLuTw20qPGa2sbxUQNbEFQ7ITGcAH","object":"chat.completion.chunk","created":1759338040,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":".go"},"finish_reason":null}],"usage":null,"obfuscation":"atXRocc7O"} - data: {"id":"chatcmpl-CLu9z0WuXs4iRySqEws82JxOD8AK5","object":"chat.completion.chunk","created":1759336803,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"/cr"},"finish_reason":null}],"usage":null,"obfuscation":"wu68I8K7y"} + data: {"id":"chatcmpl-CLuTw20qPGa2sbxUQNbEFQ7ITGcAH","object":"chat.completion.chunk","created":1759338040,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"stop"}],"usage":null,"obfuscation":"Y9Upqp"} - data: {"id":"chatcmpl-CLu9z0WuXs4iRySqEws82JxOD8AK5","object":"chat.completion.chunk","created":1759336803,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"ush"},"finish_reason":null}],"usage":null,"obfuscation":"Czoh0sevc"} - - data: {"id":"chatcmpl-CLu9z0WuXs4iRySqEws82JxOD8AK5","object":"chat.completion.chunk","created":1759336803,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"-test"},"finish_reason":null}],"usage":null,"obfuscation":"CCBTi96"} - - data: {"id":"chatcmpl-CLu9z0WuXs4iRySqEws82JxOD8AK5","object":"chat.completion.chunk","created":1759336803,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"/Test"},"finish_reason":null}],"usage":null,"obfuscation":"BzDAdU3"} - - data: {"id":"chatcmpl-CLu9z0WuXs4iRySqEws82JxOD8AK5","object":"chat.completion.chunk","created":1759336803,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"Coder"},"finish_reason":null}],"usage":null,"obfuscation":"GngMYdk"} - - data: {"id":"chatcmpl-CLu9z0WuXs4iRySqEws82JxOD8AK5","object":"chat.completion.chunk","created":1759336803,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"Agent"},"finish_reason":null}],"usage":null,"obfuscation":"35M5oJw"} - - data: {"id":"chatcmpl-CLu9z0WuXs4iRySqEws82JxOD8AK5","object":"chat.completion.chunk","created":1759336803,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"/open"},"finish_reason":null}],"usage":null,"obfuscation":"6n73Ig1"} - - data: {"id":"chatcmpl-CLu9z0WuXs4iRySqEws82JxOD8AK5","object":"chat.completion.chunk","created":1759336803,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"ai"},"finish_reason":null}],"usage":null,"obfuscation":"RKLz8Q0V7y"} - - data: {"id":"chatcmpl-CLu9z0WuXs4iRySqEws82JxOD8AK5","object":"chat.completion.chunk","created":1759336803,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"-g"},"finish_reason":null}],"usage":null,"obfuscation":"8d6umQxtfU"} - - data: {"id":"chatcmpl-CLu9z0WuXs4iRySqEws82JxOD8AK5","object":"chat.completion.chunk","created":1759336803,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"pt"},"finish_reason":null}],"usage":null,"obfuscation":"2B9dlysDWg"} - - data: {"id":"chatcmpl-CLu9z0WuXs4iRySqEws82JxOD8AK5","object":"chat.completion.chunk","created":1759336803,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"-"},"finish_reason":null}],"usage":null,"obfuscation":"19MMd84PVRA"} - - data: {"id":"chatcmpl-CLu9z0WuXs4iRySqEws82JxOD8AK5","object":"chat.completion.chunk","created":1759336803,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"5"},"finish_reason":null}],"usage":null,"obfuscation":"9SzDujbErOt"} - - data: {"id":"chatcmpl-CLu9z0WuXs4iRySqEws82JxOD8AK5","object":"chat.completion.chunk","created":1759336803,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"/gl"},"finish_reason":null}],"usage":null,"obfuscation":"pNsYS7rKu"} - - data: {"id":"chatcmpl-CLu9z0WuXs4iRySqEws82JxOD8AK5","object":"chat.completion.chunk","created":1759336803,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"ob"},"finish_reason":null}],"usage":null,"obfuscation":"eKomvfkhpR"} - - data: {"id":"chatcmpl-CLu9z0WuXs4iRySqEws82JxOD8AK5","object":"chat.completion.chunk","created":1759336803,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"_tool"},"finish_reason":null}],"usage":null,"obfuscation":"qEY8rgX"} - - data: {"id":"chatcmpl-CLu9z0WuXs4iRySqEws82JxOD8AK5","object":"chat.completion.chunk","created":1759336803,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"/main"},"finish_reason":null}],"usage":null,"obfuscation":"m0PxyWj"} - - data: {"id":"chatcmpl-CLu9z0WuXs4iRySqEws82JxOD8AK5","object":"chat.completion.chunk","created":1759336803,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":".go"},"finish_reason":null}],"usage":null,"obfuscation":"6Bmr1u5NI"} - - data: {"id":"chatcmpl-CLu9z0WuXs4iRySqEws82JxOD8AK5","object":"chat.completion.chunk","created":1759336803,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"stop"}],"usage":null,"obfuscation":"dmWVrz"} - - data: {"id":"chatcmpl-CLu9z0WuXs4iRySqEws82JxOD8AK5","object":"chat.completion.chunk","created":1759336803,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6598,"completion_tokens":22,"total_tokens":6620,"prompt_tokens_details":{"cached_tokens":6528,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"DvJT"} + data: {"id":"chatcmpl-CLuTw20qPGa2sbxUQNbEFQ7ITGcAH","object":"chat.completion.chunk","created":1759338040,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6608,"completion_tokens":5,"total_tokens":6613,"prompt_tokens_details":{"cached_tokens":6528,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"fVa5H"} data: [DONE] @@ -179,4 +145,4 @@ interactions: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 2.404204167s + duration: 1.852459s diff --git a/internal/agent/testdata/TestCoderAgent/openai-gpt-5/grep_tool.yaml b/internal/agent/testdata/TestCoderAgent/openai-gpt-5/grep_tool.yaml index 8ea3eef6cd2b72e6f03f1b581eeac6aa7fa2ec28..1c52cb42950e4676b41042c6e51e944691271cf1 100644 --- a/internal/agent/testdata/TestCoderAgent/openai-gpt-5/grep_tool.yaml +++ b/internal/agent/testdata/TestCoderAgent/openai-gpt-5/grep_tool.yaml @@ -24,33 +24,29 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"chatcmpl-CLuA2dJOPms74BebvwiLxmBqTDURj","object":"chat.completion.chunk","created":1759336806,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"ztiweTXLMUQZfX"} + data: {"id":"chatcmpl-CLuTy3SIocldqGpbWNTW498BvZetk","object":"chat.completion.chunk","created":1759338042,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"zdeB5oEXLzK1UG"} - data: {"id":"chatcmpl-CLuA2dJOPms74BebvwiLxmBqTDURj","object":"chat.completion.chunk","created":1759336806,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"Using"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"wLSkmc0sct9"} + data: {"id":"chatcmpl-CLuTy3SIocldqGpbWNTW498BvZetk","object":"chat.completion.chunk","created":1759338042,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"Search"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"v4rLzfK8xb"} - data: {"id":"chatcmpl-CLuA2dJOPms74BebvwiLxmBqTDURj","object":"chat.completion.chunk","created":1759336806,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Gre"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"WtcduFxQX9uo"} + data: {"id":"chatcmpl-CLuTy3SIocldqGpbWNTW498BvZetk","object":"chat.completion.chunk","created":1759338042,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" '"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"sv4O4Ie2eWwaPQ"} - data: {"id":"chatcmpl-CLuA2dJOPms74BebvwiLxmBqTDURj","object":"chat.completion.chunk","created":1759336806,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"p"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"1zppfZBdK0kkXZA"} + data: {"id":"chatcmpl-CLuTy3SIocldqGpbWNTW498BvZetk","object":"chat.completion.chunk","created":1759338042,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"package"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"hgiI921Pg"} - data: {"id":"chatcmpl-CLuA2dJOPms74BebvwiLxmBqTDURj","object":"chat.completion.chunk","created":1759336806,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" to"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"kS38y7QZdrVlV"} + data: {"id":"chatcmpl-CLuTy3SIocldqGpbWNTW498BvZetk","object":"chat.completion.chunk","created":1759338042,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"'"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"SQn7S1KcKAJRJQ6"} - data: {"id":"chatcmpl-CLuA2dJOPms74BebvwiLxmBqTDURj","object":"chat.completion.chunk","created":1759336806,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Find"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"yc50AKQ7vUJ"} + data: {"id":"chatcmpl-CLuTy3SIocldqGpbWNTW498BvZetk","object":"chat.completion.chunk","created":1759338042,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" in"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"2DdiIvmHHmpoP"} - data: {"id":"chatcmpl-CLuA2dJOPms74BebvwiLxmBqTDURj","object":"chat.completion.chunk","created":1759336806,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" '"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"quElZdGZsH75qg"} + data: {"id":"chatcmpl-CLuTy3SIocldqGpbWNTW498BvZetk","object":"chat.completion.chunk","created":1759338042,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Go"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"UhTQWmsGvnweR"} - data: {"id":"chatcmpl-CLuA2dJOPms74BebvwiLxmBqTDURj","object":"chat.completion.chunk","created":1759336806,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"Package"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"9oDlUiTj5"} + data: {"id":"chatcmpl-CLuTy3SIocldqGpbWNTW498BvZetk","object":"chat.completion.chunk","created":1759338042,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Files"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"UGbnSmIbkh"} - data: {"id":"chatcmpl-CLuA2dJOPms74BebvwiLxmBqTDURj","object":"chat.completion.chunk","created":1759336806,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"'"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"uyZBPmTa5oa13e5"} + data: {"id":"chatcmpl-CLuTy3SIocldqGpbWNTW498BvZetk","object":"chat.completion.chunk","created":1759338042,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Using"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"s2ZsUP4iGu"} - data: {"id":"chatcmpl-CLuA2dJOPms74BebvwiLxmBqTDURj","object":"chat.completion.chunk","created":1759336806,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" in"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"i5o87GLIBDuH0"} + data: {"id":"chatcmpl-CLuTy3SIocldqGpbWNTW498BvZetk","object":"chat.completion.chunk","created":1759338042,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" grep"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"B5V2nhz7NiX"} - data: {"id":"chatcmpl-CLuA2dJOPms74BebvwiLxmBqTDURj","object":"chat.completion.chunk","created":1759336806,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Go"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"Gika8db8IU205"} + data: {"id":"chatcmpl-CLuTy3SIocldqGpbWNTW498BvZetk","object":"chat.completion.chunk","created":1759338042,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"4hvVroXutX"} - data: {"id":"chatcmpl-CLuA2dJOPms74BebvwiLxmBqTDURj","object":"chat.completion.chunk","created":1759336806,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Files"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"s9dwYOK1h8"} - - data: {"id":"chatcmpl-CLuA2dJOPms74BebvwiLxmBqTDURj","object":"chat.completion.chunk","created":1759336806,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"DTc9isbsDu"} - - data: {"id":"chatcmpl-CLuA2dJOPms74BebvwiLxmBqTDURj","object":"chat.completion.chunk","created":1759336806,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[],"usage":{"prompt_tokens":121,"completion_tokens":11,"total_tokens":132,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"R3I2nrlEJcwp5"} + data: {"id":"chatcmpl-CLuTy3SIocldqGpbWNTW498BvZetk","object":"chat.completion.chunk","created":1759338042,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[],"usage":{"prompt_tokens":121,"completion_tokens":9,"total_tokens":130,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"GoHS5k9qdSoPae"} data: [DONE] @@ -59,15 +55,15 @@ interactions: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 984.419ms + duration: 688.485208ms - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 30568 + content_length: 30641 host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/grep_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use grep to search for the word 'package' in go files\",\"role\":\"user\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/grep_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use grep to search for the word 'package' in go files\",\"role\":\"user\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" headers: Accept: - application/json @@ -83,41 +79,41 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"chatcmpl-CLuA2UtiOs7tSYjIsA6dzKVYM9y6t","object":"chat.completion.chunk","created":1759336806,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"call_dceNIlTDMoqwFrw2Xgk0vdKI","type":"function","function":{"name":"grep","arguments":""}}],"refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"J95k12ayah9C"} + data: {"id":"chatcmpl-CLuTyErvXUZ2axYA3u4rbYJahn6rB","object":"chat.completion.chunk","created":1759338042,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"call_L8OyAvrPbv51M6MBEdQCc86H","type":"function","function":{"name":"grep","arguments":""}}],"refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"7nfguMc37OT1"} - data: {"id":"chatcmpl-CLuA2UtiOs7tSYjIsA6dzKVYM9y6t","object":"chat.completion.chunk","created":1759336806,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"0HW5k3D8uqweTMm"} + data: {"id":"chatcmpl-CLuTyErvXUZ2axYA3u4rbYJahn6rB","object":"chat.completion.chunk","created":1759338042,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"Mny2BZ1DKZ8VXc8"} - data: {"id":"chatcmpl-CLuA2UtiOs7tSYjIsA6dzKVYM9y6t","object":"chat.completion.chunk","created":1759336806,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"pattern"}}]},"finish_reason":null}],"usage":null,"obfuscation":"Vbn1DkDWLIE"} + data: {"id":"chatcmpl-CLuTyErvXUZ2axYA3u4rbYJahn6rB","object":"chat.completion.chunk","created":1759338042,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"pattern"}}]},"finish_reason":null}],"usage":null,"obfuscation":"GakPHbex0GA"} - data: {"id":"chatcmpl-CLuA2UtiOs7tSYjIsA6dzKVYM9y6t","object":"chat.completion.chunk","created":1759336806,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"futMdayQq1vv8"} + data: {"id":"chatcmpl-CLuTyErvXUZ2axYA3u4rbYJahn6rB","object":"chat.completion.chunk","created":1759338042,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"mx7ZumSFCCxsA"} - data: {"id":"chatcmpl-CLuA2UtiOs7tSYjIsA6dzKVYM9y6t","object":"chat.completion.chunk","created":1759336806,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"package"}}]},"finish_reason":null}],"usage":null,"obfuscation":"OuzGR5QX6O1"} + data: {"id":"chatcmpl-CLuTyErvXUZ2axYA3u4rbYJahn6rB","object":"chat.completion.chunk","created":1759338042,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"package"}}]},"finish_reason":null}],"usage":null,"obfuscation":"zpU0U71HM1P"} - data: {"id":"chatcmpl-CLuA2UtiOs7tSYjIsA6dzKVYM9y6t","object":"chat.completion.chunk","created":1759336806,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\",\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"rzdJErmJawdme"} + data: {"id":"chatcmpl-CLuTyErvXUZ2axYA3u4rbYJahn6rB","object":"chat.completion.chunk","created":1759338042,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\",\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"XSVZ6LUFGnTLf"} - data: {"id":"chatcmpl-CLuA2UtiOs7tSYjIsA6dzKVYM9y6t","object":"chat.completion.chunk","created":1759336806,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"include"}}]},"finish_reason":null}],"usage":null,"obfuscation":"ofnIZNRQBeE"} + data: {"id":"chatcmpl-CLuTyErvXUZ2axYA3u4rbYJahn6rB","object":"chat.completion.chunk","created":1759338042,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"literal"}}]},"finish_reason":null}],"usage":null,"obfuscation":"WlEDvGv7GeR"} - data: {"id":"chatcmpl-CLuA2UtiOs7tSYjIsA6dzKVYM9y6t","object":"chat.completion.chunk","created":1759336806,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"nxwYt7taS4sF9"} + data: {"id":"chatcmpl-CLuTyErvXUZ2axYA3u4rbYJahn6rB","object":"chat.completion.chunk","created":1759338042,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_text"}}]},"finish_reason":null}],"usage":null,"obfuscation":"CI2jYQ0UeI1UF"} - data: {"id":"chatcmpl-CLuA2UtiOs7tSYjIsA6dzKVYM9y6t","object":"chat.completion.chunk","created":1759336806,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"*."}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuTyErvXUZ2axYA3u4rbYJahn6rB","object":"chat.completion.chunk","created":1759338042,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":"}}]},"finish_reason":null}],"usage":null,"obfuscation":"gNJHwA8VQBcqr7F"} - data: {"id":"chatcmpl-CLuA2UtiOs7tSYjIsA6dzKVYM9y6t","object":"chat.completion.chunk","created":1759336806,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"go"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuTyErvXUZ2axYA3u4rbYJahn6rB","object":"chat.completion.chunk","created":1759338042,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"true"}}]},"finish_reason":null}],"usage":null,"obfuscation":"JeIa0WKj2qYvAQ"} - data: {"id":"chatcmpl-CLuA2UtiOs7tSYjIsA6dzKVYM9y6t","object":"chat.completion.chunk","created":1759336806,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\",\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"SAF5tYXikrvoj"} + data: {"id":"chatcmpl-CLuTyErvXUZ2axYA3u4rbYJahn6rB","object":"chat.completion.chunk","created":1759338042,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":",\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"svkqsyljof3RDBU"} - data: {"id":"chatcmpl-CLuA2UtiOs7tSYjIsA6dzKVYM9y6t","object":"chat.completion.chunk","created":1759336806,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"literal"}}]},"finish_reason":null}],"usage":null,"obfuscation":"IX7AX1s5iuf"} + data: {"id":"chatcmpl-CLuTyErvXUZ2axYA3u4rbYJahn6rB","object":"chat.completion.chunk","created":1759338042,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"include"}}]},"finish_reason":null}],"usage":null,"obfuscation":"RCZsF75nhIK"} - data: {"id":"chatcmpl-CLuA2UtiOs7tSYjIsA6dzKVYM9y6t","object":"chat.completion.chunk","created":1759336806,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_text"}}]},"finish_reason":null}],"usage":null,"obfuscation":"uabYlFVkWHQit"} + data: {"id":"chatcmpl-CLuTyErvXUZ2axYA3u4rbYJahn6rB","object":"chat.completion.chunk","created":1759338042,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"O218vGPDOqMaT"} - data: {"id":"chatcmpl-CLuA2UtiOs7tSYjIsA6dzKVYM9y6t","object":"chat.completion.chunk","created":1759336806,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":"}}]},"finish_reason":null}],"usage":null,"obfuscation":"y2o70XfqFWuSIZX"} + data: {"id":"chatcmpl-CLuTyErvXUZ2axYA3u4rbYJahn6rB","object":"chat.completion.chunk","created":1759338042,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"*."}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLuA2UtiOs7tSYjIsA6dzKVYM9y6t","object":"chat.completion.chunk","created":1759336806,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"true"}}]},"finish_reason":null}],"usage":null,"obfuscation":"VhJKnqlQOgnPmE"} + data: {"id":"chatcmpl-CLuTyErvXUZ2axYA3u4rbYJahn6rB","object":"chat.completion.chunk","created":1759338042,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"go"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLuA2UtiOs7tSYjIsA6dzKVYM9y6t","object":"chat.completion.chunk","created":1759336806,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"}"}}]},"finish_reason":null}],"usage":null,"obfuscation":"k"} + data: {"id":"chatcmpl-CLuTyErvXUZ2axYA3u4rbYJahn6rB","object":"chat.completion.chunk","created":1759338042,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"}"}}]},"finish_reason":null}],"usage":null,"obfuscation":"7z5ZuLLblnosVxM"} - data: {"id":"chatcmpl-CLuA2UtiOs7tSYjIsA6dzKVYM9y6t","object":"chat.completion.chunk","created":1759336806,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"tool_calls"}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuTyErvXUZ2axYA3u4rbYJahn6rB","object":"chat.completion.chunk","created":1759338042,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"tool_calls"}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLuA2UtiOs7tSYjIsA6dzKVYM9y6t","object":"chat.completion.chunk","created":1759336806,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6554,"completion_tokens":225,"total_tokens":6779,"prompt_tokens_details":{"cached_tokens":1024,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":192,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"D"} + data: {"id":"chatcmpl-CLuTyErvXUZ2axYA3u4rbYJahn6rB","object":"chat.completion.chunk","created":1759338042,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6564,"completion_tokens":225,"total_tokens":6789,"prompt_tokens_details":{"cached_tokens":1024,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":192,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"v"} data: [DONE] @@ -126,15 +122,15 @@ interactions: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 6.258809167s + duration: 8.864647958s - id: 2 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 30952 + content_length: 31025 host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/grep_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use grep to search for the word 'package' in go files\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"call_dceNIlTDMoqwFrw2Xgk0vdKI\",\"function\":{\"arguments\":\"{\\\"pattern\\\":\\\"package\\\",\\\"include\\\":\\\"*.go\\\",\\\"literal_text\\\":true}\",\"name\":\"grep\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"Found 1 matches\\n/tmp/crush-test/TestCoderAgent/openai-gpt-5/grep_tool/main.go:\\n Line 1: package main\\n\",\"tool_call_id\":\"call_dceNIlTDMoqwFrw2Xgk0vdKI\",\"role\":\"tool\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/grep_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use grep to search for the word 'package' in go files\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"call_L8OyAvrPbv51M6MBEdQCc86H\",\"function\":{\"arguments\":\"{\\\"pattern\\\":\\\"package\\\",\\\"literal_text\\\":true,\\\"include\\\":\\\"*.go\\\"}\",\"name\":\"grep\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"Found 1 matches\\n/tmp/crush-test/TestCoderAgent/openai-gpt-5/grep_tool/main.go:\\n Line 1: package main\\n\",\"tool_call_id\":\"call_L8OyAvrPbv51M6MBEdQCc86H\",\"role\":\"tool\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" headers: Accept: - application/json @@ -150,39 +146,59 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"chatcmpl-CLuA8ufcXYHRoHSRryc5wqLQazzZI","object":"chat.completion.chunk","created":1759336812,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"OdrQgLef14"} + data: {"id":"chatcmpl-CLuU7Cb3TA7rZDR12hNooqNsJvRfx","object":"chat.completion.chunk","created":1759338051,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"pWZU7ZianE"} + + data: {"id":"chatcmpl-CLuU7Cb3TA7rZDR12hNooqNsJvRfx","object":"chat.completion.chunk","created":1759338051,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"/"},"finish_reason":null}],"usage":null,"obfuscation":"ysa0GvJ6GXK"} + + data: {"id":"chatcmpl-CLuU7Cb3TA7rZDR12hNooqNsJvRfx","object":"chat.completion.chunk","created":1759338051,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"tmp"},"finish_reason":null}],"usage":null,"obfuscation":"icUnuXMY1"} + + data: {"id":"chatcmpl-CLuU7Cb3TA7rZDR12hNooqNsJvRfx","object":"chat.completion.chunk","created":1759338051,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"/cr"},"finish_reason":null}],"usage":null,"obfuscation":"lYV7xwMyV"} + + data: {"id":"chatcmpl-CLuU7Cb3TA7rZDR12hNooqNsJvRfx","object":"chat.completion.chunk","created":1759338051,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"ush"},"finish_reason":null}],"usage":null,"obfuscation":"v8ndP8lcK"} + + data: {"id":"chatcmpl-CLuU7Cb3TA7rZDR12hNooqNsJvRfx","object":"chat.completion.chunk","created":1759338051,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"-test"},"finish_reason":null}],"usage":null,"obfuscation":"dhXSJDG"} + + data: {"id":"chatcmpl-CLuU7Cb3TA7rZDR12hNooqNsJvRfx","object":"chat.completion.chunk","created":1759338051,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"/Test"},"finish_reason":null}],"usage":null,"obfuscation":"rzWSotZ"} + + data: {"id":"chatcmpl-CLuU7Cb3TA7rZDR12hNooqNsJvRfx","object":"chat.completion.chunk","created":1759338051,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"Coder"},"finish_reason":null}],"usage":null,"obfuscation":"sMCpYEp"} + + data: {"id":"chatcmpl-CLuU7Cb3TA7rZDR12hNooqNsJvRfx","object":"chat.completion.chunk","created":1759338051,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"Agent"},"finish_reason":null}],"usage":null,"obfuscation":"zQEunv5"} + + data: {"id":"chatcmpl-CLuU7Cb3TA7rZDR12hNooqNsJvRfx","object":"chat.completion.chunk","created":1759338051,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"/open"},"finish_reason":null}],"usage":null,"obfuscation":"qGEAGeT"} + + data: {"id":"chatcmpl-CLuU7Cb3TA7rZDR12hNooqNsJvRfx","object":"chat.completion.chunk","created":1759338051,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"ai"},"finish_reason":null}],"usage":null,"obfuscation":"pCxg0AVmdc"} - data: {"id":"chatcmpl-CLuA8ufcXYHRoHSRryc5wqLQazzZI","object":"chat.completion.chunk","created":1759336812,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"Found"},"finish_reason":null}],"usage":null,"obfuscation":"gkLX8KB"} + data: {"id":"chatcmpl-CLuU7Cb3TA7rZDR12hNooqNsJvRfx","object":"chat.completion.chunk","created":1759338051,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"-g"},"finish_reason":null}],"usage":null,"obfuscation":"YLsR0I6xZb"} - data: {"id":"chatcmpl-CLuA8ufcXYHRoHSRryc5wqLQazzZI","object":"chat.completion.chunk","created":1759336812,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" in"},"finish_reason":null}],"usage":null,"obfuscation":"jBm3EuMai"} + data: {"id":"chatcmpl-CLuU7Cb3TA7rZDR12hNooqNsJvRfx","object":"chat.completion.chunk","created":1759338051,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"pt"},"finish_reason":null}],"usage":null,"obfuscation":"6NJ3C9g3iQ"} - data: {"id":"chatcmpl-CLuA8ufcXYHRoHSRryc5wqLQazzZI","object":"chat.completion.chunk","created":1759336812,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" "},"finish_reason":null}],"usage":null,"obfuscation":"P8FpsgevOeZ"} + data: {"id":"chatcmpl-CLuU7Cb3TA7rZDR12hNooqNsJvRfx","object":"chat.completion.chunk","created":1759338051,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"-"},"finish_reason":null}],"usage":null,"obfuscation":"cqIBiRK3mmn"} - data: {"id":"chatcmpl-CLuA8ufcXYHRoHSRryc5wqLQazzZI","object":"chat.completion.chunk","created":1759336812,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"1"},"finish_reason":null}],"usage":null,"obfuscation":"OsPKMviHjzC"} + data: {"id":"chatcmpl-CLuU7Cb3TA7rZDR12hNooqNsJvRfx","object":"chat.completion.chunk","created":1759338051,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"5"},"finish_reason":null}],"usage":null,"obfuscation":"EyL6tTsDK8T"} - data: {"id":"chatcmpl-CLuA8ufcXYHRoHSRryc5wqLQazzZI","object":"chat.completion.chunk","created":1759336812,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" file"},"finish_reason":null}],"usage":null,"obfuscation":"DWxv9Dg"} + data: {"id":"chatcmpl-CLuU7Cb3TA7rZDR12hNooqNsJvRfx","object":"chat.completion.chunk","created":1759338051,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"/"},"finish_reason":null}],"usage":null,"obfuscation":"L0rEJ1BruIu"} - data: {"id":"chatcmpl-CLuA8ufcXYHRoHSRryc5wqLQazzZI","object":"chat.completion.chunk","created":1759336812,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":":\n"},"finish_reason":null}],"usage":null,"obfuscation":"HlLoAB3Ni"} + data: {"id":"chatcmpl-CLuU7Cb3TA7rZDR12hNooqNsJvRfx","object":"chat.completion.chunk","created":1759338051,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"grep"},"finish_reason":null}],"usage":null,"obfuscation":"LdhgJXBx"} - data: {"id":"chatcmpl-CLuA8ufcXYHRoHSRryc5wqLQazzZI","object":"chat.completion.chunk","created":1759336812,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"-"},"finish_reason":null}],"usage":null,"obfuscation":"lXkzzDbB1Dh"} + data: {"id":"chatcmpl-CLuU7Cb3TA7rZDR12hNooqNsJvRfx","object":"chat.completion.chunk","created":1759338051,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"_tool"},"finish_reason":null}],"usage":null,"obfuscation":"uHhIQAK"} - data: {"id":"chatcmpl-CLuA8ufcXYHRoHSRryc5wqLQazzZI","object":"chat.completion.chunk","created":1759336812,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" main"},"finish_reason":null}],"usage":null,"obfuscation":"PYixWiE"} + data: {"id":"chatcmpl-CLuU7Cb3TA7rZDR12hNooqNsJvRfx","object":"chat.completion.chunk","created":1759338051,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"/main"},"finish_reason":null}],"usage":null,"obfuscation":"ZHuoMro"} - data: {"id":"chatcmpl-CLuA8ufcXYHRoHSRryc5wqLQazzZI","object":"chat.completion.chunk","created":1759336812,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":".go"},"finish_reason":null}],"usage":null,"obfuscation":"e5tqsG4FX"} + data: {"id":"chatcmpl-CLuU7Cb3TA7rZDR12hNooqNsJvRfx","object":"chat.completion.chunk","created":1759338051,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":".go"},"finish_reason":null}],"usage":null,"obfuscation":"5fYlAoELn"} - data: {"id":"chatcmpl-CLuA8ufcXYHRoHSRryc5wqLQazzZI","object":"chat.completion.chunk","created":1759336812,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":":"},"finish_reason":null}],"usage":null,"obfuscation":"7PcdyG3PyJ0"} + data: {"id":"chatcmpl-CLuU7Cb3TA7rZDR12hNooqNsJvRfx","object":"chat.completion.chunk","created":1759338051,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":":"},"finish_reason":null}],"usage":null,"obfuscation":"BCvybZELYPp"} - data: {"id":"chatcmpl-CLuA8ufcXYHRoHSRryc5wqLQazzZI","object":"chat.completion.chunk","created":1759336812,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"1"},"finish_reason":null}],"usage":null,"obfuscation":"EBR5wayeZY4"} + data: {"id":"chatcmpl-CLuU7Cb3TA7rZDR12hNooqNsJvRfx","object":"chat.completion.chunk","created":1759338051,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"1"},"finish_reason":null}],"usage":null,"obfuscation":"vVKtQVZDSss"} - data: {"id":"chatcmpl-CLuA8ufcXYHRoHSRryc5wqLQazzZI","object":"chat.completion.chunk","created":1759336812,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":":"},"finish_reason":null}],"usage":null,"obfuscation":"iT6kbrHSHHT"} + data: {"id":"chatcmpl-CLuU7Cb3TA7rZDR12hNooqNsJvRfx","object":"chat.completion.chunk","created":1759338051,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":":"},"finish_reason":null}],"usage":null,"obfuscation":"GBGSEdYtzJf"} - data: {"id":"chatcmpl-CLuA8ufcXYHRoHSRryc5wqLQazzZI","object":"chat.completion.chunk","created":1759336812,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" package"},"finish_reason":null}],"usage":null,"obfuscation":"zmiQ"} + data: {"id":"chatcmpl-CLuU7Cb3TA7rZDR12hNooqNsJvRfx","object":"chat.completion.chunk","created":1759338051,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" package"},"finish_reason":null}],"usage":null,"obfuscation":"TWs9"} - data: {"id":"chatcmpl-CLuA8ufcXYHRoHSRryc5wqLQazzZI","object":"chat.completion.chunk","created":1759336812,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" main"},"finish_reason":null}],"usage":null,"obfuscation":"4Q8nCZz"} + data: {"id":"chatcmpl-CLuU7Cb3TA7rZDR12hNooqNsJvRfx","object":"chat.completion.chunk","created":1759338051,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" main"},"finish_reason":null}],"usage":null,"obfuscation":"p9nujtA"} - data: {"id":"chatcmpl-CLuA8ufcXYHRoHSRryc5wqLQazzZI","object":"chat.completion.chunk","created":1759336812,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"stop"}],"usage":null,"obfuscation":"NBCjMg"} + data: {"id":"chatcmpl-CLuU7Cb3TA7rZDR12hNooqNsJvRfx","object":"chat.completion.chunk","created":1759338051,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"stop"}],"usage":null,"obfuscation":"sVQMej"} - data: {"id":"chatcmpl-CLuA8ufcXYHRoHSRryc5wqLQazzZI","object":"chat.completion.chunk","created":1759336812,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6623,"completion_tokens":17,"total_tokens":6640,"prompt_tokens_details":{"cached_tokens":6528,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"GnXY"} + data: {"id":"chatcmpl-CLuU7Cb3TA7rZDR12hNooqNsJvRfx","object":"chat.completion.chunk","created":1759338051,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6633,"completion_tokens":27,"total_tokens":6660,"prompt_tokens_details":{"cached_tokens":6528,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"eAuQ"} data: [DONE] @@ -191,4 +207,4 @@ interactions: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 1.977695916s + duration: 1.64240325s diff --git a/internal/agent/testdata/TestCoderAgent/openai-gpt-5/ls_tool.yaml b/internal/agent/testdata/TestCoderAgent/openai-gpt-5/ls_tool.yaml index 7e24f9c1c23175679ebf3edae8639749722baca2..1233058b32c3e1cc3f6f4800785746050f5c3155 100644 --- a/internal/agent/testdata/TestCoderAgent/openai-gpt-5/ls_tool.yaml +++ b/internal/agent/testdata/TestCoderAgent/openai-gpt-5/ls_tool.yaml @@ -24,31 +24,25 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"chatcmpl-CLuABmCUeCewB1g01xshdORoWjqpf","object":"chat.completion.chunk","created":1759336815,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"N41RyjiPnDqaz5"} + data: {"id":"chatcmpl-CLuU8eMrWn3aPVUyPxIsyqpVXTNq0","object":"chat.completion.chunk","created":1759338052,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"byeH7w5TFEQa4S"} - data: {"id":"chatcmpl-CLuABmCUeCewB1g01xshdORoWjqpf","object":"chat.completion.chunk","created":1759336815,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"Using"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"xh2U346BlUl"} + data: {"id":"chatcmpl-CLuU8eMrWn3aPVUyPxIsyqpVXTNq0","object":"chat.completion.chunk","created":1759338052,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"Listing"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"GW3h1aC0o"} - data: {"id":"chatcmpl-CLuABmCUeCewB1g01xshdORoWjqpf","object":"chat.completion.chunk","created":1759336815,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" '"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"g889VbADQGz5w5"} + data: {"id":"chatcmpl-CLuU8eMrWn3aPVUyPxIsyqpVXTNq0","object":"chat.completion.chunk","created":1759338052,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Files"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"hvf3ebLYGF"} - data: {"id":"chatcmpl-CLuABmCUeCewB1g01xshdORoWjqpf","object":"chat.completion.chunk","created":1759336815,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"ls"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"U2i5vosGQrDvzG"} + data: {"id":"chatcmpl-CLuU8eMrWn3aPVUyPxIsyqpVXTNq0","object":"chat.completion.chunk","created":1759338052,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" in"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"AjTKvIL4UedFa"} - data: {"id":"chatcmpl-CLuABmCUeCewB1g01xshdORoWjqpf","object":"chat.completion.chunk","created":1759336815,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"'"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"GAwkqAETE404gsW"} + data: {"id":"chatcmpl-CLuU8eMrWn3aPVUyPxIsyqpVXTNq0","object":"chat.completion.chunk","created":1759338052,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Current"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"OZC77OuP"} - data: {"id":"chatcmpl-CLuABmCUeCewB1g01xshdORoWjqpf","object":"chat.completion.chunk","created":1759336815,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" to"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"VN2cKOBjGnVcC"} + data: {"id":"chatcmpl-CLuU8eMrWn3aPVUyPxIsyqpVXTNq0","object":"chat.completion.chunk","created":1759338052,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Directory"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"4E7n5C"} - data: {"id":"chatcmpl-CLuABmCUeCewB1g01xshdORoWjqpf","object":"chat.completion.chunk","created":1759336815,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" List"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"uKSxr1dZtxq"} + data: {"id":"chatcmpl-CLuU8eMrWn3aPVUyPxIsyqpVXTNq0","object":"chat.completion.chunk","created":1759338052,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Using"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"0tw6Kby3Ym"} - data: {"id":"chatcmpl-CLuABmCUeCewB1g01xshdORoWjqpf","object":"chat.completion.chunk","created":1759336815,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Files"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"hKxG59DKlC"} + data: {"id":"chatcmpl-CLuU8eMrWn3aPVUyPxIsyqpVXTNq0","object":"chat.completion.chunk","created":1759338052,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" LS"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"Uz07pVICfrUqt"} - data: {"id":"chatcmpl-CLuABmCUeCewB1g01xshdORoWjqpf","object":"chat.completion.chunk","created":1759336815,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" in"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"9fn4yRLDsriHO"} + data: {"id":"chatcmpl-CLuU8eMrWn3aPVUyPxIsyqpVXTNq0","object":"chat.completion.chunk","created":1759338052,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"IAYWI5hiN8"} - data: {"id":"chatcmpl-CLuABmCUeCewB1g01xshdORoWjqpf","object":"chat.completion.chunk","created":1759336815,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Current"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"rc0kDQbR"} - - data: {"id":"chatcmpl-CLuABmCUeCewB1g01xshdORoWjqpf","object":"chat.completion.chunk","created":1759336815,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Directory"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"abLUI5"} - - data: {"id":"chatcmpl-CLuABmCUeCewB1g01xshdORoWjqpf","object":"chat.completion.chunk","created":1759336815,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"GWUSFdhsiD"} - - data: {"id":"chatcmpl-CLuABmCUeCewB1g01xshdORoWjqpf","object":"chat.completion.chunk","created":1759336815,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[],"usage":{"prompt_tokens":118,"completion_tokens":10,"total_tokens":128,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"V1w98H3jdoIQU"} + data: {"id":"chatcmpl-CLuU8eMrWn3aPVUyPxIsyqpVXTNq0","object":"chat.completion.chunk","created":1759338052,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[],"usage":{"prompt_tokens":118,"completion_tokens":7,"total_tokens":125,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"dxQRmtoc2C3OeM"} data: [DONE] @@ -57,15 +51,15 @@ interactions: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 388.661333ms + duration: 400.379666ms - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 30562 + content_length: 30635 host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/ls_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use ls to list the files in the current directory\",\"role\":\"user\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/ls_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use ls to list the files in the current directory\",\"role\":\"user\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" headers: Accept: - application/json @@ -81,21 +75,21 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"chatcmpl-CLuABtrF8M10W2c9KP2wIDClwtkoz","object":"chat.completion.chunk","created":1759336815,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"call_yzRoaub70QbabPY4Pdv7eYsY","type":"function","function":{"name":"ls","arguments":""}}],"refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"zP9rhS4l3vs4wl"} + data: {"id":"chatcmpl-CLuU9kSpr0DQBY60wSxrPEY60PgrK","object":"chat.completion.chunk","created":1759338053,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"call_RqA2h3dtO9UuL7MCVyYQfHez","type":"function","function":{"name":"ls","arguments":""}}],"refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"RkUubRSM4BeyM2"} - data: {"id":"chatcmpl-CLuABtrF8M10W2c9KP2wIDClwtkoz","object":"chat.completion.chunk","created":1759336815,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"OChvH3oAJ6Zh6TZ"} + data: {"id":"chatcmpl-CLuU9kSpr0DQBY60wSxrPEY60PgrK","object":"chat.completion.chunk","created":1759338053,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"isCJhe1u8yz1rEv"} - data: {"id":"chatcmpl-CLuABtrF8M10W2c9KP2wIDClwtkoz","object":"chat.completion.chunk","created":1759336815,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"path"}}]},"finish_reason":null}],"usage":null,"obfuscation":"R1YZWpdopmaD9g"} + data: {"id":"chatcmpl-CLuU9kSpr0DQBY60wSxrPEY60PgrK","object":"chat.completion.chunk","created":1759338053,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"path"}}]},"finish_reason":null}],"usage":null,"obfuscation":"0fGB1PvIL1oOt9"} - data: {"id":"chatcmpl-CLuABtrF8M10W2c9KP2wIDClwtkoz","object":"chat.completion.chunk","created":1759336815,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":"}}]},"finish_reason":null}],"usage":null,"obfuscation":"fHe93CxKxU9vZCm"} + data: {"id":"chatcmpl-CLuU9kSpr0DQBY60wSxrPEY60PgrK","object":"chat.completion.chunk","created":1759338053,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"zCW4Tz9m4lx7I"} - data: {"id":"chatcmpl-CLuABtrF8M10W2c9KP2wIDClwtkoz","object":"chat.completion.chunk","created":1759336815,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" \".\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"ugZ89efig8MT"} + data: {"id":"chatcmpl-CLuU9kSpr0DQBY60wSxrPEY60PgrK","object":"chat.completion.chunk","created":1759338053,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":".\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"Lv24MmoqsDQO8iV"} - data: {"id":"chatcmpl-CLuABtrF8M10W2c9KP2wIDClwtkoz","object":"chat.completion.chunk","created":1759336815,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"}"}}]},"finish_reason":null}],"usage":null,"obfuscation":"G"} + data: {"id":"chatcmpl-CLuU9kSpr0DQBY60wSxrPEY60PgrK","object":"chat.completion.chunk","created":1759338053,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"}"}}]},"finish_reason":null}],"usage":null,"obfuscation":"c"} - data: {"id":"chatcmpl-CLuABtrF8M10W2c9KP2wIDClwtkoz","object":"chat.completion.chunk","created":1759336815,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"tool_calls"}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuU9kSpr0DQBY60wSxrPEY60PgrK","object":"chat.completion.chunk","created":1759338053,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"tool_calls"}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLuABtrF8M10W2c9KP2wIDClwtkoz","object":"chat.completion.chunk","created":1759336815,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6551,"completion_tokens":215,"total_tokens":6766,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":192,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"LrfJ"} + data: {"id":"chatcmpl-CLuU9kSpr0DQBY60wSxrPEY60PgrK","object":"chat.completion.chunk","created":1759338053,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6561,"completion_tokens":151,"total_tokens":6712,"prompt_tokens_details":{"cached_tokens":1024,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":128,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"M"} data: [DONE] @@ -104,15 +98,15 @@ interactions: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 19.051137583s + duration: 5.927535916s - id: 2 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 30869 + content_length: 30943 host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/ls_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use ls to list the files in the current directory\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"call_yzRoaub70QbabPY4Pdv7eYsY\",\"function\":{\"arguments\":\"{\\\"path\\\": \\\".\\\"}\",\"name\":\"ls\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"- /tmp/crush-test/TestCoderAgent/openai-gpt-5/ls_tool/\\n - go.mod\\n - main.go\\n\",\"tool_call_id\":\"call_yzRoaub70QbabPY4Pdv7eYsY\",\"role\":\"tool\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/ls_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use ls to list the files in the current directory\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"call_RqA2h3dtO9UuL7MCVyYQfHez\",\"function\":{\"arguments\":\"{\\\"path\\\":\\\".\\\"}\",\"name\":\"ls\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"\\n- /tmp/crush-test/TestCoderAgent/openai-gpt-5/ls_tool/\\n - go.mod\\n - main.go\\n\",\"tool_call_id\":\"call_RqA2h3dtO9UuL7MCVyYQfHez\",\"role\":\"tool\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" headers: Accept: - application/json @@ -128,25 +122,25 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"chatcmpl-CLuAUitt0ELlA5pTCtJAMpvgNsQjM","object":"chat.completion.chunk","created":1759336834,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"bnCvge2Wxp"} + data: {"id":"chatcmpl-CLuUEIuFu167ycWcTCd3OWIMOhJaP","object":"chat.completion.chunk","created":1759338058,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"zgjyTRFUoo"} - data: {"id":"chatcmpl-CLuAUitt0ELlA5pTCtJAMpvgNsQjM","object":"chat.completion.chunk","created":1759336834,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"-"},"finish_reason":null}],"usage":null,"obfuscation":"cMJsOLQHTDv"} + data: {"id":"chatcmpl-CLuUEIuFu167ycWcTCd3OWIMOhJaP","object":"chat.completion.chunk","created":1759338058,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"-"},"finish_reason":null}],"usage":null,"obfuscation":"4n311JsLkp8"} - data: {"id":"chatcmpl-CLuAUitt0ELlA5pTCtJAMpvgNsQjM","object":"chat.completion.chunk","created":1759336834,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" go"},"finish_reason":null}],"usage":null,"obfuscation":"dmH1UVFIk"} + data: {"id":"chatcmpl-CLuUEIuFu167ycWcTCd3OWIMOhJaP","object":"chat.completion.chunk","created":1759338058,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" go"},"finish_reason":null}],"usage":null,"obfuscation":"MGS5wX22w"} - data: {"id":"chatcmpl-CLuAUitt0ELlA5pTCtJAMpvgNsQjM","object":"chat.completion.chunk","created":1759336834,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":".mod"},"finish_reason":null}],"usage":null,"obfuscation":"vg3wepBz"} + data: {"id":"chatcmpl-CLuUEIuFu167ycWcTCd3OWIMOhJaP","object":"chat.completion.chunk","created":1759338058,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":".mod"},"finish_reason":null}],"usage":null,"obfuscation":"Nqqgpa2C"} - data: {"id":"chatcmpl-CLuAUitt0ELlA5pTCtJAMpvgNsQjM","object":"chat.completion.chunk","created":1759336834,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"\n"},"finish_reason":null}],"usage":null,"obfuscation":"qCsSeOXFdA"} + data: {"id":"chatcmpl-CLuUEIuFu167ycWcTCd3OWIMOhJaP","object":"chat.completion.chunk","created":1759338058,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"\n"},"finish_reason":null}],"usage":null,"obfuscation":"8m0YSFhdBX"} - data: {"id":"chatcmpl-CLuAUitt0ELlA5pTCtJAMpvgNsQjM","object":"chat.completion.chunk","created":1759336834,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"-"},"finish_reason":null}],"usage":null,"obfuscation":"gN68mN3jnvD"} + data: {"id":"chatcmpl-CLuUEIuFu167ycWcTCd3OWIMOhJaP","object":"chat.completion.chunk","created":1759338058,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"-"},"finish_reason":null}],"usage":null,"obfuscation":"Zi3D1LKAnJ7"} - data: {"id":"chatcmpl-CLuAUitt0ELlA5pTCtJAMpvgNsQjM","object":"chat.completion.chunk","created":1759336834,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" main"},"finish_reason":null}],"usage":null,"obfuscation":"ruhKGPr"} + data: {"id":"chatcmpl-CLuUEIuFu167ycWcTCd3OWIMOhJaP","object":"chat.completion.chunk","created":1759338058,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" main"},"finish_reason":null}],"usage":null,"obfuscation":"ISgfB16"} - data: {"id":"chatcmpl-CLuAUitt0ELlA5pTCtJAMpvgNsQjM","object":"chat.completion.chunk","created":1759336834,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":".go"},"finish_reason":null}],"usage":null,"obfuscation":"JkgSy2TRl"} + data: {"id":"chatcmpl-CLuUEIuFu167ycWcTCd3OWIMOhJaP","object":"chat.completion.chunk","created":1759338058,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":".go"},"finish_reason":null}],"usage":null,"obfuscation":"t39hjPsGa"} - data: {"id":"chatcmpl-CLuAUitt0ELlA5pTCtJAMpvgNsQjM","object":"chat.completion.chunk","created":1759336834,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"stop"}],"usage":null,"obfuscation":"OTQ3L5"} + data: {"id":"chatcmpl-CLuUEIuFu167ycWcTCd3OWIMOhJaP","object":"chat.completion.chunk","created":1759338058,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"stop"}],"usage":null,"obfuscation":"qIBfrn"} - data: {"id":"chatcmpl-CLuAUitt0ELlA5pTCtJAMpvgNsQjM","object":"chat.completion.chunk","created":1759336834,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6607,"completion_tokens":10,"total_tokens":6617,"prompt_tokens_details":{"cached_tokens":1024,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"A6my"} + data: {"id":"chatcmpl-CLuUEIuFu167ycWcTCd3OWIMOhJaP","object":"chat.completion.chunk","created":1759338058,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6618,"completion_tokens":10,"total_tokens":6628,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"C2liTAQ"} data: [DONE] @@ -155,4 +149,4 @@ interactions: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 3.742558167s + duration: 1.322283666s diff --git a/internal/agent/testdata/TestCoderAgent/openai-gpt-5/multiedit_tool.yaml b/internal/agent/testdata/TestCoderAgent/openai-gpt-5/multiedit_tool.yaml index d86ba69eb4ee76f09521cee2d9a5ea625beff0f4..08e8ba2f15827f57bb9669774f3e0a69784dec12 100644 --- a/internal/agent/testdata/TestCoderAgent/openai-gpt-5/multiedit_tool.yaml +++ b/internal/agent/testdata/TestCoderAgent/openai-gpt-5/multiedit_tool.yaml @@ -24,27 +24,31 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"chatcmpl-CLuAYMVOmFn5iNZeGgMQtfrgSk5v5","object":"chat.completion.chunk","created":1759336838,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"ocosaPT5BY98Nl"} + data: {"id":"chatcmpl-CLuUGnQ3olyd8W01dcr6WOixEKWWh","object":"chat.completion.chunk","created":1759338060,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"iVeuhl5Ejb6nB0"} - data: {"id":"chatcmpl-CLuAYMVOmFn5iNZeGgMQtfrgSk5v5","object":"chat.completion.chunk","created":1759336838,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":"Edit"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"O2OLrKT1E4tf"} + data: {"id":"chatcmpl-CLuUGnQ3olyd8W01dcr6WOixEKWWh","object":"chat.completion.chunk","created":1759338060,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":"Autom"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"cCJV9zXuCSB"} - data: {"id":"chatcmpl-CLuAYMVOmFn5iNZeGgMQtfrgSk5v5","object":"chat.completion.chunk","created":1759336838,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":" Code"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"YiW8eRkiTpV"} + data: {"id":"chatcmpl-CLuUGnQ3olyd8W01dcr6WOixEKWWh","object":"chat.completion.chunk","created":1759338060,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":"ate"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"nDIRvhsc2wZrS"} - data: {"id":"chatcmpl-CLuAYMVOmFn5iNZeGgMQtfrgSk5v5","object":"chat.completion.chunk","created":1759336838,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":" for"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"MSkV28Yv6mET"} + data: {"id":"chatcmpl-CLuUGnQ3olyd8W01dcr6WOixEKWWh","object":"chat.completion.chunk","created":1759338060,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":" Code"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"tRmmYg77PHU"} - data: {"id":"chatcmpl-CLuAYMVOmFn5iNZeGgMQtfrgSk5v5","object":"chat.completion.chunk","created":1759336838,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":" Greeting"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"PDD7iC3"} + data: {"id":"chatcmpl-CLuUGnQ3olyd8W01dcr6WOixEKWWh","object":"chat.completion.chunk","created":1759338060,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":" Update"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"YorSURDDn"} - data: {"id":"chatcmpl-CLuAYMVOmFn5iNZeGgMQtfrgSk5v5","object":"chat.completion.chunk","created":1759336838,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":" Update"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"imCx5U7cP"} + data: {"id":"chatcmpl-CLuUGnQ3olyd8W01dcr6WOixEKWWh","object":"chat.completion.chunk","created":1759338060,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":" and"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"yNGrdX13Ab27"} - data: {"id":"chatcmpl-CLuAYMVOmFn5iNZeGgMQtfrgSk5v5","object":"chat.completion.chunk","created":1759336838,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":" in"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"QsxicO0rLtKXM"} + data: {"id":"chatcmpl-CLuUGnQ3olyd8W01dcr6WOixEKWWh","object":"chat.completion.chunk","created":1759338060,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":" Add"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"dkZjI7cm10Lp"} - data: {"id":"chatcmpl-CLuAYMVOmFn5iNZeGgMQtfrgSk5v5","object":"chat.completion.chunk","created":1759336838,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":" main"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"D8iMPbOEr26"} + data: {"id":"chatcmpl-CLuUGnQ3olyd8W01dcr6WOixEKWWh","object":"chat.completion.chunk","created":1759338060,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":" Comment"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"HmNSoDua"} - data: {"id":"chatcmpl-CLuAYMVOmFn5iNZeGgMQtfrgSk5v5","object":"chat.completion.chunk","created":1759336838,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":".go"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"bfESheAj6RscL"} + data: {"id":"chatcmpl-CLuUGnQ3olyd8W01dcr6WOixEKWWh","object":"chat.completion.chunk","created":1759338060,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":" in"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"FjAT6tv94K2VM"} - data: {"id":"chatcmpl-CLuAYMVOmFn5iNZeGgMQtfrgSk5v5","object":"chat.completion.chunk","created":1759336838,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"9sQgj0yBRQ"} + data: {"id":"chatcmpl-CLuUGnQ3olyd8W01dcr6WOixEKWWh","object":"chat.completion.chunk","created":1759338060,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":" main"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"JX8EpbVOHbZ"} - data: {"id":"chatcmpl-CLuAYMVOmFn5iNZeGgMQtfrgSk5v5","object":"chat.completion.chunk","created":1759336838,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[],"usage":{"prompt_tokens":140,"completion_tokens":8,"total_tokens":148,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"I1En6N8ed1gRZY"} + data: {"id":"chatcmpl-CLuUGnQ3olyd8W01dcr6WOixEKWWh","object":"chat.completion.chunk","created":1759338060,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":".go"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"dpgiHsAN8Hwk5"} + + data: {"id":"chatcmpl-CLuUGnQ3olyd8W01dcr6WOixEKWWh","object":"chat.completion.chunk","created":1759338060,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"VR194jkOpa"} + + data: {"id":"chatcmpl-CLuUGnQ3olyd8W01dcr6WOixEKWWh","object":"chat.completion.chunk","created":1759338060,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[],"usage":{"prompt_tokens":140,"completion_tokens":10,"total_tokens":150,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"IsoU7m51ax049"} data: [DONE] @@ -53,15 +57,15 @@ interactions: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 590.596125ms + duration: 462.968291ms - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 30648 + content_length: 30721 host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/multiedit_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use multiedit to change 'Hello, World!' to 'Hello, Crush!' and add a comment '// Greeting' above the fmt.Println line in main.go\",\"role\":\"user\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/multiedit_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use multiedit to change 'Hello, World!' to 'Hello, Crush!' and add a comment '// Greeting' above the fmt.Println line in main.go\",\"role\":\"user\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" headers: Accept: - application/json @@ -77,57 +81,31 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"chatcmpl-CLuAYEW78p5bIx4q4TNiSf8F8OVib","object":"chat.completion.chunk","created":1759336838,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"call_LXjRshZtriL7BnthvT3NmyWp","type":"function","function":{"name":"ls","arguments":""}}],"refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"75G1u3L4JxkAYc"} - - data: {"id":"chatcmpl-CLuAYEW78p5bIx4q4TNiSf8F8OVib","object":"chat.completion.chunk","created":1759336838,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"YutXchXBtCy6v3r"} - - data: {"id":"chatcmpl-CLuAYEW78p5bIx4q4TNiSf8F8OVib","object":"chat.completion.chunk","created":1759336838,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"path"}}]},"finish_reason":null}],"usage":null,"obfuscation":"tryGq8IojJlfxF"} - - data: {"id":"chatcmpl-CLuAYEW78p5bIx4q4TNiSf8F8OVib","object":"chat.completion.chunk","created":1759336838,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":"}}]},"finish_reason":null}],"usage":null,"obfuscation":"wM2RizAoB8tMjr0"} - - data: {"id":"chatcmpl-CLuAYEW78p5bIx4q4TNiSf8F8OVib","object":"chat.completion.chunk","created":1759336838,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" \"/"}}]},"finish_reason":null}],"usage":null,"obfuscation":"1J2TBLmWJshbio"} - - data: {"id":"chatcmpl-CLuAYEW78p5bIx4q4TNiSf8F8OVib","object":"chat.completion.chunk","created":1759336838,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"tmp"}}]},"finish_reason":null}],"usage":null,"obfuscation":"oDZ6bRtcxUT8Ruc"} - - data: {"id":"chatcmpl-CLuAYEW78p5bIx4q4TNiSf8F8OVib","object":"chat.completion.chunk","created":1759336838,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/cr"}}]},"finish_reason":null}],"usage":null,"obfuscation":"z3PXYIRhmy8nT2O"} - - data: {"id":"chatcmpl-CLuAYEW78p5bIx4q4TNiSf8F8OVib","object":"chat.completion.chunk","created":1759336838,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ush"}}]},"finish_reason":null}],"usage":null,"obfuscation":"Yg8JzVGkxwSP07J"} - - data: {"id":"chatcmpl-CLuAYEW78p5bIx4q4TNiSf8F8OVib","object":"chat.completion.chunk","created":1759336838,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"-test"}}]},"finish_reason":null}],"usage":null,"obfuscation":"Y3FiwsnLP33lk"} - - data: {"id":"chatcmpl-CLuAYEW78p5bIx4q4TNiSf8F8OVib","object":"chat.completion.chunk","created":1759336838,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/Test"}}]},"finish_reason":null}],"usage":null,"obfuscation":"rNFV4Uzq7BM3u"} - - data: {"id":"chatcmpl-CLuAYEW78p5bIx4q4TNiSf8F8OVib","object":"chat.completion.chunk","created":1759336838,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Coder"}}]},"finish_reason":null}],"usage":null,"obfuscation":"mTQf0CbtZHVbw"} - - data: {"id":"chatcmpl-CLuAYEW78p5bIx4q4TNiSf8F8OVib","object":"chat.completion.chunk","created":1759336838,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Agent"}}]},"finish_reason":null}],"usage":null,"obfuscation":"iVba3NylJtPF9"} - - data: {"id":"chatcmpl-CLuAYEW78p5bIx4q4TNiSf8F8OVib","object":"chat.completion.chunk","created":1759336838,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/open"}}]},"finish_reason":null}],"usage":null,"obfuscation":"nywFBvOK7FYfZ"} - - data: {"id":"chatcmpl-CLuAYEW78p5bIx4q4TNiSf8F8OVib","object":"chat.completion.chunk","created":1759336838,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ai"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuUGBbbAiRQktwne0lQyVjm7kDMB","object":"chat.completion.chunk","created":1759338060,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"call_WzOzZTdXsVNlFLcrAbqvJD5p","type":"function","function":{"name":"ls","arguments":""}}],"refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"sKqVt8YEvscd6m"} - data: {"id":"chatcmpl-CLuAYEW78p5bIx4q4TNiSf8F8OVib","object":"chat.completion.chunk","created":1759336838,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"-g"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuUGBbbAiRQktwne0lQyVjm7kDMB","object":"chat.completion.chunk","created":1759338060,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"FdheUd0OZ4TbqQQ"} - data: {"id":"chatcmpl-CLuAYEW78p5bIx4q4TNiSf8F8OVib","object":"chat.completion.chunk","created":1759336838,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"pt"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuUGBbbAiRQktwne0lQyVjm7kDMB","object":"chat.completion.chunk","created":1759338060,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"path"}}]},"finish_reason":null}],"usage":null,"obfuscation":"PcRxRdiZlkZDGn"} - data: {"id":"chatcmpl-CLuAYEW78p5bIx4q4TNiSf8F8OVib","object":"chat.completion.chunk","created":1759336838,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"-"}}]},"finish_reason":null}],"usage":null,"obfuscation":"Q"} + data: {"id":"chatcmpl-CLuUGBbbAiRQktwne0lQyVjm7kDMB","object":"chat.completion.chunk","created":1759338060,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":"}}]},"finish_reason":null}],"usage":null,"obfuscation":"KOF4PraPW2XBxJX"} - data: {"id":"chatcmpl-CLuAYEW78p5bIx4q4TNiSf8F8OVib","object":"chat.completion.chunk","created":1759336838,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"5"}}]},"finish_reason":null}],"usage":null,"obfuscation":"1"} + data: {"id":"chatcmpl-CLuUGBbbAiRQktwne0lQyVjm7kDMB","object":"chat.completion.chunk","created":1759338060,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" \".\","}}]},"finish_reason":null}],"usage":null,"obfuscation":"8ZzOOWkR2aC"} - data: {"id":"chatcmpl-CLuAYEW78p5bIx4q4TNiSf8F8OVib","object":"chat.completion.chunk","created":1759336838,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/m"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuUGBbbAiRQktwne0lQyVjm7kDMB","object":"chat.completion.chunk","created":1759338060,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" \""}}]},"finish_reason":null}],"usage":null,"obfuscation":"DvEUbTHsNgelmqm"} - data: {"id":"chatcmpl-CLuAYEW78p5bIx4q4TNiSf8F8OVib","object":"chat.completion.chunk","created":1759336838,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ult"}}]},"finish_reason":null}],"usage":null,"obfuscation":"rZrcl3QAsb4jaR9"} + data: {"id":"chatcmpl-CLuUGBbbAiRQktwne0lQyVjm7kDMB","object":"chat.completion.chunk","created":1759338060,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"depth"}}]},"finish_reason":null}],"usage":null,"obfuscation":"ANoZ0p3SO2WNC"} - data: {"id":"chatcmpl-CLuAYEW78p5bIx4q4TNiSf8F8OVib","object":"chat.completion.chunk","created":1759336838,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ied"}}]},"finish_reason":null}],"usage":null,"obfuscation":"f0bKzDXjapa80CU"} + data: {"id":"chatcmpl-CLuUGBbbAiRQktwne0lQyVjm7kDMB","object":"chat.completion.chunk","created":1759338060,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":"}}]},"finish_reason":null}],"usage":null,"obfuscation":"ZYi5aAZgd5Ng5Aw"} - data: {"id":"chatcmpl-CLuAYEW78p5bIx4q4TNiSf8F8OVib","object":"chat.completion.chunk","created":1759336838,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"it"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuUGBbbAiRQktwne0lQyVjm7kDMB","object":"chat.completion.chunk","created":1759338060,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" "}}]},"finish_reason":null}],"usage":null,"obfuscation":"f"} - data: {"id":"chatcmpl-CLuAYEW78p5bIx4q4TNiSf8F8OVib","object":"chat.completion.chunk","created":1759336838,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_tool"}}]},"finish_reason":null}],"usage":null,"obfuscation":"tES19Q05pRs9P"} + data: {"id":"chatcmpl-CLuUGBbbAiRQktwne0lQyVjm7kDMB","object":"chat.completion.chunk","created":1759338060,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"2"}}]},"finish_reason":null}],"usage":null,"obfuscation":"Z"} - data: {"id":"chatcmpl-CLuAYEW78p5bIx4q4TNiSf8F8OVib","object":"chat.completion.chunk","created":1759336838,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"}"}}]},"finish_reason":null}],"usage":null,"obfuscation":"7XLkvjYcSoXIEC9"} + data: {"id":"chatcmpl-CLuUGBbbAiRQktwne0lQyVjm7kDMB","object":"chat.completion.chunk","created":1759338060,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"}"}}]},"finish_reason":null}],"usage":null,"obfuscation":"b"} - data: {"id":"chatcmpl-CLuAYEW78p5bIx4q4TNiSf8F8OVib","object":"chat.completion.chunk","created":1759336838,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"tool_calls"}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuUGBbbAiRQktwne0lQyVjm7kDMB","object":"chat.completion.chunk","created":1759338060,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"tool_calls"}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLuAYEW78p5bIx4q4TNiSf8F8OVib","object":"chat.completion.chunk","created":1759336838,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6575,"completion_tokens":105,"total_tokens":6680,"prompt_tokens_details":{"cached_tokens":1024,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":64,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"FK"} + data: {"id":"chatcmpl-CLuUGBbbAiRQktwne0lQyVjm7kDMB","object":"chat.completion.chunk","created":1759338060,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6585,"completion_tokens":92,"total_tokens":6677,"prompt_tokens_details":{"cached_tokens":1024,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":64,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"pB7"} data: [DONE] @@ -136,15 +114,15 @@ interactions: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 4.37328975s + duration: 4.140014083s - id: 2 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 31019 + content_length: 31051 host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/multiedit_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use multiedit to change 'Hello, World!' to 'Hello, Crush!' and add a comment '// Greeting' above the fmt.Println line in main.go\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"call_LXjRshZtriL7BnthvT3NmyWp\",\"function\":{\"arguments\":\"{\\\"path\\\": \\\"/tmp/crush-test/TestCoderAgent/openai-gpt-5/multiedit_tool\\\"}\",\"name\":\"ls\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"- /tmp/crush-test/TestCoderAgent/openai-gpt-5/multiedit_tool/\\n - go.mod\\n - main.go\\n\",\"tool_call_id\":\"call_LXjRshZtriL7BnthvT3NmyWp\",\"role\":\"tool\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/multiedit_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use multiedit to change 'Hello, World!' to 'Hello, Crush!' and add a comment '// Greeting' above the fmt.Println line in main.go\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"call_WzOzZTdXsVNlFLcrAbqvJD5p\",\"function\":{\"arguments\":\"{\\\"path\\\": \\\".\\\", \\\"depth\\\": 2}\",\"name\":\"ls\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"\\n- /tmp/crush-test/TestCoderAgent/openai-gpt-5/multiedit_tool/\\n - go.mod\\n - main.go\\n\",\"tool_call_id\":\"call_WzOzZTdXsVNlFLcrAbqvJD5p\",\"role\":\"tool\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" headers: Accept: - application/json @@ -160,63 +138,63 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"chatcmpl-CLuAdVQKnkkCRb991kmDE8mvBMqdn","object":"chat.completion.chunk","created":1759336843,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"call_30kUKCjDfTy6N2vTsbmHmjbW","type":"function","function":{"name":"view","arguments":""}}],"refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"UR5gCuBNi50l"} + data: {"id":"chatcmpl-CLuUKIXxIxjZ81JaQc4p9XNOYWs9W","object":"chat.completion.chunk","created":1759338064,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"call_PAFSxqVUfBijqr6QYJq7TDGM","type":"function","function":{"name":"view","arguments":""}}],"refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"JXPg5jFppNcX"} - data: {"id":"chatcmpl-CLuAdVQKnkkCRb991kmDE8mvBMqdn","object":"chat.completion.chunk","created":1759336843,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"P6L8PPMPsHf7bcV"} + data: {"id":"chatcmpl-CLuUKIXxIxjZ81JaQc4p9XNOYWs9W","object":"chat.completion.chunk","created":1759338064,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"mJUpOJcS0ZFXksI"} - data: {"id":"chatcmpl-CLuAdVQKnkkCRb991kmDE8mvBMqdn","object":"chat.completion.chunk","created":1759336843,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"file"}}]},"finish_reason":null}],"usage":null,"obfuscation":"EGUyoenFsZRrfZ"} + data: {"id":"chatcmpl-CLuUKIXxIxjZ81JaQc4p9XNOYWs9W","object":"chat.completion.chunk","created":1759338064,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"file"}}]},"finish_reason":null}],"usage":null,"obfuscation":"enILDgsljvUKcR"} - data: {"id":"chatcmpl-CLuAdVQKnkkCRb991kmDE8mvBMqdn","object":"chat.completion.chunk","created":1759336843,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_path"}}]},"finish_reason":null}],"usage":null,"obfuscation":"NORE6DoiHAYjU"} + data: {"id":"chatcmpl-CLuUKIXxIxjZ81JaQc4p9XNOYWs9W","object":"chat.completion.chunk","created":1759338064,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_path"}}]},"finish_reason":null}],"usage":null,"obfuscation":"mPDtzyeizXN3q"} - data: {"id":"chatcmpl-CLuAdVQKnkkCRb991kmDE8mvBMqdn","object":"chat.completion.chunk","created":1759336843,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":"}}]},"finish_reason":null}],"usage":null,"obfuscation":"B4tYKmLwjnSGxXI"} + data: {"id":"chatcmpl-CLuUKIXxIxjZ81JaQc4p9XNOYWs9W","object":"chat.completion.chunk","created":1759338064,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":"}}]},"finish_reason":null}],"usage":null,"obfuscation":"FiOENrFjch6tsaN"} - data: {"id":"chatcmpl-CLuAdVQKnkkCRb991kmDE8mvBMqdn","object":"chat.completion.chunk","created":1759336843,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"/"}}]},"finish_reason":null}],"usage":null,"obfuscation":"D1K2AdHtWsv0KG0"} + data: {"id":"chatcmpl-CLuUKIXxIxjZ81JaQc4p9XNOYWs9W","object":"chat.completion.chunk","created":1759338064,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"/"}}]},"finish_reason":null}],"usage":null,"obfuscation":"xYXtXme5IAzQW7s"} - data: {"id":"chatcmpl-CLuAdVQKnkkCRb991kmDE8mvBMqdn","object":"chat.completion.chunk","created":1759336843,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"tmp"}}]},"finish_reason":null}],"usage":null,"obfuscation":"Kc5yXX3NcoNr8Ba"} + data: {"id":"chatcmpl-CLuUKIXxIxjZ81JaQc4p9XNOYWs9W","object":"chat.completion.chunk","created":1759338064,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"tmp"}}]},"finish_reason":null}],"usage":null,"obfuscation":"AEK9Kx6LIDSHqcb"} - data: {"id":"chatcmpl-CLuAdVQKnkkCRb991kmDE8mvBMqdn","object":"chat.completion.chunk","created":1759336843,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/cr"}}]},"finish_reason":null}],"usage":null,"obfuscation":"6NhbHHTyAZ1ZtNO"} + data: {"id":"chatcmpl-CLuUKIXxIxjZ81JaQc4p9XNOYWs9W","object":"chat.completion.chunk","created":1759338064,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/cr"}}]},"finish_reason":null}],"usage":null,"obfuscation":"0ns96wF24Evr0PM"} - data: {"id":"chatcmpl-CLuAdVQKnkkCRb991kmDE8mvBMqdn","object":"chat.completion.chunk","created":1759336843,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ush"}}]},"finish_reason":null}],"usage":null,"obfuscation":"yGXMOK7aHoRzDon"} + data: {"id":"chatcmpl-CLuUKIXxIxjZ81JaQc4p9XNOYWs9W","object":"chat.completion.chunk","created":1759338064,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ush"}}]},"finish_reason":null}],"usage":null,"obfuscation":"uYSSHBkwOL7pdcJ"} - data: {"id":"chatcmpl-CLuAdVQKnkkCRb991kmDE8mvBMqdn","object":"chat.completion.chunk","created":1759336843,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"-test"}}]},"finish_reason":null}],"usage":null,"obfuscation":"UPH4w2BOfuN6f"} + data: {"id":"chatcmpl-CLuUKIXxIxjZ81JaQc4p9XNOYWs9W","object":"chat.completion.chunk","created":1759338064,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"-test"}}]},"finish_reason":null}],"usage":null,"obfuscation":"SNIGqwDzrVtJo"} - data: {"id":"chatcmpl-CLuAdVQKnkkCRb991kmDE8mvBMqdn","object":"chat.completion.chunk","created":1759336843,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/Test"}}]},"finish_reason":null}],"usage":null,"obfuscation":"V6Or2aaEbIfcp"} + data: {"id":"chatcmpl-CLuUKIXxIxjZ81JaQc4p9XNOYWs9W","object":"chat.completion.chunk","created":1759338064,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/Test"}}]},"finish_reason":null}],"usage":null,"obfuscation":"UQwisj05o1IEO"} - data: {"id":"chatcmpl-CLuAdVQKnkkCRb991kmDE8mvBMqdn","object":"chat.completion.chunk","created":1759336843,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Coder"}}]},"finish_reason":null}],"usage":null,"obfuscation":"HvPnpdQ1iKt9n"} + data: {"id":"chatcmpl-CLuUKIXxIxjZ81JaQc4p9XNOYWs9W","object":"chat.completion.chunk","created":1759338064,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Coder"}}]},"finish_reason":null}],"usage":null,"obfuscation":"VbAEFeqs58RAC"} - data: {"id":"chatcmpl-CLuAdVQKnkkCRb991kmDE8mvBMqdn","object":"chat.completion.chunk","created":1759336843,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Agent"}}]},"finish_reason":null}],"usage":null,"obfuscation":"frC3TuQmjvGeF"} + data: {"id":"chatcmpl-CLuUKIXxIxjZ81JaQc4p9XNOYWs9W","object":"chat.completion.chunk","created":1759338064,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Agent"}}]},"finish_reason":null}],"usage":null,"obfuscation":"FEsIFdCP7ZciF"} - data: {"id":"chatcmpl-CLuAdVQKnkkCRb991kmDE8mvBMqdn","object":"chat.completion.chunk","created":1759336843,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/open"}}]},"finish_reason":null}],"usage":null,"obfuscation":"O8Vc2nR0PSvB1"} + data: {"id":"chatcmpl-CLuUKIXxIxjZ81JaQc4p9XNOYWs9W","object":"chat.completion.chunk","created":1759338064,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/open"}}]},"finish_reason":null}],"usage":null,"obfuscation":"CriZi8vQXeDQh"} - data: {"id":"chatcmpl-CLuAdVQKnkkCRb991kmDE8mvBMqdn","object":"chat.completion.chunk","created":1759336843,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ai"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuUKIXxIxjZ81JaQc4p9XNOYWs9W","object":"chat.completion.chunk","created":1759338064,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ai"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLuAdVQKnkkCRb991kmDE8mvBMqdn","object":"chat.completion.chunk","created":1759336843,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"-g"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuUKIXxIxjZ81JaQc4p9XNOYWs9W","object":"chat.completion.chunk","created":1759338064,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"-g"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLuAdVQKnkkCRb991kmDE8mvBMqdn","object":"chat.completion.chunk","created":1759336843,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"pt"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuUKIXxIxjZ81JaQc4p9XNOYWs9W","object":"chat.completion.chunk","created":1759338064,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"pt"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLuAdVQKnkkCRb991kmDE8mvBMqdn","object":"chat.completion.chunk","created":1759336843,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"-"}}]},"finish_reason":null}],"usage":null,"obfuscation":"Q"} + data: {"id":"chatcmpl-CLuUKIXxIxjZ81JaQc4p9XNOYWs9W","object":"chat.completion.chunk","created":1759338064,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"-"}}]},"finish_reason":null}],"usage":null,"obfuscation":"a"} - data: {"id":"chatcmpl-CLuAdVQKnkkCRb991kmDE8mvBMqdn","object":"chat.completion.chunk","created":1759336843,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"5"}}]},"finish_reason":null}],"usage":null,"obfuscation":"y"} + data: {"id":"chatcmpl-CLuUKIXxIxjZ81JaQc4p9XNOYWs9W","object":"chat.completion.chunk","created":1759338064,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"5"}}]},"finish_reason":null}],"usage":null,"obfuscation":"9"} - data: {"id":"chatcmpl-CLuAdVQKnkkCRb991kmDE8mvBMqdn","object":"chat.completion.chunk","created":1759336843,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/m"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuUKIXxIxjZ81JaQc4p9XNOYWs9W","object":"chat.completion.chunk","created":1759338064,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/m"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLuAdVQKnkkCRb991kmDE8mvBMqdn","object":"chat.completion.chunk","created":1759336843,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ult"}}]},"finish_reason":null}],"usage":null,"obfuscation":"sqchS20ASfs9p1f"} + data: {"id":"chatcmpl-CLuUKIXxIxjZ81JaQc4p9XNOYWs9W","object":"chat.completion.chunk","created":1759338064,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ult"}}]},"finish_reason":null}],"usage":null,"obfuscation":"xwRv7sFJtvW5jXM"} - data: {"id":"chatcmpl-CLuAdVQKnkkCRb991kmDE8mvBMqdn","object":"chat.completion.chunk","created":1759336843,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ied"}}]},"finish_reason":null}],"usage":null,"obfuscation":"gZ7wtZTLsKAac0D"} + data: {"id":"chatcmpl-CLuUKIXxIxjZ81JaQc4p9XNOYWs9W","object":"chat.completion.chunk","created":1759338064,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ied"}}]},"finish_reason":null}],"usage":null,"obfuscation":"OHKd89cUmFEnL9Y"} - data: {"id":"chatcmpl-CLuAdVQKnkkCRb991kmDE8mvBMqdn","object":"chat.completion.chunk","created":1759336843,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"it"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuUKIXxIxjZ81JaQc4p9XNOYWs9W","object":"chat.completion.chunk","created":1759338064,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"it"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLuAdVQKnkkCRb991kmDE8mvBMqdn","object":"chat.completion.chunk","created":1759336843,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_tool"}}]},"finish_reason":null}],"usage":null,"obfuscation":"Vg7cKG3ZndtZG"} + data: {"id":"chatcmpl-CLuUKIXxIxjZ81JaQc4p9XNOYWs9W","object":"chat.completion.chunk","created":1759338064,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_tool"}}]},"finish_reason":null}],"usage":null,"obfuscation":"T32DZVu5NAnga"} - data: {"id":"chatcmpl-CLuAdVQKnkkCRb991kmDE8mvBMqdn","object":"chat.completion.chunk","created":1759336843,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/main"}}]},"finish_reason":null}],"usage":null,"obfuscation":"iEH4RbXBuWtAZ"} + data: {"id":"chatcmpl-CLuUKIXxIxjZ81JaQc4p9XNOYWs9W","object":"chat.completion.chunk","created":1759338064,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/main"}}]},"finish_reason":null}],"usage":null,"obfuscation":"XMcZLJXLluvyd"} - data: {"id":"chatcmpl-CLuAdVQKnkkCRb991kmDE8mvBMqdn","object":"chat.completion.chunk","created":1759336843,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":".go"}}]},"finish_reason":null}],"usage":null,"obfuscation":"KTkQNmYTeSMiqPw"} + data: {"id":"chatcmpl-CLuUKIXxIxjZ81JaQc4p9XNOYWs9W","object":"chat.completion.chunk","created":1759338064,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":".go"}}]},"finish_reason":null}],"usage":null,"obfuscation":"S1YOcKcNmge34Ir"} - data: {"id":"chatcmpl-CLuAdVQKnkkCRb991kmDE8mvBMqdn","object":"chat.completion.chunk","created":1759336843,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"}"}}]},"finish_reason":null}],"usage":null,"obfuscation":"HpPcy8IKFZiLj8L"} + data: {"id":"chatcmpl-CLuUKIXxIxjZ81JaQc4p9XNOYWs9W","object":"chat.completion.chunk","created":1759338064,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"}"}}]},"finish_reason":null}],"usage":null,"obfuscation":"5hjuL1VMLiOByAd"} - data: {"id":"chatcmpl-CLuAdVQKnkkCRb991kmDE8mvBMqdn","object":"chat.completion.chunk","created":1759336843,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"tool_calls"}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuUKIXxIxjZ81JaQc4p9XNOYWs9W","object":"chat.completion.chunk","created":1759338064,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"tool_calls"}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLuAdVQKnkkCRb991kmDE8mvBMqdn","object":"chat.completion.chunk","created":1759336843,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6651,"completion_tokens":37,"total_tokens":6688,"prompt_tokens_details":{"cached_tokens":6528,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"3OOM"} + data: {"id":"chatcmpl-CLuUKIXxIxjZ81JaQc4p9XNOYWs9W","object":"chat.completion.chunk","created":1759338064,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6648,"completion_tokens":37,"total_tokens":6685,"prompt_tokens_details":{"cached_tokens":6528,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"DqmD"} data: [DONE] @@ -225,15 +203,15 @@ interactions: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 2.4644865s + duration: 1.108220208s - id: 3 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 31468 + content_length: 31500 host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/multiedit_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use multiedit to change 'Hello, World!' to 'Hello, Crush!' and add a comment '// Greeting' above the fmt.Println line in main.go\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"call_LXjRshZtriL7BnthvT3NmyWp\",\"function\":{\"arguments\":\"{\\\"path\\\": \\\"/tmp/crush-test/TestCoderAgent/openai-gpt-5/multiedit_tool\\\"}\",\"name\":\"ls\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"- /tmp/crush-test/TestCoderAgent/openai-gpt-5/multiedit_tool/\\n - go.mod\\n - main.go\\n\",\"tool_call_id\":\"call_LXjRshZtriL7BnthvT3NmyWp\",\"role\":\"tool\"},{\"tool_calls\":[{\"id\":\"call_30kUKCjDfTy6N2vTsbmHmjbW\",\"function\":{\"arguments\":\"{\\\"file_path\\\":\\\"/tmp/crush-test/TestCoderAgent/openai-gpt-5/multiedit_tool/main.go\\\"}\",\"name\":\"view\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"\\n 1|package main\\n 2|\\n 3|import \\\"fmt\\\"\\n 4|\\n 5|func main() {\\n 6|\\tfmt.Println(\\\"Hello, World!\\\")\\n 7|}\\n\\n\",\"tool_call_id\":\"call_30kUKCjDfTy6N2vTsbmHmjbW\",\"role\":\"tool\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/multiedit_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use multiedit to change 'Hello, World!' to 'Hello, Crush!' and add a comment '// Greeting' above the fmt.Println line in main.go\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"call_WzOzZTdXsVNlFLcrAbqvJD5p\",\"function\":{\"arguments\":\"{\\\"path\\\": \\\".\\\", \\\"depth\\\": 2}\",\"name\":\"ls\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"\\n- /tmp/crush-test/TestCoderAgent/openai-gpt-5/multiedit_tool/\\n - go.mod\\n - main.go\\n\",\"tool_call_id\":\"call_WzOzZTdXsVNlFLcrAbqvJD5p\",\"role\":\"tool\"},{\"tool_calls\":[{\"id\":\"call_PAFSxqVUfBijqr6QYJq7TDGM\",\"function\":{\"arguments\":\"{\\\"file_path\\\":\\\"/tmp/crush-test/TestCoderAgent/openai-gpt-5/multiedit_tool/main.go\\\"}\",\"name\":\"view\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"\\n 1|package main\\n 2|\\n 3|import \\\"fmt\\\"\\n 4|\\n 5|func main() {\\n 6|\\tfmt.Println(\\\"Hello, World!\\\")\\n 7|}\\n\\n\",\"tool_call_id\":\"call_PAFSxqVUfBijqr6QYJq7TDGM\",\"role\":\"tool\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" headers: Accept: - application/json @@ -249,305 +227,221 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"call_awhLqEHTROiJOU5bQcb5ZRki","type":"function","function":{"name":"multiedit","arguments":""}}],"refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"ftxIrQ5"} - - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"Z3dhAP2yAgtbCxr"} - - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"file"}}]},"finish_reason":null}],"usage":null,"obfuscation":"4KJn9Ng6p4X8k3"} - - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_path"}}]},"finish_reason":null}],"usage":null,"obfuscation":"VKn6J2oyf4o4u"} - - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":"}}]},"finish_reason":null}],"usage":null,"obfuscation":"KtzKjje0woFGhvH"} - - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"/"}}]},"finish_reason":null}],"usage":null,"obfuscation":"pSEnLd1FDbMySkc"} - - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"tmp"}}]},"finish_reason":null}],"usage":null,"obfuscation":"s4cBBI4DfwcbdrS"} - - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/cr"}}]},"finish_reason":null}],"usage":null,"obfuscation":"D8B5AFD8YiuV75e"} - - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ush"}}]},"finish_reason":null}],"usage":null,"obfuscation":"KJpNeVZxmQ0a9y7"} - - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"-test"}}]},"finish_reason":null}],"usage":null,"obfuscation":"tRiHr8XLuI3xy"} - - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/Test"}}]},"finish_reason":null}],"usage":null,"obfuscation":"Q0UGo5YJcqMqw"} - - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Coder"}}]},"finish_reason":null}],"usage":null,"obfuscation":"LDbp1GGBGlxYh"} - - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Agent"}}]},"finish_reason":null}],"usage":null,"obfuscation":"S1xmbCKhpHZNm"} - - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/open"}}]},"finish_reason":null}],"usage":null,"obfuscation":"KvA08HEtHp5He"} - - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ai"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"-g"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"pt"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"-"}}]},"finish_reason":null}],"usage":null,"obfuscation":"D"} - - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"5"}}]},"finish_reason":null}],"usage":null,"obfuscation":"G"} - - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/m"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ult"}}]},"finish_reason":null}],"usage":null,"obfuscation":"e5INBdiomiUXcKd"} - - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ied"}}]},"finish_reason":null}],"usage":null,"obfuscation":"Ra9nXf20lBUABTm"} - - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"it"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_tool"}}]},"finish_reason":null}],"usage":null,"obfuscation":"F6yAyPFu12e4i"} - - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/main"}}]},"finish_reason":null}],"usage":null,"obfuscation":"FevUarbsaajWP"} - - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":".go"}}]},"finish_reason":null}],"usage":null,"obfuscation":"6ANkiXT4jdvcPry"} - - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\",\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"YQoebBCjsI3Ph"} - - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ed"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"its"}}]},"finish_reason":null}],"usage":null,"obfuscation":"4np9pCHyp4JvT2O"} - - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":["}}]},"finish_reason":null}],"usage":null,"obfuscation":"3V51eUfeTjcfPq"} - - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"uNjwK9q833BfWUv"} - - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"old"}}]},"finish_reason":null}],"usage":null,"obfuscation":"EoZfsaGhe51yq3C"} - - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_string"}}]},"finish_reason":null}],"usage":null,"obfuscation":"iUnMZUskFXO"} - - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"1tkqTXzIHxxwK"} - - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"import"}}]},"finish_reason":null}],"usage":null,"obfuscation":"f0YgbwzggqfP"} - - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" \\\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"XPheX9TdgNoex"} - - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"fmt"}}]},"finish_reason":null}],"usage":null,"obfuscation":"cpFQcIIUoZk7x2X"} - - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\\\"\\"}}]},"finish_reason":null}],"usage":null,"obfuscation":"2X6OPmVhXv8B"} - - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"n"}}]},"finish_reason":null}],"usage":null,"obfuscation":"2"} - - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\\n"}}]},"finish_reason":null}],"usage":null,"obfuscation":"d0SV36givcAJWXD"} - - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"func"}}]},"finish_reason":null}],"usage":null,"obfuscation":"PvfISTihlK5kYh"} - - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" main"}}]},"finish_reason":null}],"usage":null,"obfuscation":"8YYhZbAEK7s5i"} - - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"()"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"call_bYFLMuoOng1XGhTjRth5N3Eg","type":"function","function":{"name":"multiedit","arguments":""}}],"refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"nuMC5fb"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" {\\"}}]},"finish_reason":null}],"usage":null,"obfuscation":"QO4oY5fHe9isCF"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"5C2IM2SXuvnkVKB"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"n"}}]},"finish_reason":null}],"usage":null,"obfuscation":"8"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"file"}}]},"finish_reason":null}],"usage":null,"obfuscation":"U2wgGS2O9Vrv2b"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\\t"}}]},"finish_reason":null}],"usage":null,"obfuscation":"BPL0gGF7RCQM6SN"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_path"}}]},"finish_reason":null}],"usage":null,"obfuscation":"w3EWoupWLvE6d"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"fmt"}}]},"finish_reason":null}],"usage":null,"obfuscation":"t2qRHuaf4ya46Cm"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":"}}]},"finish_reason":null}],"usage":null,"obfuscation":"Q4dpjNORw0pxz9e"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":".Println"}}]},"finish_reason":null}],"usage":null,"obfuscation":"VoaAV8joTn"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"/"}}]},"finish_reason":null}],"usage":null,"obfuscation":"hxMkwRMHhUEQOuE"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"(\\\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"gMqCIh5M5zn1A"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"tmp"}}]},"finish_reason":null}],"usage":null,"obfuscation":"MUR4ExDuaCGjBny"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Hello"}}]},"finish_reason":null}],"usage":null,"obfuscation":"wUdGgFhtH4bx9"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/cr"}}]},"finish_reason":null}],"usage":null,"obfuscation":"v2L6gLrJ8KYw0Vr"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":","}}]},"finish_reason":null}],"usage":null,"obfuscation":"6"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ush"}}]},"finish_reason":null}],"usage":null,"obfuscation":"Aqbd85WyFaewBVB"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" World"}}]},"finish_reason":null}],"usage":null,"obfuscation":"yq7uwQJfJYdc"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"-test"}}]},"finish_reason":null}],"usage":null,"obfuscation":"nNCm0eM49mNTP"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"!\\"}}]},"finish_reason":null}],"usage":null,"obfuscation":"SOs4NTHVUwXR9fp"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/Test"}}]},"finish_reason":null}],"usage":null,"obfuscation":"fIdGE69m4QTtW"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\")"}}]},"finish_reason":null}],"usage":null,"obfuscation":"DfMMtyroGPtelhj"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Coder"}}]},"finish_reason":null}],"usage":null,"obfuscation":"rUaAbRfzEK8AZ"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\\"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Agent"}}]},"finish_reason":null}],"usage":null,"obfuscation":"mr4z1LfZxuCPu"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"n"}}]},"finish_reason":null}],"usage":null,"obfuscation":"S"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/open"}}]},"finish_reason":null}],"usage":null,"obfuscation":"hm4E04qzbY6Fm"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"}\\"}}]},"finish_reason":null}],"usage":null,"obfuscation":"6LQXOBpJHawDlAA"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ai"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"n"}}]},"finish_reason":null}],"usage":null,"obfuscation":"7"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"-g"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\",\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"1CuGs3ZZIFqkW"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"pt"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"new"}}]},"finish_reason":null}],"usage":null,"obfuscation":"bpzAhSrWOwuUJRS"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"-"}}]},"finish_reason":null}],"usage":null,"obfuscation":"3"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_string"}}]},"finish_reason":null}],"usage":null,"obfuscation":"Ait9PFmm3QX"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"5"}}]},"finish_reason":null}],"usage":null,"obfuscation":"2"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"GGjfoZpQnkz4a"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/m"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"import"}}]},"finish_reason":null}],"usage":null,"obfuscation":"wt6KzeMeaTuj"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ult"}}]},"finish_reason":null}],"usage":null,"obfuscation":"vKCS6qR9IMlaRBa"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" \\\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"vzLGqS8OoVkxw"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ied"}}]},"finish_reason":null}],"usage":null,"obfuscation":"KU7f7C480VX9xmU"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"fmt"}}]},"finish_reason":null}],"usage":null,"obfuscation":"hgIuEnwBwFQxuWy"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"it"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\\\"\\"}}]},"finish_reason":null}],"usage":null,"obfuscation":"iW6CbCz3mnQH"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_tool"}}]},"finish_reason":null}],"usage":null,"obfuscation":"F4epadQLbZ06y"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"n"}}]},"finish_reason":null}],"usage":null,"obfuscation":"2"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/main"}}]},"finish_reason":null}],"usage":null,"obfuscation":"Tq5kKLpzqRItd"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\\n"}}]},"finish_reason":null}],"usage":null,"obfuscation":"AxoMSVzePRe7RdI"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":".go"}}]},"finish_reason":null}],"usage":null,"obfuscation":"vi8HqggwmNRGh6M"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"func"}}]},"finish_reason":null}],"usage":null,"obfuscation":"jMTy0mQJMPb8Zd"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\",\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"ZcLKrndV2pYrq"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" main"}}]},"finish_reason":null}],"usage":null,"obfuscation":"X37o3m3BIcFY3"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ed"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"()"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"its"}}]},"finish_reason":null}],"usage":null,"obfuscation":"pGuosofcvJvIvYo"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" {\\"}}]},"finish_reason":null}],"usage":null,"obfuscation":"vJkUwlGwzvrxF0"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":["}}]},"finish_reason":null}],"usage":null,"obfuscation":"VZy04H319jGqQh"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"n"}}]},"finish_reason":null}],"usage":null,"obfuscation":"6"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"NS2DztnUkUIT0dk"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\\t"}}]},"finish_reason":null}],"usage":null,"obfuscation":"DQmEeBndjcxGX6w"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"old"}}]},"finish_reason":null}],"usage":null,"obfuscation":"1y2HJrGDT3hITh3"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"fmt"}}]},"finish_reason":null}],"usage":null,"obfuscation":"gTzdGswrSIiXd4a"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_string"}}]},"finish_reason":null}],"usage":null,"obfuscation":"i1D5bXEmJyk"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":".Println"}}]},"finish_reason":null}],"usage":null,"obfuscation":"pfeDn4kDFo"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"TFmxIEskjAZPp"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"(\\\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"BQAD0ngR3xKFr"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"func"}}]},"finish_reason":null}],"usage":null,"obfuscation":"5b8CYRxeXYcg01"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Hello"}}]},"finish_reason":null}],"usage":null,"obfuscation":"7amE8CqRUiEUj"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" main"}}]},"finish_reason":null}],"usage":null,"obfuscation":"T4gfKVXXjgVlF"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":","}}]},"finish_reason":null}],"usage":null,"obfuscation":"Z"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"()"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" Crush"}}]},"finish_reason":null}],"usage":null,"obfuscation":"gAtixJpjuHrs"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" {\\"}}]},"finish_reason":null}],"usage":null,"obfuscation":"Qq1yVOEMj6mrfu"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"!\\"}}]},"finish_reason":null}],"usage":null,"obfuscation":"GNmW8BYCQd3GcMu"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"n"}}]},"finish_reason":null}],"usage":null,"obfuscation":"C"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\")"}}]},"finish_reason":null}],"usage":null,"obfuscation":"Jh3wpiIbuWZOlxQ"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\\t"}}]},"finish_reason":null}],"usage":null,"obfuscation":"7sxOhzF0NuBCYsb"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\\"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"fmt"}}]},"finish_reason":null}],"usage":null,"obfuscation":"z8AwJWEKT8O4OAU"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"n"}}]},"finish_reason":null}],"usage":null,"obfuscation":"P"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":".Println"}}]},"finish_reason":null}],"usage":null,"obfuscation":"R3soGxHnXY"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"}\\"}}]},"finish_reason":null}],"usage":null,"obfuscation":"U3V9CvTb7oxqDzu"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"(\\\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"ID1mtvdNuzjAR"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"n"}}]},"finish_reason":null}],"usage":null,"obfuscation":"E"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Hello"}}]},"finish_reason":null}],"usage":null,"obfuscation":"yhFRGvKEZLqRx"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"},{\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"CoewsObPcTU"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":","}}]},"finish_reason":null}],"usage":null,"obfuscation":"X"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"old"}}]},"finish_reason":null}],"usage":null,"obfuscation":"hHZDJwnPsz6qWBq"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" World"}}]},"finish_reason":null}],"usage":null,"obfuscation":"QLVXB8CMU9Om"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_string"}}]},"finish_reason":null}],"usage":null,"obfuscation":"uG77AprrtON"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"!\\"}}]},"finish_reason":null}],"usage":null,"obfuscation":"F3rvDiMliVfw8yN"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"0gj1L5NMY1Nq3"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\")"}}]},"finish_reason":null}],"usage":null,"obfuscation":"zqtz2OZPJjOEXh9"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"import"}}]},"finish_reason":null}],"usage":null,"obfuscation":"avD9PJmwce8k"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\\"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" \\\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"8H0omWEJyHpEh"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"n"}}]},"finish_reason":null}],"usage":null,"obfuscation":"B"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"fmt"}}]},"finish_reason":null}],"usage":null,"obfuscation":"0xqQ5X7MyIxPIxD"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"}"}}]},"finish_reason":null}],"usage":null,"obfuscation":"q"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\\\"\\"}}]},"finish_reason":null}],"usage":null,"obfuscation":"2xYapUNDfYgA"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\",\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"6GWyNktsUBQYE"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"n"}}]},"finish_reason":null}],"usage":null,"obfuscation":"G"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"new"}}]},"finish_reason":null}],"usage":null,"obfuscation":"Ro1GS9l2Y1XO1aJ"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\\n"}}]},"finish_reason":null}],"usage":null,"obfuscation":"xfDYN3Y4MmnpflW"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_string"}}]},"finish_reason":null}],"usage":null,"obfuscation":"r1O2SFzH0kU"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"func"}}]},"finish_reason":null}],"usage":null,"obfuscation":"JnmKGmddjrsQIf"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"Y07SfCQS0c5zH"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" main"}}]},"finish_reason":null}],"usage":null,"obfuscation":"JBSxLYJEXFKTO"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"func"}}]},"finish_reason":null}],"usage":null,"obfuscation":"Se98BRwJjdTYve"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"()"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" main"}}]},"finish_reason":null}],"usage":null,"obfuscation":"ajPQSYg0qbBFu"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" {\\"}}]},"finish_reason":null}],"usage":null,"obfuscation":"WEcyZdIzXjYhV4"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"()"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"n"}}]},"finish_reason":null}],"usage":null,"obfuscation":"m"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" {\\"}}]},"finish_reason":null}],"usage":null,"obfuscation":"3cBY2GuFvMU0Ed"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\\t"}}]},"finish_reason":null}],"usage":null,"obfuscation":"TgIbdYdI9wqz6ZR"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"n"}}]},"finish_reason":null}],"usage":null,"obfuscation":"E"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"fmt"}}]},"finish_reason":null}],"usage":null,"obfuscation":"yC2OB4aRtNQHXUe"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\\t"}}]},"finish_reason":null}],"usage":null,"obfuscation":"brg3sL6NfNSl8wm"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":".Println"}}]},"finish_reason":null}],"usage":null,"obfuscation":"UbQwzL7PE4"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"//"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"(\\\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"oYrbTTGYU7Pll"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" Greeting"}}]},"finish_reason":null}],"usage":null,"obfuscation":"Dk1UtjbVo"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Hello"}}]},"finish_reason":null}],"usage":null,"obfuscation":"PCIVy9MDJyniM"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\\n"}}]},"finish_reason":null}],"usage":null,"obfuscation":"zkfR5ALLCfOjqfs"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":","}}]},"finish_reason":null}],"usage":null,"obfuscation":"a"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\\t"}}]},"finish_reason":null}],"usage":null,"obfuscation":"lqqNjGhauMjykgI"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" Crush"}}]},"finish_reason":null}],"usage":null,"obfuscation":"aEabHWes5aM1"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"fmt"}}]},"finish_reason":null}],"usage":null,"obfuscation":"OJCmlsPRyhiGe8D"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"!\\"}}]},"finish_reason":null}],"usage":null,"obfuscation":"VsIVOYrugE9USzH"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":".Println"}}]},"finish_reason":null}],"usage":null,"obfuscation":"D0eb2C39L2"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\")"}}]},"finish_reason":null}],"usage":null,"obfuscation":"L1MzotyjNZdg23n"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"(\\\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"Ev6RblUF6Y9xT"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\\"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Hello"}}]},"finish_reason":null}],"usage":null,"obfuscation":"RDoOgQSTQxbL0"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"n"}}]},"finish_reason":null}],"usage":null,"obfuscation":"x"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":","}}]},"finish_reason":null}],"usage":null,"obfuscation":"d"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"}\\"}}]},"finish_reason":null}],"usage":null,"obfuscation":"jgohVKT6cYVQ4Di"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" World"}}]},"finish_reason":null}],"usage":null,"obfuscation":"fb1LkyYbSp4d"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"n"}}]},"finish_reason":null}],"usage":null,"obfuscation":"b"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"!\\"}}]},"finish_reason":null}],"usage":null,"obfuscation":"PT2qdzlGlFlzGJn"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\",\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"tARhfFMWMy1De"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\")"}}]},"finish_reason":null}],"usage":null,"obfuscation":"pSR23RhtGrmWyJI"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"new"}}]},"finish_reason":null}],"usage":null,"obfuscation":"QhTytZ40FXJm8oe"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\\"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_string"}}]},"finish_reason":null}],"usage":null,"obfuscation":"qoYRsdbIUqT"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"n"}}]},"finish_reason":null}],"usage":null,"obfuscation":"h"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"CfRTM9zrGz384"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"}\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"3vUn72Eb4rt6xtg"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"import"}}]},"finish_reason":null}],"usage":null,"obfuscation":"zZMZX46v9UPF"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"},{\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"9LRSLIl48EL8g"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" \\\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"yaHtQRkHkayFF"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"old"}}]},"finish_reason":null}],"usage":null,"obfuscation":"avjED1nemkqn1xK"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"fmt"}}]},"finish_reason":null}],"usage":null,"obfuscation":"604fOKUV2a2amb6"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_string"}}]},"finish_reason":null}],"usage":null,"obfuscation":"OnQwwjnDxMz"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\\\"\\"}}]},"finish_reason":null}],"usage":null,"obfuscation":"RZz7VgojF6YU"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"1uU56WrH1ubx8"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"n"}}]},"finish_reason":null}],"usage":null,"obfuscation":"D"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\\"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\\n"}}]},"finish_reason":null}],"usage":null,"obfuscation":"R6UCJHWREyWumor"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"tf"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"func"}}]},"finish_reason":null}],"usage":null,"obfuscation":"FaOPzsCoqmOWQL"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"mt"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" main"}}]},"finish_reason":null}],"usage":null,"obfuscation":"BisYpT88B7GML"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":".Println"}}]},"finish_reason":null}],"usage":null,"obfuscation":"vh3StexydB"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"()"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"(\\\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"QCVFjALH33OMO"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" {\\"}}]},"finish_reason":null}],"usage":null,"obfuscation":"yXgDbtOdRfSaEv"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Hello"}}]},"finish_reason":null}],"usage":null,"obfuscation":"gFHze9dZc8Iam"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"n"}}]},"finish_reason":null}],"usage":null,"obfuscation":"6"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":","}}]},"finish_reason":null}],"usage":null,"obfuscation":"o"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\\t"}}]},"finish_reason":null}],"usage":null,"obfuscation":"GRhARzwMFzqD60a"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" World"}}]},"finish_reason":null}],"usage":null,"obfuscation":"Z0Vc2ThaDBCC"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"//"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"!\\"}}]},"finish_reason":null}],"usage":null,"obfuscation":"eOaEs024fALldrc"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" Greeting"}}]},"finish_reason":null}],"usage":null,"obfuscation":"IDV3LFylL"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\")"}}]},"finish_reason":null}],"usage":null,"obfuscation":"xiFZphMb91Oyt8r"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\\n"}}]},"finish_reason":null}],"usage":null,"obfuscation":"CSv2X3cPZ6QLxY5"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\",\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"7UiUYnMNRJ6jR"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\\t"}}]},"finish_reason":null}],"usage":null,"obfuscation":"r4dNyaJnsOMg1PR"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"new"}}]},"finish_reason":null}],"usage":null,"obfuscation":"CBf9k6lhIJytUti"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"fmt"}}]},"finish_reason":null}],"usage":null,"obfuscation":"p48wmF1UVl8kTZC"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_string"}}]},"finish_reason":null}],"usage":null,"obfuscation":"PUmqFNBmZiT"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":".Println"}}]},"finish_reason":null}],"usage":null,"obfuscation":"iXH8NWqGjn"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"EcwXon99XgbDa"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"(\\\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"54vKUhp97JPVG"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\\"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Hello"}}]},"finish_reason":null}],"usage":null,"obfuscation":"NSRqe7OE0qzmP"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"tf"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":","}}]},"finish_reason":null}],"usage":null,"obfuscation":"P"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"mt"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" Crush"}}]},"finish_reason":null}],"usage":null,"obfuscation":"JcAsesZVh07t"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":".Println"}}]},"finish_reason":null}],"usage":null,"obfuscation":"DZgnrf1J2x"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"!\\"}}]},"finish_reason":null}],"usage":null,"obfuscation":"xPC6qCokM1AiYMF"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"(\\\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"SNUnRDPKqVPVk"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\")"}}]},"finish_reason":null}],"usage":null,"obfuscation":"wRxioFYS7CYgfEj"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Hello"}}]},"finish_reason":null}],"usage":null,"obfuscation":"E8e9Ns5e8HoYG"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\\"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":","}}]},"finish_reason":null}],"usage":null,"obfuscation":"J"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"n"}}]},"finish_reason":null}],"usage":null,"obfuscation":"n"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" Crush"}}]},"finish_reason":null}],"usage":null,"obfuscation":"OPJQuZ0TJNak"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"}\\"}}]},"finish_reason":null}],"usage":null,"obfuscation":"jbmRira0nkpwHBt"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"!\\"}}]},"finish_reason":null}],"usage":null,"obfuscation":"qxeqBkXz9BI2wbL"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"n"}}]},"finish_reason":null}],"usage":null,"obfuscation":"R"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\")"}}]},"finish_reason":null}],"usage":null,"obfuscation":"yubaWm58P4wVyyn"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"}"}}]},"finish_reason":null}],"usage":null,"obfuscation":"04xpDl36JCyunPV"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"}"}}]},"finish_reason":null}],"usage":null,"obfuscation":"oTNXp1J9ue4ay2k"} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"]}"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"]}"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"tool_calls"}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"tool_calls"}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLuAfozJbrjjZQfJqIlEOqgcIzLap","object":"chat.completion.chunk","created":1759336845,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6750,"completion_tokens":1702,"total_tokens":8452,"prompt_tokens_details":{"cached_tokens":6656,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":1536,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"M93xmB2oQCk6sjn"} + data: {"id":"chatcmpl-CLuULg4m7oHIa1xuCM7Z0k2LNhZwa","object":"chat.completion.chunk","created":1759338065,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6747,"completion_tokens":1596,"total_tokens":8343,"prompt_tokens_details":{"cached_tokens":6656,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":1472,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"WlTmABwjnEzhF8c"} data: [DONE] @@ -556,15 +450,15 @@ interactions: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 22.450846834s + duration: 20.22390925s - id: 4 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 32333 + content_length: 32217 host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/multiedit_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use multiedit to change 'Hello, World!' to 'Hello, Crush!' and add a comment '// Greeting' above the fmt.Println line in main.go\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"call_LXjRshZtriL7BnthvT3NmyWp\",\"function\":{\"arguments\":\"{\\\"path\\\": \\\"/tmp/crush-test/TestCoderAgent/openai-gpt-5/multiedit_tool\\\"}\",\"name\":\"ls\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"- /tmp/crush-test/TestCoderAgent/openai-gpt-5/multiedit_tool/\\n - go.mod\\n - main.go\\n\",\"tool_call_id\":\"call_LXjRshZtriL7BnthvT3NmyWp\",\"role\":\"tool\"},{\"tool_calls\":[{\"id\":\"call_30kUKCjDfTy6N2vTsbmHmjbW\",\"function\":{\"arguments\":\"{\\\"file_path\\\":\\\"/tmp/crush-test/TestCoderAgent/openai-gpt-5/multiedit_tool/main.go\\\"}\",\"name\":\"view\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"\\n 1|package main\\n 2|\\n 3|import \\\"fmt\\\"\\n 4|\\n 5|func main() {\\n 6|\\tfmt.Println(\\\"Hello, World!\\\")\\n 7|}\\n\\n\",\"tool_call_id\":\"call_30kUKCjDfTy6N2vTsbmHmjbW\",\"role\":\"tool\"},{\"tool_calls\":[{\"id\":\"call_awhLqEHTROiJOU5bQcb5ZRki\",\"function\":{\"arguments\":\"{\\\"file_path\\\":\\\"/tmp/crush-test/TestCoderAgent/openai-gpt-5/multiedit_tool/main.go\\\",\\\"edits\\\":[{\\\"old_string\\\":\\\"import \\\\\\\"fmt\\\\\\\"\\\\n\\\\nfunc main() {\\\\n\\\\tfmt.Println(\\\\\\\"Hello, World!\\\\\\\")\\\\n}\\\\n\\\",\\\"new_string\\\":\\\"import \\\\\\\"fmt\\\\\\\"\\\\n\\\\nfunc main() {\\\\n\\\\tfmt.Println(\\\\\\\"Hello, Crush!\\\\\\\")\\\\n}\\\\n\\\"},{\\\"old_string\\\":\\\"import \\\\\\\"fmt\\\\\\\"\\\\n\\\\nfunc main() {\\\\n\\\\tfmt.Println(\\\\\\\"Hello, Crush!\\\\\\\")\\\\n}\\\\n\\\",\\\"new_string\\\":\\\"import \\\\\\\"fmt\\\\\\\"\\\\n\\\\nfunc main() {\\\\n\\\\t// Greeting\\\\n\\\\tfmt.Println(\\\\\\\"Hello, Crush!\\\\\\\")\\\\n}\\\\n\\\"}]}\",\"name\":\"multiedit\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"\\nApplied 2 edits to file: /tmp/crush-test/TestCoderAgent/openai-gpt-5/multiedit_tool/main.go\\n\\n\",\"tool_call_id\":\"call_awhLqEHTROiJOU5bQcb5ZRki\",\"role\":\"tool\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/multiedit_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use multiedit to change 'Hello, World!' to 'Hello, Crush!' and add a comment '// Greeting' above the fmt.Println line in main.go\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"call_WzOzZTdXsVNlFLcrAbqvJD5p\",\"function\":{\"arguments\":\"{\\\"path\\\": \\\".\\\", \\\"depth\\\": 2}\",\"name\":\"ls\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"\\n- /tmp/crush-test/TestCoderAgent/openai-gpt-5/multiedit_tool/\\n - go.mod\\n - main.go\\n\",\"tool_call_id\":\"call_WzOzZTdXsVNlFLcrAbqvJD5p\",\"role\":\"tool\"},{\"tool_calls\":[{\"id\":\"call_PAFSxqVUfBijqr6QYJq7TDGM\",\"function\":{\"arguments\":\"{\\\"file_path\\\":\\\"/tmp/crush-test/TestCoderAgent/openai-gpt-5/multiedit_tool/main.go\\\"}\",\"name\":\"view\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"\\n 1|package main\\n 2|\\n 3|import \\\"fmt\\\"\\n 4|\\n 5|func main() {\\n 6|\\tfmt.Println(\\\"Hello, World!\\\")\\n 7|}\\n\\n\",\"tool_call_id\":\"call_PAFSxqVUfBijqr6QYJq7TDGM\",\"role\":\"tool\"},{\"tool_calls\":[{\"id\":\"call_bYFLMuoOng1XGhTjRth5N3Eg\",\"function\":{\"arguments\":\"{\\\"file_path\\\":\\\"/tmp/crush-test/TestCoderAgent/openai-gpt-5/multiedit_tool/main.go\\\",\\\"edits\\\":[{\\\"old_string\\\":\\\"func main() {\\\\n\\\\tfmt.Println(\\\\\\\"Hello, World!\\\\\\\")\\\\n}\\\",\\\"new_string\\\":\\\"func main() {\\\\n\\\\t// Greeting\\\\n\\\\tfmt.Println(\\\\\\\"Hello, World!\\\\\\\")\\\\n}\\\"},{\\\"old_string\\\":\\\"\\\\tfmt.Println(\\\\\\\"Hello, World!\\\\\\\")\\\",\\\"new_string\\\":\\\"\\\\tfmt.Println(\\\\\\\"Hello, Crush!\\\\\\\")\\\"}]}\",\"name\":\"multiedit\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"\\nApplied 2 edits to file: /tmp/crush-test/TestCoderAgent/openai-gpt-5/multiedit_tool/main.go\\n\\n\",\"tool_call_id\":\"call_bYFLMuoOng1XGhTjRth5N3Eg\",\"role\":\"tool\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" headers: Accept: - application/json @@ -580,63 +474,63 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"chatcmpl-CLuB2RvAu1QXnXXnimJvP40espNqB","object":"chat.completion.chunk","created":1759336868,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"call_SFYB6XxM74xRfJEdIuVuPJ9h","type":"function","function":{"name":"view","arguments":""}}],"refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"CSU1F7GhHJ6O"} + data: {"id":"chatcmpl-CLuUgmQJ8BBUVIAbAe2ji1XEFANmJ","object":"chat.completion.chunk","created":1759338086,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"call_4mkP5YReOKqHp1zxERdIWlQw","type":"function","function":{"name":"view","arguments":""}}],"refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"TgLWD76ikHcs"} - data: {"id":"chatcmpl-CLuB2RvAu1QXnXXnimJvP40espNqB","object":"chat.completion.chunk","created":1759336868,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"mevEtjPuYrqxZIs"} + data: {"id":"chatcmpl-CLuUgmQJ8BBUVIAbAe2ji1XEFANmJ","object":"chat.completion.chunk","created":1759338086,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"y3rccU3ew37GwHv"} - data: {"id":"chatcmpl-CLuB2RvAu1QXnXXnimJvP40espNqB","object":"chat.completion.chunk","created":1759336868,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"file"}}]},"finish_reason":null}],"usage":null,"obfuscation":"K5PbAIboDqqub7"} + data: {"id":"chatcmpl-CLuUgmQJ8BBUVIAbAe2ji1XEFANmJ","object":"chat.completion.chunk","created":1759338086,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"file"}}]},"finish_reason":null}],"usage":null,"obfuscation":"KYj3jtmZTc5wpS"} - data: {"id":"chatcmpl-CLuB2RvAu1QXnXXnimJvP40espNqB","object":"chat.completion.chunk","created":1759336868,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_path"}}]},"finish_reason":null}],"usage":null,"obfuscation":"1LgPCKWAigQXz"} + data: {"id":"chatcmpl-CLuUgmQJ8BBUVIAbAe2ji1XEFANmJ","object":"chat.completion.chunk","created":1759338086,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_path"}}]},"finish_reason":null}],"usage":null,"obfuscation":"ehraZ1HszcIfd"} - data: {"id":"chatcmpl-CLuB2RvAu1QXnXXnimJvP40espNqB","object":"chat.completion.chunk","created":1759336868,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":"}}]},"finish_reason":null}],"usage":null,"obfuscation":"n9UYPQZUNLE48TZ"} + data: {"id":"chatcmpl-CLuUgmQJ8BBUVIAbAe2ji1XEFANmJ","object":"chat.completion.chunk","created":1759338086,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":"}}]},"finish_reason":null}],"usage":null,"obfuscation":"xNnYUt0v40huIEW"} - data: {"id":"chatcmpl-CLuB2RvAu1QXnXXnimJvP40espNqB","object":"chat.completion.chunk","created":1759336868,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"/"}}]},"finish_reason":null}],"usage":null,"obfuscation":"UNg7e79Ua9h4kg4"} + data: {"id":"chatcmpl-CLuUgmQJ8BBUVIAbAe2ji1XEFANmJ","object":"chat.completion.chunk","created":1759338086,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"/"}}]},"finish_reason":null}],"usage":null,"obfuscation":"79vfh8yuRmTb0X5"} - data: {"id":"chatcmpl-CLuB2RvAu1QXnXXnimJvP40espNqB","object":"chat.completion.chunk","created":1759336868,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"tmp"}}]},"finish_reason":null}],"usage":null,"obfuscation":"8DN4VyZBxWHtPZc"} + data: {"id":"chatcmpl-CLuUgmQJ8BBUVIAbAe2ji1XEFANmJ","object":"chat.completion.chunk","created":1759338086,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"tmp"}}]},"finish_reason":null}],"usage":null,"obfuscation":"qEh6CjULlAQd2XP"} - data: {"id":"chatcmpl-CLuB2RvAu1QXnXXnimJvP40espNqB","object":"chat.completion.chunk","created":1759336868,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/cr"}}]},"finish_reason":null}],"usage":null,"obfuscation":"YS7rHtB9O8vI0D5"} + data: {"id":"chatcmpl-CLuUgmQJ8BBUVIAbAe2ji1XEFANmJ","object":"chat.completion.chunk","created":1759338086,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/cr"}}]},"finish_reason":null}],"usage":null,"obfuscation":"pC0mhul7LAtmyxM"} - data: {"id":"chatcmpl-CLuB2RvAu1QXnXXnimJvP40espNqB","object":"chat.completion.chunk","created":1759336868,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ush"}}]},"finish_reason":null}],"usage":null,"obfuscation":"q9CiBWixGdB0nss"} + data: {"id":"chatcmpl-CLuUgmQJ8BBUVIAbAe2ji1XEFANmJ","object":"chat.completion.chunk","created":1759338086,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ush"}}]},"finish_reason":null}],"usage":null,"obfuscation":"SGpPEJ9AMSysK1C"} - data: {"id":"chatcmpl-CLuB2RvAu1QXnXXnimJvP40espNqB","object":"chat.completion.chunk","created":1759336868,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"-test"}}]},"finish_reason":null}],"usage":null,"obfuscation":"CYHe95g8EhThc"} + data: {"id":"chatcmpl-CLuUgmQJ8BBUVIAbAe2ji1XEFANmJ","object":"chat.completion.chunk","created":1759338086,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"-test"}}]},"finish_reason":null}],"usage":null,"obfuscation":"uIYiPsjyxMVQE"} - data: {"id":"chatcmpl-CLuB2RvAu1QXnXXnimJvP40espNqB","object":"chat.completion.chunk","created":1759336868,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/Test"}}]},"finish_reason":null}],"usage":null,"obfuscation":"4CP6vPnXuRUsc"} + data: {"id":"chatcmpl-CLuUgmQJ8BBUVIAbAe2ji1XEFANmJ","object":"chat.completion.chunk","created":1759338086,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/Test"}}]},"finish_reason":null}],"usage":null,"obfuscation":"o3Y9ByT0tXs13"} - data: {"id":"chatcmpl-CLuB2RvAu1QXnXXnimJvP40espNqB","object":"chat.completion.chunk","created":1759336868,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Coder"}}]},"finish_reason":null}],"usage":null,"obfuscation":"myaHwdOQk3V5r"} + data: {"id":"chatcmpl-CLuUgmQJ8BBUVIAbAe2ji1XEFANmJ","object":"chat.completion.chunk","created":1759338086,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Coder"}}]},"finish_reason":null}],"usage":null,"obfuscation":"kYCT04QMKl955"} - data: {"id":"chatcmpl-CLuB2RvAu1QXnXXnimJvP40espNqB","object":"chat.completion.chunk","created":1759336868,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Agent"}}]},"finish_reason":null}],"usage":null,"obfuscation":"nP3cOJ6VHXCrS"} + data: {"id":"chatcmpl-CLuUgmQJ8BBUVIAbAe2ji1XEFANmJ","object":"chat.completion.chunk","created":1759338086,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Agent"}}]},"finish_reason":null}],"usage":null,"obfuscation":"7aTeQCMZWjrUg"} - data: {"id":"chatcmpl-CLuB2RvAu1QXnXXnimJvP40espNqB","object":"chat.completion.chunk","created":1759336868,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/open"}}]},"finish_reason":null}],"usage":null,"obfuscation":"taSZWCPLdDNxS"} + data: {"id":"chatcmpl-CLuUgmQJ8BBUVIAbAe2ji1XEFANmJ","object":"chat.completion.chunk","created":1759338086,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/open"}}]},"finish_reason":null}],"usage":null,"obfuscation":"F4Hb5Fo1OGhWX"} - data: {"id":"chatcmpl-CLuB2RvAu1QXnXXnimJvP40espNqB","object":"chat.completion.chunk","created":1759336868,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ai"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuUgmQJ8BBUVIAbAe2ji1XEFANmJ","object":"chat.completion.chunk","created":1759338086,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ai"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLuB2RvAu1QXnXXnimJvP40espNqB","object":"chat.completion.chunk","created":1759336868,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"-g"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuUgmQJ8BBUVIAbAe2ji1XEFANmJ","object":"chat.completion.chunk","created":1759338086,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"-g"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLuB2RvAu1QXnXXnimJvP40espNqB","object":"chat.completion.chunk","created":1759336868,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"pt"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuUgmQJ8BBUVIAbAe2ji1XEFANmJ","object":"chat.completion.chunk","created":1759338086,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"pt"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLuB2RvAu1QXnXXnimJvP40espNqB","object":"chat.completion.chunk","created":1759336868,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"-"}}]},"finish_reason":null}],"usage":null,"obfuscation":"I"} + data: {"id":"chatcmpl-CLuUgmQJ8BBUVIAbAe2ji1XEFANmJ","object":"chat.completion.chunk","created":1759338086,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"-"}}]},"finish_reason":null}],"usage":null,"obfuscation":"G"} - data: {"id":"chatcmpl-CLuB2RvAu1QXnXXnimJvP40espNqB","object":"chat.completion.chunk","created":1759336868,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"5"}}]},"finish_reason":null}],"usage":null,"obfuscation":"P"} + data: {"id":"chatcmpl-CLuUgmQJ8BBUVIAbAe2ji1XEFANmJ","object":"chat.completion.chunk","created":1759338086,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"5"}}]},"finish_reason":null}],"usage":null,"obfuscation":"2"} - data: {"id":"chatcmpl-CLuB2RvAu1QXnXXnimJvP40espNqB","object":"chat.completion.chunk","created":1759336868,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/m"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuUgmQJ8BBUVIAbAe2ji1XEFANmJ","object":"chat.completion.chunk","created":1759338086,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/m"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLuB2RvAu1QXnXXnimJvP40espNqB","object":"chat.completion.chunk","created":1759336868,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ult"}}]},"finish_reason":null}],"usage":null,"obfuscation":"wyKd5ZlkfhV457n"} + data: {"id":"chatcmpl-CLuUgmQJ8BBUVIAbAe2ji1XEFANmJ","object":"chat.completion.chunk","created":1759338086,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ult"}}]},"finish_reason":null}],"usage":null,"obfuscation":"xkC80yl256E6uZC"} - data: {"id":"chatcmpl-CLuB2RvAu1QXnXXnimJvP40espNqB","object":"chat.completion.chunk","created":1759336868,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ied"}}]},"finish_reason":null}],"usage":null,"obfuscation":"EhOojodtQEmiQD9"} + data: {"id":"chatcmpl-CLuUgmQJ8BBUVIAbAe2ji1XEFANmJ","object":"chat.completion.chunk","created":1759338086,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ied"}}]},"finish_reason":null}],"usage":null,"obfuscation":"mtbTobLfs7nfIiy"} - data: {"id":"chatcmpl-CLuB2RvAu1QXnXXnimJvP40espNqB","object":"chat.completion.chunk","created":1759336868,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"it"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuUgmQJ8BBUVIAbAe2ji1XEFANmJ","object":"chat.completion.chunk","created":1759338086,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"it"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLuB2RvAu1QXnXXnimJvP40espNqB","object":"chat.completion.chunk","created":1759336868,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_tool"}}]},"finish_reason":null}],"usage":null,"obfuscation":"BSOx1KZlKYGo9"} + data: {"id":"chatcmpl-CLuUgmQJ8BBUVIAbAe2ji1XEFANmJ","object":"chat.completion.chunk","created":1759338086,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_tool"}}]},"finish_reason":null}],"usage":null,"obfuscation":"VuhZ88zqrPDT8"} - data: {"id":"chatcmpl-CLuB2RvAu1QXnXXnimJvP40espNqB","object":"chat.completion.chunk","created":1759336868,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/main"}}]},"finish_reason":null}],"usage":null,"obfuscation":"jLmyQbhq0FsvR"} + data: {"id":"chatcmpl-CLuUgmQJ8BBUVIAbAe2ji1XEFANmJ","object":"chat.completion.chunk","created":1759338086,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/main"}}]},"finish_reason":null}],"usage":null,"obfuscation":"4J62TZpMFRKq0"} - data: {"id":"chatcmpl-CLuB2RvAu1QXnXXnimJvP40espNqB","object":"chat.completion.chunk","created":1759336868,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":".go"}}]},"finish_reason":null}],"usage":null,"obfuscation":"LGhFfZzrjlAmCEJ"} + data: {"id":"chatcmpl-CLuUgmQJ8BBUVIAbAe2ji1XEFANmJ","object":"chat.completion.chunk","created":1759338086,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":".go"}}]},"finish_reason":null}],"usage":null,"obfuscation":"GJ6sEVUxIWA0d5o"} - data: {"id":"chatcmpl-CLuB2RvAu1QXnXXnimJvP40espNqB","object":"chat.completion.chunk","created":1759336868,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"}"}}]},"finish_reason":null}],"usage":null,"obfuscation":"IECYLtvhYlOojiW"} + data: {"id":"chatcmpl-CLuUgmQJ8BBUVIAbAe2ji1XEFANmJ","object":"chat.completion.chunk","created":1759338086,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"}"}}]},"finish_reason":null}],"usage":null,"obfuscation":"LjjM1iro17qpAIN"} - data: {"id":"chatcmpl-CLuB2RvAu1QXnXXnimJvP40espNqB","object":"chat.completion.chunk","created":1759336868,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"tool_calls"}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuUgmQJ8BBUVIAbAe2ji1XEFANmJ","object":"chat.completion.chunk","created":1759338086,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"tool_calls"}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLuB2RvAu1QXnXXnimJvP40espNqB","object":"chat.completion.chunk","created":1759336868,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6957,"completion_tokens":37,"total_tokens":6994,"prompt_tokens_details":{"cached_tokens":1024,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"OhDi"} + data: {"id":"chatcmpl-CLuUgmQJ8BBUVIAbAe2ji1XEFANmJ","object":"chat.completion.chunk","created":1759338086,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6912,"completion_tokens":37,"total_tokens":6949,"prompt_tokens_details":{"cached_tokens":6656,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"sBwr"} data: [DONE] @@ -645,15 +539,15 @@ interactions: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 1.674251167s + duration: 1.956233s - id: 5 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 32804 + content_length: 32688 host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/multiedit_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use multiedit to change 'Hello, World!' to 'Hello, Crush!' and add a comment '// Greeting' above the fmt.Println line in main.go\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"call_LXjRshZtriL7BnthvT3NmyWp\",\"function\":{\"arguments\":\"{\\\"path\\\": \\\"/tmp/crush-test/TestCoderAgent/openai-gpt-5/multiedit_tool\\\"}\",\"name\":\"ls\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"- /tmp/crush-test/TestCoderAgent/openai-gpt-5/multiedit_tool/\\n - go.mod\\n - main.go\\n\",\"tool_call_id\":\"call_LXjRshZtriL7BnthvT3NmyWp\",\"role\":\"tool\"},{\"tool_calls\":[{\"id\":\"call_30kUKCjDfTy6N2vTsbmHmjbW\",\"function\":{\"arguments\":\"{\\\"file_path\\\":\\\"/tmp/crush-test/TestCoderAgent/openai-gpt-5/multiedit_tool/main.go\\\"}\",\"name\":\"view\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"\\n 1|package main\\n 2|\\n 3|import \\\"fmt\\\"\\n 4|\\n 5|func main() {\\n 6|\\tfmt.Println(\\\"Hello, World!\\\")\\n 7|}\\n\\n\",\"tool_call_id\":\"call_30kUKCjDfTy6N2vTsbmHmjbW\",\"role\":\"tool\"},{\"tool_calls\":[{\"id\":\"call_awhLqEHTROiJOU5bQcb5ZRki\",\"function\":{\"arguments\":\"{\\\"file_path\\\":\\\"/tmp/crush-test/TestCoderAgent/openai-gpt-5/multiedit_tool/main.go\\\",\\\"edits\\\":[{\\\"old_string\\\":\\\"import \\\\\\\"fmt\\\\\\\"\\\\n\\\\nfunc main() {\\\\n\\\\tfmt.Println(\\\\\\\"Hello, World!\\\\\\\")\\\\n}\\\\n\\\",\\\"new_string\\\":\\\"import \\\\\\\"fmt\\\\\\\"\\\\n\\\\nfunc main() {\\\\n\\\\tfmt.Println(\\\\\\\"Hello, Crush!\\\\\\\")\\\\n}\\\\n\\\"},{\\\"old_string\\\":\\\"import \\\\\\\"fmt\\\\\\\"\\\\n\\\\nfunc main() {\\\\n\\\\tfmt.Println(\\\\\\\"Hello, Crush!\\\\\\\")\\\\n}\\\\n\\\",\\\"new_string\\\":\\\"import \\\\\\\"fmt\\\\\\\"\\\\n\\\\nfunc main() {\\\\n\\\\t// Greeting\\\\n\\\\tfmt.Println(\\\\\\\"Hello, Crush!\\\\\\\")\\\\n}\\\\n\\\"}]}\",\"name\":\"multiedit\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"\\nApplied 2 edits to file: /tmp/crush-test/TestCoderAgent/openai-gpt-5/multiedit_tool/main.go\\n\\n\",\"tool_call_id\":\"call_awhLqEHTROiJOU5bQcb5ZRki\",\"role\":\"tool\"},{\"tool_calls\":[{\"id\":\"call_SFYB6XxM74xRfJEdIuVuPJ9h\",\"function\":{\"arguments\":\"{\\\"file_path\\\":\\\"/tmp/crush-test/TestCoderAgent/openai-gpt-5/multiedit_tool/main.go\\\"}\",\"name\":\"view\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"\\n 1|package main\\n 2|\\n 3|import \\\"fmt\\\"\\n 4|\\n 5|func main() {\\n 6|\\t// Greeting\\n 7|\\tfmt.Println(\\\"Hello, Crush!\\\")\\n 8|}\\n\\n\",\"tool_call_id\":\"call_SFYB6XxM74xRfJEdIuVuPJ9h\",\"role\":\"tool\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/multiedit_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use multiedit to change 'Hello, World!' to 'Hello, Crush!' and add a comment '// Greeting' above the fmt.Println line in main.go\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"call_WzOzZTdXsVNlFLcrAbqvJD5p\",\"function\":{\"arguments\":\"{\\\"path\\\": \\\".\\\", \\\"depth\\\": 2}\",\"name\":\"ls\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"\\n- /tmp/crush-test/TestCoderAgent/openai-gpt-5/multiedit_tool/\\n - go.mod\\n - main.go\\n\",\"tool_call_id\":\"call_WzOzZTdXsVNlFLcrAbqvJD5p\",\"role\":\"tool\"},{\"tool_calls\":[{\"id\":\"call_PAFSxqVUfBijqr6QYJq7TDGM\",\"function\":{\"arguments\":\"{\\\"file_path\\\":\\\"/tmp/crush-test/TestCoderAgent/openai-gpt-5/multiedit_tool/main.go\\\"}\",\"name\":\"view\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"\\n 1|package main\\n 2|\\n 3|import \\\"fmt\\\"\\n 4|\\n 5|func main() {\\n 6|\\tfmt.Println(\\\"Hello, World!\\\")\\n 7|}\\n\\n\",\"tool_call_id\":\"call_PAFSxqVUfBijqr6QYJq7TDGM\",\"role\":\"tool\"},{\"tool_calls\":[{\"id\":\"call_bYFLMuoOng1XGhTjRth5N3Eg\",\"function\":{\"arguments\":\"{\\\"file_path\\\":\\\"/tmp/crush-test/TestCoderAgent/openai-gpt-5/multiedit_tool/main.go\\\",\\\"edits\\\":[{\\\"old_string\\\":\\\"func main() {\\\\n\\\\tfmt.Println(\\\\\\\"Hello, World!\\\\\\\")\\\\n}\\\",\\\"new_string\\\":\\\"func main() {\\\\n\\\\t// Greeting\\\\n\\\\tfmt.Println(\\\\\\\"Hello, World!\\\\\\\")\\\\n}\\\"},{\\\"old_string\\\":\\\"\\\\tfmt.Println(\\\\\\\"Hello, World!\\\\\\\")\\\",\\\"new_string\\\":\\\"\\\\tfmt.Println(\\\\\\\"Hello, Crush!\\\\\\\")\\\"}]}\",\"name\":\"multiedit\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"\\nApplied 2 edits to file: /tmp/crush-test/TestCoderAgent/openai-gpt-5/multiedit_tool/main.go\\n\\n\",\"tool_call_id\":\"call_bYFLMuoOng1XGhTjRth5N3Eg\",\"role\":\"tool\"},{\"tool_calls\":[{\"id\":\"call_4mkP5YReOKqHp1zxERdIWlQw\",\"function\":{\"arguments\":\"{\\\"file_path\\\":\\\"/tmp/crush-test/TestCoderAgent/openai-gpt-5/multiedit_tool/main.go\\\"}\",\"name\":\"view\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"\\n 1|package main\\n 2|\\n 3|import \\\"fmt\\\"\\n 4|\\n 5|func main() {\\n 6|\\t// Greeting\\n 7|\\tfmt.Println(\\\"Hello, Crush!\\\")\\n 8|}\\n\\n\",\"tool_call_id\":\"call_4mkP5YReOKqHp1zxERdIWlQw\",\"role\":\"tool\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" headers: Accept: - application/json @@ -669,15 +563,15 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"chatcmpl-CLuB4dywDkzrrPN9Aslpe32T8naR2","object":"chat.completion.chunk","created":1759336870,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"pxVfSh9lk6"} + data: {"id":"chatcmpl-CLuUi44ncTyOsSKw7oxbeBUPCyBeC","object":"chat.completion.chunk","created":1759338088,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"FZOoL2VqpL"} - data: {"id":"chatcmpl-CLuB4dywDkzrrPN9Aslpe32T8naR2","object":"chat.completion.chunk","created":1759336870,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"Done"},"finish_reason":null}],"usage":null,"obfuscation":"ynER45la"} + data: {"id":"chatcmpl-CLuUi44ncTyOsSKw7oxbeBUPCyBeC","object":"chat.completion.chunk","created":1759338088,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"Done"},"finish_reason":null}],"usage":null,"obfuscation":"CNJhilyc"} - data: {"id":"chatcmpl-CLuB4dywDkzrrPN9Aslpe32T8naR2","object":"chat.completion.chunk","created":1759336870,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"."},"finish_reason":null}],"usage":null,"obfuscation":"nj4ZHhbOYle"} + data: {"id":"chatcmpl-CLuUi44ncTyOsSKw7oxbeBUPCyBeC","object":"chat.completion.chunk","created":1759338088,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"."},"finish_reason":null}],"usage":null,"obfuscation":"QIxznN6q6PO"} - data: {"id":"chatcmpl-CLuB4dywDkzrrPN9Aslpe32T8naR2","object":"chat.completion.chunk","created":1759336870,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"stop"}],"usage":null,"obfuscation":"m0tEEU"} + data: {"id":"chatcmpl-CLuUi44ncTyOsSKw7oxbeBUPCyBeC","object":"chat.completion.chunk","created":1759338088,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"stop"}],"usage":null,"obfuscation":"rgz0jN"} - data: {"id":"chatcmpl-CLuB4dywDkzrrPN9Aslpe32T8naR2","object":"chat.completion.chunk","created":1759336870,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":7064,"completion_tokens":5,"total_tokens":7069,"prompt_tokens_details":{"cached_tokens":6912,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"VG13N"} + data: {"id":"chatcmpl-CLuUi44ncTyOsSKw7oxbeBUPCyBeC","object":"chat.completion.chunk","created":1759338088,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":7019,"completion_tokens":5,"total_tokens":7024,"prompt_tokens_details":{"cached_tokens":6912,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"JsrNm"} data: [DONE] @@ -686,4 +580,4 @@ interactions: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 1.678534459s + duration: 1.404475333s diff --git a/internal/agent/testdata/TestCoderAgent/openai-gpt-5/parallel_tool_calls.yaml b/internal/agent/testdata/TestCoderAgent/openai-gpt-5/parallel_tool_calls.yaml index 81794da188165b11a82438eecab171627825c8eb..40fb9efe7fb4b2ace9be133d53ec210dd61d4319 100644 --- a/internal/agent/testdata/TestCoderAgent/openai-gpt-5/parallel_tool_calls.yaml +++ b/internal/agent/testdata/TestCoderAgent/openai-gpt-5/parallel_tool_calls.yaml @@ -24,25 +24,23 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"chatcmpl-CLuBspkvxoQ575KorHiWfasWSm7an","object":"chat.completion.chunk","created":1759336920,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"ygfQ9Oz524K0Tv"} + data: {"id":"chatcmpl-CLuVN1BnkQk7pG0LTgjQP78Mzw3cZ","object":"chat.completion.chunk","created":1759338129,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"2Es81CTWNDo6i8"} - data: {"id":"chatcmpl-CLuBspkvxoQ575KorHiWfasWSm7an","object":"chat.completion.chunk","created":1759336920,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"Parallel"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"QWFlq8dw"} + data: {"id":"chatcmpl-CLuVN1BnkQk7pG0LTgjQP78Mzw3cZ","object":"chat.completion.chunk","created":1759338129,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"Parallel"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"WXLBNdHE"} - data: {"id":"chatcmpl-CLuBspkvxoQ575KorHiWfasWSm7an","object":"chat.completion.chunk","created":1759336920,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Execution"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"1Tw3SY"} + data: {"id":"chatcmpl-CLuVN1BnkQk7pG0LTgjQP78Mzw3cZ","object":"chat.completion.chunk","created":1759338129,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" File"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"gJPxymarI2r"} - data: {"id":"chatcmpl-CLuBspkvxoQ575KorHiWfasWSm7an","object":"chat.completion.chunk","created":1759336920,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" of"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"qLWt2ExGGs4ur"} + data: {"id":"chatcmpl-CLuVN1BnkQk7pG0LTgjQP78Mzw3cZ","object":"chat.completion.chunk","created":1759338129,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Search"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"NV7q4FbxZ"} - data: {"id":"chatcmpl-CLuBspkvxoQ575KorHiWfasWSm7an","object":"chat.completion.chunk","created":1759336920,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" glob"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"AHCGFBR6ED5"} + data: {"id":"chatcmpl-CLuVN1BnkQk7pG0LTgjQP78Mzw3cZ","object":"chat.completion.chunk","created":1759338129,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" and"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"mJauQsngNoHD"} - data: {"id":"chatcmpl-CLuBspkvxoQ575KorHiWfasWSm7an","object":"chat.completion.chunk","created":1759336920,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" and"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"dr8XDB7cimHu"} + data: {"id":"chatcmpl-CLuVN1BnkQk7pG0LTgjQP78Mzw3cZ","object":"chat.completion.chunk","created":1759338129,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Directory"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"zvfLMC"} - data: {"id":"chatcmpl-CLuBspkvxoQ575KorHiWfasWSm7an","object":"chat.completion.chunk","created":1759336920,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" ls"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"eu1lw4NMAxuAt"} + data: {"id":"chatcmpl-CLuVN1BnkQk7pG0LTgjQP78Mzw3cZ","object":"chat.completion.chunk","created":1759338129,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Listing"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"4tYnN3wZ"} - data: {"id":"chatcmpl-CLuBspkvxoQ575KorHiWfasWSm7an","object":"chat.completion.chunk","created":1759336920,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Commands"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"eRrIPKY"} + data: {"id":"chatcmpl-CLuVN1BnkQk7pG0LTgjQP78Mzw3cZ","object":"chat.completion.chunk","created":1759338129,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"qYZMsar46a"} - data: {"id":"chatcmpl-CLuBspkvxoQ575KorHiWfasWSm7an","object":"chat.completion.chunk","created":1759336920,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"k5oqrle3Hf"} - - data: {"id":"chatcmpl-CLuBspkvxoQ575KorHiWfasWSm7an","object":"chat.completion.chunk","created":1759336920,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[],"usage":{"prompt_tokens":137,"completion_tokens":7,"total_tokens":144,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"Q8wYeSlMhQtC5W"} + data: {"id":"chatcmpl-CLuVN1BnkQk7pG0LTgjQP78Mzw3cZ","object":"chat.completion.chunk","created":1759338129,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[],"usage":{"prompt_tokens":137,"completion_tokens":6,"total_tokens":143,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"fHV8lExaB14K50"} data: [DONE] @@ -51,15 +49,15 @@ interactions: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 622.431125ms + duration: 536.555209ms - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 30659 + content_length: 30732 host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/parallel_tool_calls\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use glob to find all .go files and use ls to list the current directory, it is very important that you run both tool calls in parallel\",\"role\":\"user\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/parallel_tool_calls\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use glob to find all .go files and use ls to list the current directory, it is very important that you run both tool calls in parallel\",\"role\":\"user\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" headers: Accept: - application/json @@ -75,55 +73,55 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"chatcmpl-CLuBsr4d4SLF000nTfVvOLjRNVdVU","object":"chat.completion.chunk","created":1759336920,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null},"finish_reason":null}],"obfuscation":"DCgII4n"} + data: {"id":"chatcmpl-CLuVNKEFiNkkjJAs8FkL20HSpf8hy","object":"chat.completion.chunk","created":1759338129,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null},"finish_reason":null}],"obfuscation":"zcLF9pz"} - data: {"id":"chatcmpl-CLuBsr4d4SLF000nTfVvOLjRNVdVU","object":"chat.completion.chunk","created":1759336920,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"id":"call_aBUGusqrnq88FG5VAb8ejMPS","type":"function","function":{"name":"glob","arguments":""}}]},"finish_reason":null}],"obfuscation":"pEb3xT8wGG0EK"} + data: {"id":"chatcmpl-CLuVNKEFiNkkjJAs8FkL20HSpf8hy","object":"chat.completion.chunk","created":1759338129,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"id":"call_6Kdl14Bd9uubXbf1eH37vE36","type":"function","function":{"name":"glob","arguments":""}}]},"finish_reason":null}],"obfuscation":"2lbYdlvuX9Cju"} - data: {"id":"chatcmpl-CLuBsr4d4SLF000nTfVvOLjRNVdVU","object":"chat.completion.chunk","created":1759336920,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\"pa"}}]},"finish_reason":null}],"obfuscation":"1FtyYDV6fEljE"} + data: {"id":"chatcmpl-CLuVNKEFiNkkjJAs8FkL20HSpf8hy","object":"chat.completion.chunk","created":1759338129,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\"pa"}}]},"finish_reason":null}],"obfuscation":"LYRlRocQejO5Z"} - data: {"id":"chatcmpl-CLuBsr4d4SLF000nTfVvOLjRNVdVU","object":"chat.completion.chunk","created":1759336920,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ttern"}}]},"finish_reason":null}],"obfuscation":"B2mYffPmftjuD"} + data: {"id":"chatcmpl-CLuVNKEFiNkkjJAs8FkL20HSpf8hy","object":"chat.completion.chunk","created":1759338129,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ttern"}}]},"finish_reason":null}],"obfuscation":"Mme1KZjRDwsCG"} - data: {"id":"chatcmpl-CLuBsr4d4SLF000nTfVvOLjRNVdVU","object":"chat.completion.chunk","created":1759336920,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\": \"**"}}]},"finish_reason":null}],"obfuscation":"5pQApXDTCs"} + data: {"id":"chatcmpl-CLuVNKEFiNkkjJAs8FkL20HSpf8hy","object":"chat.completion.chunk","created":1759338129,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\": \"**"}}]},"finish_reason":null}],"obfuscation":"l5oraZ6xJ4"} - data: {"id":"chatcmpl-CLuBsr4d4SLF000nTfVvOLjRNVdVU","object":"chat.completion.chunk","created":1759336920,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/*.g"}}]},"finish_reason":null}],"obfuscation":"qydORXqZgrW4g2"} + data: {"id":"chatcmpl-CLuVNKEFiNkkjJAs8FkL20HSpf8hy","object":"chat.completion.chunk","created":1759338129,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/*.g"}}]},"finish_reason":null}],"obfuscation":"BCQ2ZTLaG50QGm"} - data: {"id":"chatcmpl-CLuBsr4d4SLF000nTfVvOLjRNVdVU","object":"chat.completion.chunk","created":1759336920,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"o\"}"}}]},"finish_reason":null}],"obfuscation":"JTU0yTrRJqUK3r"} + data: {"id":"chatcmpl-CLuVNKEFiNkkjJAs8FkL20HSpf8hy","object":"chat.completion.chunk","created":1759338129,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"o\"}"}}]},"finish_reason":null}],"obfuscation":"trIvZHFz39lKyD"} - data: {"id":"chatcmpl-CLuBsr4d4SLF000nTfVvOLjRNVdVU","object":"chat.completion.chunk","created":1759336920,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"id":"call_2fOjUTLKcK4NEyrSGH2sGvtg","type":"function","function":{"name":"ls","arguments":""}}]},"finish_reason":null}],"obfuscation":"hiNgVGgeepFJhdv"} + data: {"id":"chatcmpl-CLuVNKEFiNkkjJAs8FkL20HSpf8hy","object":"chat.completion.chunk","created":1759338129,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"id":"call_h64mPLJWspB3VV5zeyPdnHLx","type":"function","function":{"name":"ls","arguments":""}}]},"finish_reason":null}],"obfuscation":"2uTHx0kB17Ncye9"} - data: {"id":"chatcmpl-CLuBsr4d4SLF000nTfVvOLjRNVdVU","object":"chat.completion.chunk","created":1759336920,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"{\"pa"}}]},"finish_reason":null}],"obfuscation":"yMbKDShn3BgWa"} + data: {"id":"chatcmpl-CLuVNKEFiNkkjJAs8FkL20HSpf8hy","object":"chat.completion.chunk","created":1759338129,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"{\"pa"}}]},"finish_reason":null}],"obfuscation":"91UIxMHGEARCJ"} - data: {"id":"chatcmpl-CLuBsr4d4SLF000nTfVvOLjRNVdVU","object":"chat.completion.chunk","created":1759336920,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"th\": "}}]},"finish_reason":null}],"obfuscation":"pR9ff8O2Xr6K"} + data: {"id":"chatcmpl-CLuVNKEFiNkkjJAs8FkL20HSpf8hy","object":"chat.completion.chunk","created":1759338129,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"th\": "}}]},"finish_reason":null}],"obfuscation":"HE11HUldCEzd"} - data: {"id":"chatcmpl-CLuBsr4d4SLF000nTfVvOLjRNVdVU","object":"chat.completion.chunk","created":1759336920,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"\"/tmp/"}}]},"finish_reason":null}],"obfuscation":"I0sX8drT3H8"} + data: {"id":"chatcmpl-CLuVNKEFiNkkjJAs8FkL20HSpf8hy","object":"chat.completion.chunk","created":1759338129,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"\"/tmp/"}}]},"finish_reason":null}],"obfuscation":"DwoQfY3DpJ7"} - data: {"id":"chatcmpl-CLuBsr4d4SLF000nTfVvOLjRNVdVU","object":"chat.completion.chunk","created":1759336920,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"crus"}}]},"finish_reason":null}],"obfuscation":"l8oH4ht5OuQdK1"} + data: {"id":"chatcmpl-CLuVNKEFiNkkjJAs8FkL20HSpf8hy","object":"chat.completion.chunk","created":1759338129,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"crus"}}]},"finish_reason":null}],"obfuscation":"VnCsx3dTpmIvoM"} - data: {"id":"chatcmpl-CLuBsr4d4SLF000nTfVvOLjRNVdVU","object":"chat.completion.chunk","created":1759336920,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"h-tes"}}]},"finish_reason":null}],"obfuscation":"MDRTUDNFrTgHC"} + data: {"id":"chatcmpl-CLuVNKEFiNkkjJAs8FkL20HSpf8hy","object":"chat.completion.chunk","created":1759338129,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"h-tes"}}]},"finish_reason":null}],"obfuscation":"VQTzorW6JT686"} - data: {"id":"chatcmpl-CLuBsr4d4SLF000nTfVvOLjRNVdVU","object":"chat.completion.chunk","created":1759336920,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"t/Test"}}]},"finish_reason":null}],"obfuscation":"thNyqfttnXsG"} + data: {"id":"chatcmpl-CLuVNKEFiNkkjJAs8FkL20HSpf8hy","object":"chat.completion.chunk","created":1759338129,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"t/Test"}}]},"finish_reason":null}],"obfuscation":"BHWfXKxMFv3q"} - data: {"id":"chatcmpl-CLuBsr4d4SLF000nTfVvOLjRNVdVU","object":"chat.completion.chunk","created":1759336920,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"Code"}}]},"finish_reason":null}],"obfuscation":"yYfm8iXSzdXbtd"} + data: {"id":"chatcmpl-CLuVNKEFiNkkjJAs8FkL20HSpf8hy","object":"chat.completion.chunk","created":1759338129,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"Code"}}]},"finish_reason":null}],"obfuscation":"utQAXHmPF0x820"} - data: {"id":"chatcmpl-CLuBsr4d4SLF000nTfVvOLjRNVdVU","object":"chat.completion.chunk","created":1759336920,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"rAgen"}}]},"finish_reason":null}],"obfuscation":"zaRRWCgFmelXF"} + data: {"id":"chatcmpl-CLuVNKEFiNkkjJAs8FkL20HSpf8hy","object":"chat.completion.chunk","created":1759338129,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"rAgen"}}]},"finish_reason":null}],"obfuscation":"wjhSFPKaBFI6z"} - data: {"id":"chatcmpl-CLuBsr4d4SLF000nTfVvOLjRNVdVU","object":"chat.completion.chunk","created":1759336920,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"t/open"}}]},"finish_reason":null}],"obfuscation":"TGtHndnMbqyM"} + data: {"id":"chatcmpl-CLuVNKEFiNkkjJAs8FkL20HSpf8hy","object":"chat.completion.chunk","created":1759338129,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"t/open"}}]},"finish_reason":null}],"obfuscation":"VMj9RsHddsmY"} - data: {"id":"chatcmpl-CLuBsr4d4SLF000nTfVvOLjRNVdVU","object":"chat.completion.chunk","created":1759336920,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"ai-g"}}]},"finish_reason":null}],"obfuscation":"qIDTRl5WLKunVV"} + data: {"id":"chatcmpl-CLuVNKEFiNkkjJAs8FkL20HSpf8hy","object":"chat.completion.chunk","created":1759338129,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"ai-g"}}]},"finish_reason":null}],"obfuscation":"SB7zQzOKI5Bx3O"} - data: {"id":"chatcmpl-CLuBsr4d4SLF000nTfVvOLjRNVdVU","object":"chat.completion.chunk","created":1759336920,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"pt-5/"}}]},"finish_reason":null}],"obfuscation":"OuCfDCRByr2gY"} + data: {"id":"chatcmpl-CLuVNKEFiNkkjJAs8FkL20HSpf8hy","object":"chat.completion.chunk","created":1759338129,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"pt-5/"}}]},"finish_reason":null}],"obfuscation":"a5bTw4EJNJoRv"} - data: {"id":"chatcmpl-CLuBsr4d4SLF000nTfVvOLjRNVdVU","object":"chat.completion.chunk","created":1759336920,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"parall"}}]},"finish_reason":null}],"obfuscation":"QbFuyPNwX9PA"} + data: {"id":"chatcmpl-CLuVNKEFiNkkjJAs8FkL20HSpf8hy","object":"chat.completion.chunk","created":1759338129,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"parall"}}]},"finish_reason":null}],"obfuscation":"0wm9QgvfpTvk"} - data: {"id":"chatcmpl-CLuBsr4d4SLF000nTfVvOLjRNVdVU","object":"chat.completion.chunk","created":1759336920,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"el_t"}}]},"finish_reason":null}],"obfuscation":"EAbAhSO0PZZooG"} + data: {"id":"chatcmpl-CLuVNKEFiNkkjJAs8FkL20HSpf8hy","object":"chat.completion.chunk","created":1759338129,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"el_t"}}]},"finish_reason":null}],"obfuscation":"7RPfHL1CnuoQgS"} - data: {"id":"chatcmpl-CLuBsr4d4SLF000nTfVvOLjRNVdVU","object":"chat.completion.chunk","created":1759336920,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"ool_c"}}]},"finish_reason":null}],"obfuscation":"CDm8ObTBCAURk"} + data: {"id":"chatcmpl-CLuVNKEFiNkkjJAs8FkL20HSpf8hy","object":"chat.completion.chunk","created":1759338129,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"ool_c"}}]},"finish_reason":null}],"obfuscation":"6ahzJ40Newozu"} - data: {"id":"chatcmpl-CLuBsr4d4SLF000nTfVvOLjRNVdVU","object":"chat.completion.chunk","created":1759336920,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"alls\"}"}}]},"finish_reason":null}],"obfuscation":"zAGfny5qecF"} + data: {"id":"chatcmpl-CLuVNKEFiNkkjJAs8FkL20HSpf8hy","object":"chat.completion.chunk","created":1759338129,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"usage":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":1,"function":{"arguments":"alls\"}"}}]},"finish_reason":null}],"obfuscation":"nlUgjxDssWN"} - data: {"id":"chatcmpl-CLuBsr4d4SLF000nTfVvOLjRNVdVU","object":"chat.completion.chunk","created":1759336920,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"tool_calls"}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuVNKEFiNkkjJAs8FkL20HSpf8hy","object":"chat.completion.chunk","created":1759338129,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"tool_calls"}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLuBsr4d4SLF000nTfVvOLjRNVdVU","object":"chat.completion.chunk","created":1759336920,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6571,"completion_tokens":327,"total_tokens":6898,"prompt_tokens_details":{"cached_tokens":1024,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":256,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"y"} + data: {"id":"chatcmpl-CLuVNKEFiNkkjJAs8FkL20HSpf8hy","object":"chat.completion.chunk","created":1759338129,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6581,"completion_tokens":263,"total_tokens":6844,"prompt_tokens_details":{"cached_tokens":1024,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":192,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"x"} data: [DONE] @@ -132,15 +130,15 @@ interactions: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 8.617201583s + duration: 6.584843042s - id: 2 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 31312 + content_length: 31387 host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/parallel_tool_calls\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use glob to find all .go files and use ls to list the current directory, it is very important that you run both tool calls in parallel\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"call_aBUGusqrnq88FG5VAb8ejMPS\",\"function\":{\"arguments\":\"{\\\"pattern\\\": \\\"**/*.go\\\"}\",\"name\":\"glob\"},\"type\":\"function\"},{\"id\":\"call_2fOjUTLKcK4NEyrSGH2sGvtg\",\"function\":{\"arguments\":\"{\\\"path\\\": \\\"/tmp/crush-test/TestCoderAgent/openai-gpt-5/parallel_tool_calls\\\"}\",\"name\":\"ls\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"/tmp/crush-test/TestCoderAgent/openai-gpt-5/parallel_tool_calls/main.go\",\"tool_call_id\":\"call_aBUGusqrnq88FG5VAb8ejMPS\",\"role\":\"tool\"},{\"content\":\"- /tmp/crush-test/TestCoderAgent/openai-gpt-5/parallel_tool_calls/\\n - go.mod\\n - main.go\\n\",\"tool_call_id\":\"call_2fOjUTLKcK4NEyrSGH2sGvtg\",\"role\":\"tool\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/parallel_tool_calls\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use glob to find all .go files and use ls to list the current directory, it is very important that you run both tool calls in parallel\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"call_6Kdl14Bd9uubXbf1eH37vE36\",\"function\":{\"arguments\":\"{\\\"pattern\\\": \\\"**/*.go\\\"}\",\"name\":\"glob\"},\"type\":\"function\"},{\"id\":\"call_h64mPLJWspB3VV5zeyPdnHLx\",\"function\":{\"arguments\":\"{\\\"path\\\": \\\"/tmp/crush-test/TestCoderAgent/openai-gpt-5/parallel_tool_calls\\\"}\",\"name\":\"ls\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"/tmp/crush-test/TestCoderAgent/openai-gpt-5/parallel_tool_calls/main.go\",\"tool_call_id\":\"call_6Kdl14Bd9uubXbf1eH37vE36\",\"role\":\"tool\"},{\"content\":\"\\n- /tmp/crush-test/TestCoderAgent/openai-gpt-5/parallel_tool_calls/\\n - go.mod\\n - main.go\\n\",\"tool_call_id\":\"call_h64mPLJWspB3VV5zeyPdnHLx\",\"role\":\"tool\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" headers: Accept: - application/json @@ -156,51 +154,87 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"chatcmpl-CLuC1ZUQRloANkLDLiPi3I1wTEJZ9","object":"chat.completion.chunk","created":1759336929,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"ueLzEhzLV3"} + data: {"id":"chatcmpl-CLuVUPmCNrReWwPYvZwelWbDL60g7","object":"chat.completion.chunk","created":1759338136,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"Rl3yTpdqKI"} + + data: {"id":"chatcmpl-CLuVUPmCNrReWwPYvZwelWbDL60g7","object":"chat.completion.chunk","created":1759338136,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"-"},"finish_reason":null}],"usage":null,"obfuscation":"Fpraf5tMpml"} + + data: {"id":"chatcmpl-CLuVUPmCNrReWwPYvZwelWbDL60g7","object":"chat.completion.chunk","created":1759338136,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" ."},"finish_reason":null}],"usage":null,"obfuscation":"EiHg0stqxt"} + + data: {"id":"chatcmpl-CLuVUPmCNrReWwPYvZwelWbDL60g7","object":"chat.completion.chunk","created":1759338136,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"go"},"finish_reason":null}],"usage":null,"obfuscation":"gPNo12Lznw"} + + data: {"id":"chatcmpl-CLuVUPmCNrReWwPYvZwelWbDL60g7","object":"chat.completion.chunk","created":1759338136,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" files"},"finish_reason":null}],"usage":null,"obfuscation":"hOAy5h"} + + data: {"id":"chatcmpl-CLuVUPmCNrReWwPYvZwelWbDL60g7","object":"chat.completion.chunk","created":1759338136,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":":"},"finish_reason":null}],"usage":null,"obfuscation":"pvBmRKi9Djv"} + + data: {"id":"chatcmpl-CLuVUPmCNrReWwPYvZwelWbDL60g7","object":"chat.completion.chunk","created":1759338136,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" /"},"finish_reason":null}],"usage":null,"obfuscation":"QoK02AYZt6"} + + data: {"id":"chatcmpl-CLuVUPmCNrReWwPYvZwelWbDL60g7","object":"chat.completion.chunk","created":1759338136,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"tmp"},"finish_reason":null}],"usage":null,"obfuscation":"gFCEOqULa"} + + data: {"id":"chatcmpl-CLuVUPmCNrReWwPYvZwelWbDL60g7","object":"chat.completion.chunk","created":1759338136,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"/cr"},"finish_reason":null}],"usage":null,"obfuscation":"JJHNwMqAk"} + + data: {"id":"chatcmpl-CLuVUPmCNrReWwPYvZwelWbDL60g7","object":"chat.completion.chunk","created":1759338136,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"ush"},"finish_reason":null}],"usage":null,"obfuscation":"B6tZJC2xB"} + + data: {"id":"chatcmpl-CLuVUPmCNrReWwPYvZwelWbDL60g7","object":"chat.completion.chunk","created":1759338136,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"-test"},"finish_reason":null}],"usage":null,"obfuscation":"muwNC9n"} + + data: {"id":"chatcmpl-CLuVUPmCNrReWwPYvZwelWbDL60g7","object":"chat.completion.chunk","created":1759338136,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"/Test"},"finish_reason":null}],"usage":null,"obfuscation":"GfmDY1E"} + + data: {"id":"chatcmpl-CLuVUPmCNrReWwPYvZwelWbDL60g7","object":"chat.completion.chunk","created":1759338136,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"Coder"},"finish_reason":null}],"usage":null,"obfuscation":"W9mNiV0"} + + data: {"id":"chatcmpl-CLuVUPmCNrReWwPYvZwelWbDL60g7","object":"chat.completion.chunk","created":1759338136,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"Agent"},"finish_reason":null}],"usage":null,"obfuscation":"FK9tbs3"} + + data: {"id":"chatcmpl-CLuVUPmCNrReWwPYvZwelWbDL60g7","object":"chat.completion.chunk","created":1759338136,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"/open"},"finish_reason":null}],"usage":null,"obfuscation":"LwcGlUz"} + + data: {"id":"chatcmpl-CLuVUPmCNrReWwPYvZwelWbDL60g7","object":"chat.completion.chunk","created":1759338136,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"ai"},"finish_reason":null}],"usage":null,"obfuscation":"30EQ4gNLeR"} + + data: {"id":"chatcmpl-CLuVUPmCNrReWwPYvZwelWbDL60g7","object":"chat.completion.chunk","created":1759338136,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"-g"},"finish_reason":null}],"usage":null,"obfuscation":"N48UPcNIMI"} + + data: {"id":"chatcmpl-CLuVUPmCNrReWwPYvZwelWbDL60g7","object":"chat.completion.chunk","created":1759338136,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"pt"},"finish_reason":null}],"usage":null,"obfuscation":"ORcUAGzmN7"} + + data: {"id":"chatcmpl-CLuVUPmCNrReWwPYvZwelWbDL60g7","object":"chat.completion.chunk","created":1759338136,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"-"},"finish_reason":null}],"usage":null,"obfuscation":"PnvWq8Z7yEU"} - data: {"id":"chatcmpl-CLuC1ZUQRloANkLDLiPi3I1wTEJZ9","object":"chat.completion.chunk","created":1759336929,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"-"},"finish_reason":null}],"usage":null,"obfuscation":"DQ2DPRFjedS"} + data: {"id":"chatcmpl-CLuVUPmCNrReWwPYvZwelWbDL60g7","object":"chat.completion.chunk","created":1759338136,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"5"},"finish_reason":null}],"usage":null,"obfuscation":"1mZf3Z88OuV"} - data: {"id":"chatcmpl-CLuC1ZUQRloANkLDLiPi3I1wTEJZ9","object":"chat.completion.chunk","created":1759336929,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" ."},"finish_reason":null}],"usage":null,"obfuscation":"kx2c7jAmQ1"} + data: {"id":"chatcmpl-CLuVUPmCNrReWwPYvZwelWbDL60g7","object":"chat.completion.chunk","created":1759338136,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"/"},"finish_reason":null}],"usage":null,"obfuscation":"0a2WWJP8rnh"} - data: {"id":"chatcmpl-CLuC1ZUQRloANkLDLiPi3I1wTEJZ9","object":"chat.completion.chunk","created":1759336929,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"go"},"finish_reason":null}],"usage":null,"obfuscation":"n4r5CfurJV"} + data: {"id":"chatcmpl-CLuVUPmCNrReWwPYvZwelWbDL60g7","object":"chat.completion.chunk","created":1759338136,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"parallel"},"finish_reason":null}],"usage":null,"obfuscation":"gRNH"} - data: {"id":"chatcmpl-CLuC1ZUQRloANkLDLiPi3I1wTEJZ9","object":"chat.completion.chunk","created":1759336929,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" files"},"finish_reason":null}],"usage":null,"obfuscation":"fil3ST"} + data: {"id":"chatcmpl-CLuVUPmCNrReWwPYvZwelWbDL60g7","object":"chat.completion.chunk","created":1759338136,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"_tool"},"finish_reason":null}],"usage":null,"obfuscation":"1LH8mjN"} - data: {"id":"chatcmpl-CLuC1ZUQRloANkLDLiPi3I1wTEJZ9","object":"chat.completion.chunk","created":1759336929,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":":"},"finish_reason":null}],"usage":null,"obfuscation":"0IMp8IR9IDZ"} + data: {"id":"chatcmpl-CLuVUPmCNrReWwPYvZwelWbDL60g7","object":"chat.completion.chunk","created":1759338136,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"_calls"},"finish_reason":null}],"usage":null,"obfuscation":"dqjqaF"} - data: {"id":"chatcmpl-CLuC1ZUQRloANkLDLiPi3I1wTEJZ9","object":"chat.completion.chunk","created":1759336929,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" main"},"finish_reason":null}],"usage":null,"obfuscation":"kUdonng"} + data: {"id":"chatcmpl-CLuVUPmCNrReWwPYvZwelWbDL60g7","object":"chat.completion.chunk","created":1759338136,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"/main"},"finish_reason":null}],"usage":null,"obfuscation":"vzemRNY"} - data: {"id":"chatcmpl-CLuC1ZUQRloANkLDLiPi3I1wTEJZ9","object":"chat.completion.chunk","created":1759336929,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":".go"},"finish_reason":null}],"usage":null,"obfuscation":"lEyo5dG08"} + data: {"id":"chatcmpl-CLuVUPmCNrReWwPYvZwelWbDL60g7","object":"chat.completion.chunk","created":1759338136,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":".go"},"finish_reason":null}],"usage":null,"obfuscation":"JcthrFrqs"} - data: {"id":"chatcmpl-CLuC1ZUQRloANkLDLiPi3I1wTEJZ9","object":"chat.completion.chunk","created":1759336929,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"\n"},"finish_reason":null}],"usage":null,"obfuscation":"o4PduM3DDR"} + data: {"id":"chatcmpl-CLuVUPmCNrReWwPYvZwelWbDL60g7","object":"chat.completion.chunk","created":1759338136,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"\n"},"finish_reason":null}],"usage":null,"obfuscation":"Pgrj3Lp1nr"} - data: {"id":"chatcmpl-CLuC1ZUQRloANkLDLiPi3I1wTEJZ9","object":"chat.completion.chunk","created":1759336929,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"-"},"finish_reason":null}],"usage":null,"obfuscation":"jZvVv7zFqo9"} + data: {"id":"chatcmpl-CLuVUPmCNrReWwPYvZwelWbDL60g7","object":"chat.completion.chunk","created":1759338136,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"-"},"finish_reason":null}],"usage":null,"obfuscation":"hgLnZ6u1613"} - data: {"id":"chatcmpl-CLuC1ZUQRloANkLDLiPi3I1wTEJZ9","object":"chat.completion.chunk","created":1759336929,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" ls"},"finish_reason":null}],"usage":null,"obfuscation":"eudiCVQo8"} + data: {"id":"chatcmpl-CLuVUPmCNrReWwPYvZwelWbDL60g7","object":"chat.completion.chunk","created":1759338136,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" ls"},"finish_reason":null}],"usage":null,"obfuscation":"NHU2RfJ0G"} - data: {"id":"chatcmpl-CLuC1ZUQRloANkLDLiPi3I1wTEJZ9","object":"chat.completion.chunk","created":1759336929,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":":\n"},"finish_reason":null}],"usage":null,"obfuscation":"Sjg08qIuH"} + data: {"id":"chatcmpl-CLuVUPmCNrReWwPYvZwelWbDL60g7","object":"chat.completion.chunk","created":1759338136,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":":\n"},"finish_reason":null}],"usage":null,"obfuscation":"710sHmRaV"} - data: {"id":"chatcmpl-CLuC1ZUQRloANkLDLiPi3I1wTEJZ9","object":"chat.completion.chunk","created":1759336929,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" "},"finish_reason":null}],"usage":null,"obfuscation":"i3ypevk01Rz"} + data: {"id":"chatcmpl-CLuVUPmCNrReWwPYvZwelWbDL60g7","object":"chat.completion.chunk","created":1759338136,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" "},"finish_reason":null}],"usage":null,"obfuscation":"9n1Jb6WxWC6"} - data: {"id":"chatcmpl-CLuC1ZUQRloANkLDLiPi3I1wTEJZ9","object":"chat.completion.chunk","created":1759336929,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" -"},"finish_reason":null}],"usage":null,"obfuscation":"vMIUMOw2dh"} + data: {"id":"chatcmpl-CLuVUPmCNrReWwPYvZwelWbDL60g7","object":"chat.completion.chunk","created":1759338136,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" -"},"finish_reason":null}],"usage":null,"obfuscation":"7Tw66VRgMI"} - data: {"id":"chatcmpl-CLuC1ZUQRloANkLDLiPi3I1wTEJZ9","object":"chat.completion.chunk","created":1759336929,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" go"},"finish_reason":null}],"usage":null,"obfuscation":"l65JQx6t6"} + data: {"id":"chatcmpl-CLuVUPmCNrReWwPYvZwelWbDL60g7","object":"chat.completion.chunk","created":1759338136,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" go"},"finish_reason":null}],"usage":null,"obfuscation":"FkbywN3cN"} - data: {"id":"chatcmpl-CLuC1ZUQRloANkLDLiPi3I1wTEJZ9","object":"chat.completion.chunk","created":1759336929,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":".mod"},"finish_reason":null}],"usage":null,"obfuscation":"8E8pIy1v"} + data: {"id":"chatcmpl-CLuVUPmCNrReWwPYvZwelWbDL60g7","object":"chat.completion.chunk","created":1759338136,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":".mod"},"finish_reason":null}],"usage":null,"obfuscation":"9xXKSzD0"} - data: {"id":"chatcmpl-CLuC1ZUQRloANkLDLiPi3I1wTEJZ9","object":"chat.completion.chunk","created":1759336929,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"\n"},"finish_reason":null}],"usage":null,"obfuscation":"U38UUOwsvv"} + data: {"id":"chatcmpl-CLuVUPmCNrReWwPYvZwelWbDL60g7","object":"chat.completion.chunk","created":1759338136,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"\n"},"finish_reason":null}],"usage":null,"obfuscation":"6BdYlr3BjJ"} - data: {"id":"chatcmpl-CLuC1ZUQRloANkLDLiPi3I1wTEJZ9","object":"chat.completion.chunk","created":1759336929,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" "},"finish_reason":null}],"usage":null,"obfuscation":"lLrQL7yuDFI"} + data: {"id":"chatcmpl-CLuVUPmCNrReWwPYvZwelWbDL60g7","object":"chat.completion.chunk","created":1759338136,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" "},"finish_reason":null}],"usage":null,"obfuscation":"KO5YsoBouZn"} - data: {"id":"chatcmpl-CLuC1ZUQRloANkLDLiPi3I1wTEJZ9","object":"chat.completion.chunk","created":1759336929,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" -"},"finish_reason":null}],"usage":null,"obfuscation":"Qbhp6ueREX"} + data: {"id":"chatcmpl-CLuVUPmCNrReWwPYvZwelWbDL60g7","object":"chat.completion.chunk","created":1759338136,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" -"},"finish_reason":null}],"usage":null,"obfuscation":"isUe6wXjYh"} - data: {"id":"chatcmpl-CLuC1ZUQRloANkLDLiPi3I1wTEJZ9","object":"chat.completion.chunk","created":1759336929,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" main"},"finish_reason":null}],"usage":null,"obfuscation":"hGMu5NI"} + data: {"id":"chatcmpl-CLuVUPmCNrReWwPYvZwelWbDL60g7","object":"chat.completion.chunk","created":1759338136,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" main"},"finish_reason":null}],"usage":null,"obfuscation":"ifhZxXr"} - data: {"id":"chatcmpl-CLuC1ZUQRloANkLDLiPi3I1wTEJZ9","object":"chat.completion.chunk","created":1759336929,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":".go"},"finish_reason":null}],"usage":null,"obfuscation":"pJcTkACAQ"} + data: {"id":"chatcmpl-CLuVUPmCNrReWwPYvZwelWbDL60g7","object":"chat.completion.chunk","created":1759338136,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":".go"},"finish_reason":null}],"usage":null,"obfuscation":"ShDTlfxyB"} - data: {"id":"chatcmpl-CLuC1ZUQRloANkLDLiPi3I1wTEJZ9","object":"chat.completion.chunk","created":1759336929,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"stop"}],"usage":null,"obfuscation":"HdBgN5"} + data: {"id":"chatcmpl-CLuVUPmCNrReWwPYvZwelWbDL60g7","object":"chat.completion.chunk","created":1759338136,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"stop"}],"usage":null,"obfuscation":"qQXqTV"} - data: {"id":"chatcmpl-CLuC1ZUQRloANkLDLiPi3I1wTEJZ9","object":"chat.completion.chunk","created":1759336929,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6703,"completion_tokens":23,"total_tokens":6726,"prompt_tokens_details":{"cached_tokens":6528,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"hmFB"} + data: {"id":"chatcmpl-CLuVUPmCNrReWwPYvZwelWbDL60g7","object":"chat.completion.chunk","created":1759338136,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6715,"completion_tokens":41,"total_tokens":6756,"prompt_tokens_details":{"cached_tokens":6528,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"7N4V"} data: [DONE] @@ -209,4 +243,4 @@ interactions: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 3.2262175s + duration: 1.784785125s diff --git a/internal/agent/testdata/TestCoderAgent/openai-gpt-5/read_a_file.yaml b/internal/agent/testdata/TestCoderAgent/openai-gpt-5/read_a_file.yaml index f9d0afae179eea1df43f7a570ac0a11e1d7cb408..65935e5765a1ee5dcb231cb0dd18418c6e2cd288 100644 --- a/internal/agent/testdata/TestCoderAgent/openai-gpt-5/read_a_file.yaml +++ b/internal/agent/testdata/TestCoderAgent/openai-gpt-5/read_a_file.yaml @@ -24,17 +24,19 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"chatcmpl-CLu7oMAHYDQ2VshSemevLeG6pzFhW","object":"chat.completion.chunk","created":1759336668,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"KhCsb8RC3eDmpG"} + data: {"id":"chatcmpl-CLuS7VvmRXYoPcVz8RvwAsNjQfe2a","object":"chat.completion.chunk","created":1759337927,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"36S2DJyxeLNcA3"} - data: {"id":"chatcmpl-CLu7oMAHYDQ2VshSemevLeG6pzFhW","object":"chat.completion.chunk","created":1759336668,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"Understanding"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"d1i"} + data: {"id":"chatcmpl-CLuS7VvmRXYoPcVz8RvwAsNjQfe2a","object":"chat.completion.chunk","created":1759337927,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":"Understanding"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"8tC"} - data: {"id":"chatcmpl-CLu7oMAHYDQ2VshSemevLeG6pzFhW","object":"chat.completion.chunk","created":1759336668,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Go"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"VEvUhmgkDxyPL"} + data: {"id":"chatcmpl-CLuS7VvmRXYoPcVz8RvwAsNjQfe2a","object":"chat.completion.chunk","created":1759337927,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":" Go"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"Odf2U6ZoJz49x"} - data: {"id":"chatcmpl-CLu7oMAHYDQ2VshSemevLeG6pzFhW","object":"chat.completion.chunk","created":1759336668,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Modules"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"invthUbo"} + data: {"id":"chatcmpl-CLuS7VvmRXYoPcVz8RvwAsNjQfe2a","object":"chat.completion.chunk","created":1759337927,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":" Mod"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"GX6p8ektbKDh"} - data: {"id":"chatcmpl-CLu7oMAHYDQ2VshSemevLeG6pzFhW","object":"chat.completion.chunk","created":1759336668,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"tYLDqy6tK7"} + data: {"id":"chatcmpl-CLuS7VvmRXYoPcVz8RvwAsNjQfe2a","object":"chat.completion.chunk","created":1759337927,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":" Files"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"npnjqmCpYc"} - data: {"id":"chatcmpl-CLu7oMAHYDQ2VshSemevLeG6pzFhW","object":"chat.completion.chunk","created":1759336668,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[],"usage":{"prompt_tokens":112,"completion_tokens":3,"total_tokens":115,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"VhNgSQdxHSMei1"} + data: {"id":"chatcmpl-CLuS7VvmRXYoPcVz8RvwAsNjQfe2a","object":"chat.completion.chunk","created":1759337927,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"XvzP9vS6EL"} + + data: {"id":"chatcmpl-CLuS7VvmRXYoPcVz8RvwAsNjQfe2a","object":"chat.completion.chunk","created":1759337927,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[],"usage":{"prompt_tokens":112,"completion_tokens":4,"total_tokens":116,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"9mzjBxgOZQFxkk"} data: [DONE] @@ -43,15 +45,15 @@ interactions: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 1.514277208s + duration: 716.34375ms - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 30532 + content_length: 30605 host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/read_a_file\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"Read the go mod\",\"role\":\"user\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/read_a_file\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"Read the go mod\",\"role\":\"user\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" headers: Accept: - application/json @@ -67,27 +69,27 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"chatcmpl-CLu7oKPiHYDDB7dqlFPLd7m1T5o9n","object":"chat.completion.chunk","created":1759336668,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"call_XhvBWJymqHr9xxKBxiAs8hdb","type":"function","function":{"name":"glob","arguments":""}}],"refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"rERamMEcBQJ0"} + data: {"id":"chatcmpl-CLuS8oKJUMw9c9YcOTSVKHDoGnCbI","object":"chat.completion.chunk","created":1759337928,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"call_IBloOUdPjpwlA4bROOw1HRdL","type":"function","function":{"name":"glob","arguments":""}}],"refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"YE8IIYJQzznM"} - data: {"id":"chatcmpl-CLu7oKPiHYDDB7dqlFPLd7m1T5o9n","object":"chat.completion.chunk","created":1759336668,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"OBu8WgRVgWKBJ90"} + data: {"id":"chatcmpl-CLuS8oKJUMw9c9YcOTSVKHDoGnCbI","object":"chat.completion.chunk","created":1759337928,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"GFZreVS3n8N4qoc"} - data: {"id":"chatcmpl-CLu7oKPiHYDDB7dqlFPLd7m1T5o9n","object":"chat.completion.chunk","created":1759336668,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"pattern"}}]},"finish_reason":null}],"usage":null,"obfuscation":"VDFOInARBqe"} + data: {"id":"chatcmpl-CLuS8oKJUMw9c9YcOTSVKHDoGnCbI","object":"chat.completion.chunk","created":1759337928,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"pattern"}}]},"finish_reason":null}],"usage":null,"obfuscation":"xjS4j3C6gtg"} - data: {"id":"chatcmpl-CLu7oKPiHYDDB7dqlFPLd7m1T5o9n","object":"chat.completion.chunk","created":1759336668,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"UR0JIsqyLBv1W"} + data: {"id":"chatcmpl-CLuS8oKJUMw9c9YcOTSVKHDoGnCbI","object":"chat.completion.chunk","created":1759337928,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"3ifpRS9InimjN"} - data: {"id":"chatcmpl-CLu7oKPiHYDDB7dqlFPLd7m1T5o9n","object":"chat.completion.chunk","created":1759336668,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"**"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuS8oKJUMw9c9YcOTSVKHDoGnCbI","object":"chat.completion.chunk","created":1759337928,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"**"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLu7oKPiHYDDB7dqlFPLd7m1T5o9n","object":"chat.completion.chunk","created":1759336668,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/"}}]},"finish_reason":null}],"usage":null,"obfuscation":"E"} + data: {"id":"chatcmpl-CLuS8oKJUMw9c9YcOTSVKHDoGnCbI","object":"chat.completion.chunk","created":1759337928,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/"}}]},"finish_reason":null}],"usage":null,"obfuscation":"j"} - data: {"id":"chatcmpl-CLu7oKPiHYDDB7dqlFPLd7m1T5o9n","object":"chat.completion.chunk","created":1759336668,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"go"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuS8oKJUMw9c9YcOTSVKHDoGnCbI","object":"chat.completion.chunk","created":1759337928,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"go"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLu7oKPiHYDDB7dqlFPLd7m1T5o9n","object":"chat.completion.chunk","created":1759336668,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":".mod"}}]},"finish_reason":null}],"usage":null,"obfuscation":"SB2DpspaG9jbvc"} + data: {"id":"chatcmpl-CLuS8oKJUMw9c9YcOTSVKHDoGnCbI","object":"chat.completion.chunk","created":1759337928,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":".mod"}}]},"finish_reason":null}],"usage":null,"obfuscation":"XopPoHRW9SFqk5"} - data: {"id":"chatcmpl-CLu7oKPiHYDDB7dqlFPLd7m1T5o9n","object":"chat.completion.chunk","created":1759336668,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"}"}}]},"finish_reason":null}],"usage":null,"obfuscation":"BZX3icm1dPjemtl"} + data: {"id":"chatcmpl-CLuS8oKJUMw9c9YcOTSVKHDoGnCbI","object":"chat.completion.chunk","created":1759337928,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"}"}}]},"finish_reason":null}],"usage":null,"obfuscation":"XHgN2gXG4ELBYJK"} - data: {"id":"chatcmpl-CLu7oKPiHYDDB7dqlFPLd7m1T5o9n","object":"chat.completion.chunk","created":1759336668,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"tool_calls"}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuS8oKJUMw9c9YcOTSVKHDoGnCbI","object":"chat.completion.chunk","created":1759337928,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"tool_calls"}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLu7oKPiHYDDB7dqlFPLd7m1T5o9n","object":"chat.completion.chunk","created":1759336668,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6545,"completion_tokens":217,"total_tokens":6762,"prompt_tokens_details":{"cached_tokens":1024,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":192,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"Y"} + data: {"id":"chatcmpl-CLuS8oKJUMw9c9YcOTSVKHDoGnCbI","object":"chat.completion.chunk","created":1759337928,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6555,"completion_tokens":153,"total_tokens":6708,"prompt_tokens_details":{"cached_tokens":1024,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":128,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"C"} data: [DONE] @@ -96,15 +98,15 @@ interactions: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 6.250112208s + duration: 6.849897791s - id: 2 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 30832 + content_length: 30905 host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/read_a_file\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"Read the go mod\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"call_XhvBWJymqHr9xxKBxiAs8hdb\",\"function\":{\"arguments\":\"{\\\"pattern\\\":\\\"**/go.mod\\\"}\",\"name\":\"glob\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"/tmp/crush-test/TestCoderAgent/openai-gpt-5/read_a_file/go.mod\",\"tool_call_id\":\"call_XhvBWJymqHr9xxKBxiAs8hdb\",\"role\":\"tool\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/read_a_file\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"Read the go mod\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"call_IBloOUdPjpwlA4bROOw1HRdL\",\"function\":{\"arguments\":\"{\\\"pattern\\\":\\\"**/go.mod\\\"}\",\"name\":\"glob\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"/tmp/crush-test/TestCoderAgent/openai-gpt-5/read_a_file/go.mod\",\"tool_call_id\":\"call_IBloOUdPjpwlA4bROOw1HRdL\",\"role\":\"tool\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" headers: Accept: - application/json @@ -120,59 +122,59 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"chatcmpl-CLu7uWiFBqVfH6beGAI4cMCcwBSag","object":"chat.completion.chunk","created":1759336674,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"call_0fuOzbk15naiGpIYRvUpnw2x","type":"function","function":{"name":"view","arguments":""}}],"refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"08KZpCyl5OzI"} + data: {"id":"chatcmpl-CLuSFyawhtMWhuXjg9AaPJpOzQ9QN","object":"chat.completion.chunk","created":1759337935,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"call_ZQl29pbi6rOX8hCZA2hC0Zwr","type":"function","function":{"name":"view","arguments":""}}],"refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"BchAn9ldsjUY"} - data: {"id":"chatcmpl-CLu7uWiFBqVfH6beGAI4cMCcwBSag","object":"chat.completion.chunk","created":1759336674,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"ePqnmFtGgr4nDT4"} + data: {"id":"chatcmpl-CLuSFyawhtMWhuXjg9AaPJpOzQ9QN","object":"chat.completion.chunk","created":1759337935,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"GU7yjzoFZdDa0vr"} - data: {"id":"chatcmpl-CLu7uWiFBqVfH6beGAI4cMCcwBSag","object":"chat.completion.chunk","created":1759336674,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"file"}}]},"finish_reason":null}],"usage":null,"obfuscation":"tTWGwxiRQkJVfV"} + data: {"id":"chatcmpl-CLuSFyawhtMWhuXjg9AaPJpOzQ9QN","object":"chat.completion.chunk","created":1759337935,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"file"}}]},"finish_reason":null}],"usage":null,"obfuscation":"YsF7zEPc5sewKe"} - data: {"id":"chatcmpl-CLu7uWiFBqVfH6beGAI4cMCcwBSag","object":"chat.completion.chunk","created":1759336674,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_path"}}]},"finish_reason":null}],"usage":null,"obfuscation":"wA4GYVLwvcXbT"} + data: {"id":"chatcmpl-CLuSFyawhtMWhuXjg9AaPJpOzQ9QN","object":"chat.completion.chunk","created":1759337935,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_path"}}]},"finish_reason":null}],"usage":null,"obfuscation":"M8QEv3b1b22XR"} - data: {"id":"chatcmpl-CLu7uWiFBqVfH6beGAI4cMCcwBSag","object":"chat.completion.chunk","created":1759336674,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":"}}]},"finish_reason":null}],"usage":null,"obfuscation":"jop6I2zcevczrUb"} + data: {"id":"chatcmpl-CLuSFyawhtMWhuXjg9AaPJpOzQ9QN","object":"chat.completion.chunk","created":1759337935,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":"}}]},"finish_reason":null}],"usage":null,"obfuscation":"k1lpALe7SGFJDd8"} - data: {"id":"chatcmpl-CLu7uWiFBqVfH6beGAI4cMCcwBSag","object":"chat.completion.chunk","created":1759336674,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"/"}}]},"finish_reason":null}],"usage":null,"obfuscation":"5nFqfZU9QCqvhfr"} + data: {"id":"chatcmpl-CLuSFyawhtMWhuXjg9AaPJpOzQ9QN","object":"chat.completion.chunk","created":1759337935,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"/"}}]},"finish_reason":null}],"usage":null,"obfuscation":"DsZZJLNR1fbKCNk"} - data: {"id":"chatcmpl-CLu7uWiFBqVfH6beGAI4cMCcwBSag","object":"chat.completion.chunk","created":1759336674,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"tmp"}}]},"finish_reason":null}],"usage":null,"obfuscation":"J69cVqRttm1XlFz"} + data: {"id":"chatcmpl-CLuSFyawhtMWhuXjg9AaPJpOzQ9QN","object":"chat.completion.chunk","created":1759337935,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"tmp"}}]},"finish_reason":null}],"usage":null,"obfuscation":"it3bzlbzd4n9AMP"} - data: {"id":"chatcmpl-CLu7uWiFBqVfH6beGAI4cMCcwBSag","object":"chat.completion.chunk","created":1759336674,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/cr"}}]},"finish_reason":null}],"usage":null,"obfuscation":"v1PnOZ7bLqkwp1w"} + data: {"id":"chatcmpl-CLuSFyawhtMWhuXjg9AaPJpOzQ9QN","object":"chat.completion.chunk","created":1759337935,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/cr"}}]},"finish_reason":null}],"usage":null,"obfuscation":"7EazIzcjOcE7RqP"} - data: {"id":"chatcmpl-CLu7uWiFBqVfH6beGAI4cMCcwBSag","object":"chat.completion.chunk","created":1759336674,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ush"}}]},"finish_reason":null}],"usage":null,"obfuscation":"ogVJgahQVLIsWSP"} + data: {"id":"chatcmpl-CLuSFyawhtMWhuXjg9AaPJpOzQ9QN","object":"chat.completion.chunk","created":1759337935,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ush"}}]},"finish_reason":null}],"usage":null,"obfuscation":"TzmtFThoib00wkP"} - data: {"id":"chatcmpl-CLu7uWiFBqVfH6beGAI4cMCcwBSag","object":"chat.completion.chunk","created":1759336674,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"-test"}}]},"finish_reason":null}],"usage":null,"obfuscation":"IVAz6jS7txSQS"} + data: {"id":"chatcmpl-CLuSFyawhtMWhuXjg9AaPJpOzQ9QN","object":"chat.completion.chunk","created":1759337935,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"-test"}}]},"finish_reason":null}],"usage":null,"obfuscation":"UoKvKGvq5AxAM"} - data: {"id":"chatcmpl-CLu7uWiFBqVfH6beGAI4cMCcwBSag","object":"chat.completion.chunk","created":1759336674,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/Test"}}]},"finish_reason":null}],"usage":null,"obfuscation":"JPANpjQ9w1vdS"} + data: {"id":"chatcmpl-CLuSFyawhtMWhuXjg9AaPJpOzQ9QN","object":"chat.completion.chunk","created":1759337935,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/Test"}}]},"finish_reason":null}],"usage":null,"obfuscation":"zcuN1gBoYGuRg"} - data: {"id":"chatcmpl-CLu7uWiFBqVfH6beGAI4cMCcwBSag","object":"chat.completion.chunk","created":1759336674,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Coder"}}]},"finish_reason":null}],"usage":null,"obfuscation":"NoREzLYSpDreK"} + data: {"id":"chatcmpl-CLuSFyawhtMWhuXjg9AaPJpOzQ9QN","object":"chat.completion.chunk","created":1759337935,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Coder"}}]},"finish_reason":null}],"usage":null,"obfuscation":"aW5U6sup4PAgC"} - data: {"id":"chatcmpl-CLu7uWiFBqVfH6beGAI4cMCcwBSag","object":"chat.completion.chunk","created":1759336674,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Agent"}}]},"finish_reason":null}],"usage":null,"obfuscation":"jru2WQdKatSPh"} + data: {"id":"chatcmpl-CLuSFyawhtMWhuXjg9AaPJpOzQ9QN","object":"chat.completion.chunk","created":1759337935,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Agent"}}]},"finish_reason":null}],"usage":null,"obfuscation":"tAkIiCmIRoYpm"} - data: {"id":"chatcmpl-CLu7uWiFBqVfH6beGAI4cMCcwBSag","object":"chat.completion.chunk","created":1759336674,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/open"}}]},"finish_reason":null}],"usage":null,"obfuscation":"eS1W9ZbY6nNWY"} + data: {"id":"chatcmpl-CLuSFyawhtMWhuXjg9AaPJpOzQ9QN","object":"chat.completion.chunk","created":1759337935,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/open"}}]},"finish_reason":null}],"usage":null,"obfuscation":"nmfhiO2PC9KLo"} - data: {"id":"chatcmpl-CLu7uWiFBqVfH6beGAI4cMCcwBSag","object":"chat.completion.chunk","created":1759336674,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ai"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuSFyawhtMWhuXjg9AaPJpOzQ9QN","object":"chat.completion.chunk","created":1759337935,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ai"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLu7uWiFBqVfH6beGAI4cMCcwBSag","object":"chat.completion.chunk","created":1759336674,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"-g"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuSFyawhtMWhuXjg9AaPJpOzQ9QN","object":"chat.completion.chunk","created":1759337935,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"-g"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLu7uWiFBqVfH6beGAI4cMCcwBSag","object":"chat.completion.chunk","created":1759336674,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"pt"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuSFyawhtMWhuXjg9AaPJpOzQ9QN","object":"chat.completion.chunk","created":1759337935,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"pt"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLu7uWiFBqVfH6beGAI4cMCcwBSag","object":"chat.completion.chunk","created":1759336674,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"-"}}]},"finish_reason":null}],"usage":null,"obfuscation":"3"} + data: {"id":"chatcmpl-CLuSFyawhtMWhuXjg9AaPJpOzQ9QN","object":"chat.completion.chunk","created":1759337935,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"-"}}]},"finish_reason":null}],"usage":null,"obfuscation":"k"} - data: {"id":"chatcmpl-CLu7uWiFBqVfH6beGAI4cMCcwBSag","object":"chat.completion.chunk","created":1759336674,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"5"}}]},"finish_reason":null}],"usage":null,"obfuscation":"l"} + data: {"id":"chatcmpl-CLuSFyawhtMWhuXjg9AaPJpOzQ9QN","object":"chat.completion.chunk","created":1759337935,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"5"}}]},"finish_reason":null}],"usage":null,"obfuscation":"U"} - data: {"id":"chatcmpl-CLu7uWiFBqVfH6beGAI4cMCcwBSag","object":"chat.completion.chunk","created":1759336674,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/read"}}]},"finish_reason":null}],"usage":null,"obfuscation":"SmLLpu340xxVn"} + data: {"id":"chatcmpl-CLuSFyawhtMWhuXjg9AaPJpOzQ9QN","object":"chat.completion.chunk","created":1759337935,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/read"}}]},"finish_reason":null}],"usage":null,"obfuscation":"N0GsCLBga2Vv3"} - data: {"id":"chatcmpl-CLu7uWiFBqVfH6beGAI4cMCcwBSag","object":"chat.completion.chunk","created":1759336674,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_a"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuSFyawhtMWhuXjg9AaPJpOzQ9QN","object":"chat.completion.chunk","created":1759337935,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_a"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLu7uWiFBqVfH6beGAI4cMCcwBSag","object":"chat.completion.chunk","created":1759336674,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_file"}}]},"finish_reason":null}],"usage":null,"obfuscation":"2n3nytVbMocIs"} + data: {"id":"chatcmpl-CLuSFyawhtMWhuXjg9AaPJpOzQ9QN","object":"chat.completion.chunk","created":1759337935,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_file"}}]},"finish_reason":null}],"usage":null,"obfuscation":"JAduu7pEoLm8i"} - data: {"id":"chatcmpl-CLu7uWiFBqVfH6beGAI4cMCcwBSag","object":"chat.completion.chunk","created":1759336674,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/go"}}]},"finish_reason":null}],"usage":null,"obfuscation":"TcbtgoHpgQio8KG"} + data: {"id":"chatcmpl-CLuSFyawhtMWhuXjg9AaPJpOzQ9QN","object":"chat.completion.chunk","created":1759337935,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/go"}}]},"finish_reason":null}],"usage":null,"obfuscation":"l7NZBwTVhuiwMsp"} - data: {"id":"chatcmpl-CLu7uWiFBqVfH6beGAI4cMCcwBSag","object":"chat.completion.chunk","created":1759336674,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":".mod"}}]},"finish_reason":null}],"usage":null,"obfuscation":"68TjtNn6PUtXSj"} + data: {"id":"chatcmpl-CLuSFyawhtMWhuXjg9AaPJpOzQ9QN","object":"chat.completion.chunk","created":1759337935,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":".mod"}}]},"finish_reason":null}],"usage":null,"obfuscation":"sBChcoVs9hIj3Z"} - data: {"id":"chatcmpl-CLu7uWiFBqVfH6beGAI4cMCcwBSag","object":"chat.completion.chunk","created":1759336674,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"}"}}]},"finish_reason":null}],"usage":null,"obfuscation":"YeV129mpCgQoSQV"} + data: {"id":"chatcmpl-CLuSFyawhtMWhuXjg9AaPJpOzQ9QN","object":"chat.completion.chunk","created":1759337935,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"}"}}]},"finish_reason":null}],"usage":null,"obfuscation":"EscI9Gb5ggEF7Vj"} - data: {"id":"chatcmpl-CLu7uWiFBqVfH6beGAI4cMCcwBSag","object":"chat.completion.chunk","created":1759336674,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"tool_calls"}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuSFyawhtMWhuXjg9AaPJpOzQ9QN","object":"chat.completion.chunk","created":1759337935,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"tool_calls"}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLu7uWiFBqVfH6beGAI4cMCcwBSag","object":"chat.completion.chunk","created":1759336674,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6592,"completion_tokens":35,"total_tokens":6627,"prompt_tokens_details":{"cached_tokens":6528,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"huxN"} + data: {"id":"chatcmpl-CLuSFyawhtMWhuXjg9AaPJpOzQ9QN","object":"chat.completion.chunk","created":1759337935,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6602,"completion_tokens":35,"total_tokens":6637,"prompt_tokens_details":{"cached_tokens":6528,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"Hhj2"} data: [DONE] @@ -181,15 +183,15 @@ interactions: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 2.067220333s + duration: 2.002052584s - id: 3 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 31206 + content_length: 31279 host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/read_a_file\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"Read the go mod\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"call_XhvBWJymqHr9xxKBxiAs8hdb\",\"function\":{\"arguments\":\"{\\\"pattern\\\":\\\"**/go.mod\\\"}\",\"name\":\"glob\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"/tmp/crush-test/TestCoderAgent/openai-gpt-5/read_a_file/go.mod\",\"tool_call_id\":\"call_XhvBWJymqHr9xxKBxiAs8hdb\",\"role\":\"tool\"},{\"tool_calls\":[{\"id\":\"call_0fuOzbk15naiGpIYRvUpnw2x\",\"function\":{\"arguments\":\"{\\\"file_path\\\":\\\"/tmp/crush-test/TestCoderAgent/openai-gpt-5/read_a_file/go.mod\\\"}\",\"name\":\"view\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"\\n 1|module example.com/testproject\\n 2|\\n 3|go 1.23\\n\\n\",\"tool_call_id\":\"call_0fuOzbk15naiGpIYRvUpnw2x\",\"role\":\"tool\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/read_a_file\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"Read the go mod\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"call_IBloOUdPjpwlA4bROOw1HRdL\",\"function\":{\"arguments\":\"{\\\"pattern\\\":\\\"**/go.mod\\\"}\",\"name\":\"glob\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"/tmp/crush-test/TestCoderAgent/openai-gpt-5/read_a_file/go.mod\",\"tool_call_id\":\"call_IBloOUdPjpwlA4bROOw1HRdL\",\"role\":\"tool\"},{\"tool_calls\":[{\"id\":\"call_ZQl29pbi6rOX8hCZA2hC0Zwr\",\"function\":{\"arguments\":\"{\\\"file_path\\\":\\\"/tmp/crush-test/TestCoderAgent/openai-gpt-5/read_a_file/go.mod\\\"}\",\"name\":\"view\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"\\n 1|module example.com/testproject\\n 2|\\n 3|go 1.23\\n\\n\",\"tool_call_id\":\"call_ZQl29pbi6rOX8hCZA2hC0Zwr\",\"role\":\"tool\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" headers: Accept: - application/json @@ -205,41 +207,33 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"chatcmpl-CLu7xEzNiSkNATlsRvzQrP4XrRkjv","object":"chat.completion.chunk","created":1759336677,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"5zZiSRx7NN"} - - data: {"id":"chatcmpl-CLu7xEzNiSkNATlsRvzQrP4XrRkjv","object":"chat.completion.chunk","created":1759336677,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"``"},"finish_reason":null}],"usage":null,"obfuscation":"eX0iXghzX5"} - - data: {"id":"chatcmpl-CLu7xEzNiSkNATlsRvzQrP4XrRkjv","object":"chat.completion.chunk","created":1759336677,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"`\n"},"finish_reason":null}],"usage":null,"obfuscation":"jVWfob4jt"} - - data: {"id":"chatcmpl-CLu7xEzNiSkNATlsRvzQrP4XrRkjv","object":"chat.completion.chunk","created":1759336677,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"module"},"finish_reason":null}],"usage":null,"obfuscation":"wHOdl5"} - - data: {"id":"chatcmpl-CLu7xEzNiSkNATlsRvzQrP4XrRkjv","object":"chat.completion.chunk","created":1759336677,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" example"},"finish_reason":null}],"usage":null,"obfuscation":"0QxS"} + data: {"id":"chatcmpl-CLuSH5oe8WtdsNT0bLxoKZMeIENXi","object":"chat.completion.chunk","created":1759337937,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"U2Xv7W0KDJ"} - data: {"id":"chatcmpl-CLu7xEzNiSkNATlsRvzQrP4XrRkjv","object":"chat.completion.chunk","created":1759336677,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":".com"},"finish_reason":null}],"usage":null,"obfuscation":"UKNSvfiY"} + data: {"id":"chatcmpl-CLuSH5oe8WtdsNT0bLxoKZMeIENXi","object":"chat.completion.chunk","created":1759337937,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"module"},"finish_reason":null}],"usage":null,"obfuscation":"bXqxZF"} - data: {"id":"chatcmpl-CLu7xEzNiSkNATlsRvzQrP4XrRkjv","object":"chat.completion.chunk","created":1759336677,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"/test"},"finish_reason":null}],"usage":null,"obfuscation":"lC5kFqH"} + data: {"id":"chatcmpl-CLuSH5oe8WtdsNT0bLxoKZMeIENXi","object":"chat.completion.chunk","created":1759337937,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" example"},"finish_reason":null}],"usage":null,"obfuscation":"LnTw"} - data: {"id":"chatcmpl-CLu7xEzNiSkNATlsRvzQrP4XrRkjv","object":"chat.completion.chunk","created":1759336677,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"project"},"finish_reason":null}],"usage":null,"obfuscation":"RIIS9"} + data: {"id":"chatcmpl-CLuSH5oe8WtdsNT0bLxoKZMeIENXi","object":"chat.completion.chunk","created":1759337937,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":".com"},"finish_reason":null}],"usage":null,"obfuscation":"DUPiSZp0"} - data: {"id":"chatcmpl-CLu7xEzNiSkNATlsRvzQrP4XrRkjv","object":"chat.completion.chunk","created":1759336677,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"\n\n"},"finish_reason":null}],"usage":null,"obfuscation":"eON47DEN"} + data: {"id":"chatcmpl-CLuSH5oe8WtdsNT0bLxoKZMeIENXi","object":"chat.completion.chunk","created":1759337937,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"/test"},"finish_reason":null}],"usage":null,"obfuscation":"teoZhjK"} - data: {"id":"chatcmpl-CLu7xEzNiSkNATlsRvzQrP4XrRkjv","object":"chat.completion.chunk","created":1759336677,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"go"},"finish_reason":null}],"usage":null,"obfuscation":"9l3qMr5fCY"} + data: {"id":"chatcmpl-CLuSH5oe8WtdsNT0bLxoKZMeIENXi","object":"chat.completion.chunk","created":1759337937,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"project"},"finish_reason":null}],"usage":null,"obfuscation":"qAbbU"} - data: {"id":"chatcmpl-CLu7xEzNiSkNATlsRvzQrP4XrRkjv","object":"chat.completion.chunk","created":1759336677,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" "},"finish_reason":null}],"usage":null,"obfuscation":"eN5baMH7XoE"} + data: {"id":"chatcmpl-CLuSH5oe8WtdsNT0bLxoKZMeIENXi","object":"chat.completion.chunk","created":1759337937,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"\n\n"},"finish_reason":null}],"usage":null,"obfuscation":"e0RSm4Kn"} - data: {"id":"chatcmpl-CLu7xEzNiSkNATlsRvzQrP4XrRkjv","object":"chat.completion.chunk","created":1759336677,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"1"},"finish_reason":null}],"usage":null,"obfuscation":"O0bt8aQYWA9"} + data: {"id":"chatcmpl-CLuSH5oe8WtdsNT0bLxoKZMeIENXi","object":"chat.completion.chunk","created":1759337937,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"go"},"finish_reason":null}],"usage":null,"obfuscation":"Snj3zCTS0n"} - data: {"id":"chatcmpl-CLu7xEzNiSkNATlsRvzQrP4XrRkjv","object":"chat.completion.chunk","created":1759336677,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"."},"finish_reason":null}],"usage":null,"obfuscation":"unYmIxt2663"} + data: {"id":"chatcmpl-CLuSH5oe8WtdsNT0bLxoKZMeIENXi","object":"chat.completion.chunk","created":1759337937,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" "},"finish_reason":null}],"usage":null,"obfuscation":"g0UpcohFNuB"} - data: {"id":"chatcmpl-CLu7xEzNiSkNATlsRvzQrP4XrRkjv","object":"chat.completion.chunk","created":1759336677,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"23"},"finish_reason":null}],"usage":null,"obfuscation":"7KxpldtI5q"} + data: {"id":"chatcmpl-CLuSH5oe8WtdsNT0bLxoKZMeIENXi","object":"chat.completion.chunk","created":1759337937,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"1"},"finish_reason":null}],"usage":null,"obfuscation":"Ge0URtuP9OG"} - data: {"id":"chatcmpl-CLu7xEzNiSkNATlsRvzQrP4XrRkjv","object":"chat.completion.chunk","created":1759336677,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"\n"},"finish_reason":null}],"usage":null,"obfuscation":"fmWvM7SNYF"} + data: {"id":"chatcmpl-CLuSH5oe8WtdsNT0bLxoKZMeIENXi","object":"chat.completion.chunk","created":1759337937,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"."},"finish_reason":null}],"usage":null,"obfuscation":"RCIXjr2wRfH"} - data: {"id":"chatcmpl-CLu7xEzNiSkNATlsRvzQrP4XrRkjv","object":"chat.completion.chunk","created":1759336677,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"```"},"finish_reason":null}],"usage":null,"obfuscation":"3XVE6c5xq"} + data: {"id":"chatcmpl-CLuSH5oe8WtdsNT0bLxoKZMeIENXi","object":"chat.completion.chunk","created":1759337937,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"23"},"finish_reason":null}],"usage":null,"obfuscation":"e4cjunwbtQ"} - data: {"id":"chatcmpl-CLu7xEzNiSkNATlsRvzQrP4XrRkjv","object":"chat.completion.chunk","created":1759336677,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"stop"}],"usage":null,"obfuscation":"NSs4oC"} + data: {"id":"chatcmpl-CLuSH5oe8WtdsNT0bLxoKZMeIENXi","object":"chat.completion.chunk","created":1759337937,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"stop"}],"usage":null,"obfuscation":"cPHPxX"} - data: {"id":"chatcmpl-CLu7xEzNiSkNATlsRvzQrP4XrRkjv","object":"chat.completion.chunk","created":1759336677,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6667,"completion_tokens":280,"total_tokens":6947,"prompt_tokens_details":{"cached_tokens":6528,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":256,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"u"} + data: {"id":"chatcmpl-CLuSH5oe8WtdsNT0bLxoKZMeIENXi","object":"chat.completion.chunk","created":1759337937,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6677,"completion_tokens":14,"total_tokens":6691,"prompt_tokens_details":{"cached_tokens":6528,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"ugCK"} data: [DONE] @@ -248,4 +242,4 @@ interactions: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 6.960292125s + duration: 1.704012666s diff --git a/internal/agent/testdata/TestCoderAgent/openai-gpt-5/simple_test.yaml b/internal/agent/testdata/TestCoderAgent/openai-gpt-5/simple_test.yaml index 93016955359fb026ecea0d20e29cd8b9ee1fdf0e..d179c8e351a3502a1de5bc7080770d076a7f90f1 100644 --- a/internal/agent/testdata/TestCoderAgent/openai-gpt-5/simple_test.yaml +++ b/internal/agent/testdata/TestCoderAgent/openai-gpt-5/simple_test.yaml @@ -24,21 +24,15 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"chatcmpl-CLu7iJ2epqtUtw0q9nV0rw1xoI03e","object":"chat.completion.chunk","created":1759336662,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"VDsfpRWfe0FLMX"} + data: {"id":"chatcmpl-CLuS4afB0SlAAOlopNkopx3sMvN5Z","object":"chat.completion.chunk","created":1759337924,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"PHKFxWqtOPkKuE"} - data: {"id":"chatcmpl-CLu7iJ2epqtUtw0q9nV0rw1xoI03e","object":"chat.completion.chunk","created":1759336662,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"User"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"zwitqOr2gea7"} + data: {"id":"chatcmpl-CLuS4afB0SlAAOlopNkopx3sMvN5Z","object":"chat.completion.chunk","created":1759337924,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"Greeting"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"xLEq8RFJ"} - data: {"id":"chatcmpl-CLu7iJ2epqtUtw0q9nV0rw1xoI03e","object":"chat.completion.chunk","created":1759336662,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Gre"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"4x3mhBf7Oi94"} + data: {"id":"chatcmpl-CLuS4afB0SlAAOlopNkopx3sMvN5Z","object":"chat.completion.chunk","created":1759337924,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Message"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"NWa1e0e5"} - data: {"id":"chatcmpl-CLu7iJ2epqtUtw0q9nV0rw1xoI03e","object":"chat.completion.chunk","created":1759336662,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"ets"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"nmoEu1r6oSgMB"} + data: {"id":"chatcmpl-CLuS4afB0SlAAOlopNkopx3sMvN5Z","object":"chat.completion.chunk","created":1759337924,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"8r7PsOEws3"} - data: {"id":"chatcmpl-CLu7iJ2epqtUtw0q9nV0rw1xoI03e","object":"chat.completion.chunk","created":1759336662,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" with"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"eyxHKqqVlpz"} - - data: {"id":"chatcmpl-CLu7iJ2epqtUtw0q9nV0rw1xoI03e","object":"chat.completion.chunk","created":1759336662,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Hello"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"YeVcT2U9r3"} - - data: {"id":"chatcmpl-CLu7iJ2epqtUtw0q9nV0rw1xoI03e","object":"chat.completion.chunk","created":1759336662,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"dHmBEsM3SQ"} - - data: {"id":"chatcmpl-CLu7iJ2epqtUtw0q9nV0rw1xoI03e","object":"chat.completion.chunk","created":1759336662,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[],"usage":{"prompt_tokens":109,"completion_tokens":5,"total_tokens":114,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"OrjqNvO9bGU83L"} + data: {"id":"chatcmpl-CLuS4afB0SlAAOlopNkopx3sMvN5Z","object":"chat.completion.chunk","created":1759337924,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[],"usage":{"prompt_tokens":109,"completion_tokens":2,"total_tokens":111,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"WUEtTLOIl6oDVS"} data: [DONE] @@ -47,15 +41,15 @@ interactions: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 1.34329025s + duration: 873.67075ms - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 30522 + content_length: 30595 host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/simple_test\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"Hello\",\"role\":\"user\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/simple_test\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"Hello\",\"role\":\"user\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" headers: Accept: - application/json @@ -71,13 +65,13 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"chatcmpl-CLu7iRTNnQEPi0J6RuXqvh7yUD6lx","object":"chat.completion.chunk","created":1759336662,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"F6rV71bzju"} + data: {"id":"chatcmpl-CLuS4d9hEMvNUeVKdtr3UzHi2isZm","object":"chat.completion.chunk","created":1759337924,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"7Hx9U6PJv7"} - data: {"id":"chatcmpl-CLu7iRTNnQEPi0J6RuXqvh7yUD6lx","object":"chat.completion.chunk","created":1759336662,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"Hi"},"finish_reason":null}],"usage":null,"obfuscation":"Da2Di3GeMZ"} + data: {"id":"chatcmpl-CLuS4d9hEMvNUeVKdtr3UzHi2isZm","object":"chat.completion.chunk","created":1759337924,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"Hi"},"finish_reason":null}],"usage":null,"obfuscation":"shZCApUv2g"} - data: {"id":"chatcmpl-CLu7iRTNnQEPi0J6RuXqvh7yUD6lx","object":"chat.completion.chunk","created":1759336662,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"stop"}],"usage":null,"obfuscation":"3nyqHX"} + data: {"id":"chatcmpl-CLuS4d9hEMvNUeVKdtr3UzHi2isZm","object":"chat.completion.chunk","created":1759337924,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"stop"}],"usage":null,"obfuscation":"xOU4Da"} - data: {"id":"chatcmpl-CLu7iRTNnQEPi0J6RuXqvh7yUD6lx","object":"chat.completion.chunk","created":1759336662,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6541,"completion_tokens":10,"total_tokens":6551,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"ZVYjv0t"} + data: {"id":"chatcmpl-CLuS4d9hEMvNUeVKdtr3UzHi2isZm","object":"chat.completion.chunk","created":1759337924,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6551,"completion_tokens":10,"total_tokens":6561,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"O4zmVVq"} data: [DONE] @@ -86,4 +80,4 @@ interactions: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 5.849920667s + duration: 3.195741s diff --git a/internal/agent/testdata/TestCoderAgent/openai-gpt-5/sourcegraph_tool.yaml b/internal/agent/testdata/TestCoderAgent/openai-gpt-5/sourcegraph_tool.yaml index 0f916863a20c4395c750019806c0ef3f9a8d7fe3..d3b71b76850d99635faccd6b0aadc603e6602115 100644 --- a/internal/agent/testdata/TestCoderAgent/openai-gpt-5/sourcegraph_tool.yaml +++ b/internal/agent/testdata/TestCoderAgent/openai-gpt-5/sourcegraph_tool.yaml @@ -24,37 +24,35 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"chatcmpl-CLuB5GFZakNK17t7puN4gpJtvHfOL","object":"chat.completion.chunk","created":1759336871,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"3jhaXGNBLPHRLM"} + data: {"id":"chatcmpl-CLuUk66HwZGrIlaH24d8JVqb4J4GH","object":"chat.completion.chunk","created":1759338090,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"im6NCWyq50riyo"} - data: {"id":"chatcmpl-CLuB5GFZakNK17t7puN4gpJtvHfOL","object":"chat.completion.chunk","created":1759336871,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":"Using"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"roqZwXpIUay"} + data: {"id":"chatcmpl-CLuUk66HwZGrIlaH24d8JVqb4J4GH","object":"chat.completion.chunk","created":1759338090,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":"Searching"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"ZdYgPOX"} - data: {"id":"chatcmpl-CLuB5GFZakNK17t7puN4gpJtvHfOL","object":"chat.completion.chunk","created":1759336871,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":" Source"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"B2r9cabFg"} + data: {"id":"chatcmpl-CLuUk66HwZGrIlaH24d8JVqb4J4GH","object":"chat.completion.chunk","created":1759338090,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":" '"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"9Y2OXllnrK8pyO"} - data: {"id":"chatcmpl-CLuB5GFZakNK17t7puN4gpJtvHfOL","object":"chat.completion.chunk","created":1759336871,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":"graph"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"CsVUBFQORNI"} + data: {"id":"chatcmpl-CLuUk66HwZGrIlaH24d8JVqb4J4GH","object":"chat.completion.chunk","created":1759338090,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":"func"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"hAYvtC1XnFwQ"} - data: {"id":"chatcmpl-CLuB5GFZakNK17t7puN4gpJtvHfOL","object":"chat.completion.chunk","created":1759336871,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":" to"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"mdmU48DrNILTu"} + data: {"id":"chatcmpl-CLuUk66HwZGrIlaH24d8JVqb4J4GH","object":"chat.completion.chunk","created":1759338090,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":" main"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"bYbRi1ylH31"} - data: {"id":"chatcmpl-CLuB5GFZakNK17t7puN4gpJtvHfOL","object":"chat.completion.chunk","created":1759336871,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":" Find"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"DyEMbuYgknM"} + data: {"id":"chatcmpl-CLuUk66HwZGrIlaH24d8JVqb4J4GH","object":"chat.completion.chunk","created":1759338090,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":"'"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"JojQOMoP5ZswCW3"} - data: {"id":"chatcmpl-CLuB5GFZakNK17t7puN4gpJtvHfOL","object":"chat.completion.chunk","created":1759336871,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":" '"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"UUhX3m9yv0K9aB"} + data: {"id":"chatcmpl-CLuUk66HwZGrIlaH24d8JVqb4J4GH","object":"chat.completion.chunk","created":1759338090,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":" in"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"nuxsDO5B9ewAb"} - data: {"id":"chatcmpl-CLuB5GFZakNK17t7puN4gpJtvHfOL","object":"chat.completion.chunk","created":1759336871,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":"func"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"WJ5kszvaOCkg"} + data: {"id":"chatcmpl-CLuUk66HwZGrIlaH24d8JVqb4J4GH","object":"chat.completion.chunk","created":1759338090,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":" Go"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"KgYm89u0kbEVb"} - data: {"id":"chatcmpl-CLuB5GFZakNK17t7puN4gpJtvHfOL","object":"chat.completion.chunk","created":1759336871,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":" main"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"iIQH5dsA2rG"} + data: {"id":"chatcmpl-CLuUk66HwZGrIlaH24d8JVqb4J4GH","object":"chat.completion.chunk","created":1759338090,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":" Re"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"qarOV6uf5jpr0"} - data: {"id":"chatcmpl-CLuB5GFZakNK17t7puN4gpJtvHfOL","object":"chat.completion.chunk","created":1759336871,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":"'"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"ESt7VceQvv5pg7H"} + data: {"id":"chatcmpl-CLuUk66HwZGrIlaH24d8JVqb4J4GH","object":"chat.completion.chunk","created":1759338090,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":"positories"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"f5Hj8I"} - data: {"id":"chatcmpl-CLuB5GFZakNK17t7puN4gpJtvHfOL","object":"chat.completion.chunk","created":1759336871,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":" in"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"HcRNamfiVGwgK"} + data: {"id":"chatcmpl-CLuUk66HwZGrIlaH24d8JVqb4J4GH","object":"chat.completion.chunk","created":1759338090,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":" with"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"QarxldhD9i5"} - data: {"id":"chatcmpl-CLuB5GFZakNK17t7puN4gpJtvHfOL","object":"chat.completion.chunk","created":1759336871,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":" Go"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"9C7r1jiXqfmNg"} + data: {"id":"chatcmpl-CLuUk66HwZGrIlaH24d8JVqb4J4GH","object":"chat.completion.chunk","created":1759338090,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":" Source"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"zrNOGWiGX"} - data: {"id":"chatcmpl-CLuB5GFZakNK17t7puN4gpJtvHfOL","object":"chat.completion.chunk","created":1759336871,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":" Re"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"OssMg1mV7j1Ih"} + data: {"id":"chatcmpl-CLuUk66HwZGrIlaH24d8JVqb4J4GH","object":"chat.completion.chunk","created":1759338090,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":"graph"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"MI6fb9krpyJ"} - data: {"id":"chatcmpl-CLuB5GFZakNK17t7puN4gpJtvHfOL","object":"chat.completion.chunk","created":1759336871,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{"content":"pos"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"3zyxA44glVE7H"} + data: {"id":"chatcmpl-CLuUk66HwZGrIlaH24d8JVqb4J4GH","object":"chat.completion.chunk","created":1759338090,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"rkO4fMIlH7"} - data: {"id":"chatcmpl-CLuB5GFZakNK17t7puN4gpJtvHfOL","object":"chat.completion.chunk","created":1759336871,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"XvfHISbPW1"} - - data: {"id":"chatcmpl-CLuB5GFZakNK17t7puN4gpJtvHfOL","object":"chat.completion.chunk","created":1759336871,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[],"usage":{"prompt_tokens":121,"completion_tokens":13,"total_tokens":134,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"zFQdYTxYqVTmo"} + data: {"id":"chatcmpl-CLuUk66HwZGrIlaH24d8JVqb4J4GH","object":"chat.completion.chunk","created":1759338090,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_1827dd0c55","choices":[],"usage":{"prompt_tokens":121,"completion_tokens":12,"total_tokens":133,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"3KpnvLPqXmNwc"} data: [DONE] @@ -63,15 +61,15 @@ interactions: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 599.140458ms + duration: 546.357ms - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 30582 + content_length: 30655 host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/sourcegraph_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use sourcegraph to search for 'func main' in Go repositories\",\"role\":\"user\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/sourcegraph_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use sourcegraph to search for 'func main' in Go repositories\",\"role\":\"user\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" headers: Accept: - application/json @@ -87,55 +85,57 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"chatcmpl-CLuB58oG2hAWdS5UCGdsSb4JO4Iht","object":"chat.completion.chunk","created":1759336871,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"call_WcfEj9DQooqbUVduTRrsTR4k","type":"function","function":{"name":"sourcegraph","arguments":""}}],"refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"Z4gUN"} + data: {"id":"chatcmpl-CLuUkGwV3dcSX6yWzhpwvrYn0zoNo","object":"chat.completion.chunk","created":1759338090,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"call_Gb0N6CATgy5P2XAarqc2RAlt","type":"function","function":{"name":"sourcegraph","arguments":""}}],"refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"jD3gK"} + + data: {"id":"chatcmpl-CLuUkGwV3dcSX6yWzhpwvrYn0zoNo","object":"chat.completion.chunk","created":1759338090,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"mUWIsVpwAIjuwUq"} - data: {"id":"chatcmpl-CLuB58oG2hAWdS5UCGdsSb4JO4Iht","object":"chat.completion.chunk","created":1759336871,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"ZzPGsxzSXSO5TDQ"} + data: {"id":"chatcmpl-CLuUkGwV3dcSX6yWzhpwvrYn0zoNo","object":"chat.completion.chunk","created":1759338090,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"query"}}]},"finish_reason":null}],"usage":null,"obfuscation":"nXoXny8SzO7FP"} - data: {"id":"chatcmpl-CLuB58oG2hAWdS5UCGdsSb4JO4Iht","object":"chat.completion.chunk","created":1759336871,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"query"}}]},"finish_reason":null}],"usage":null,"obfuscation":"sxB22b0dE0p0g"} + data: {"id":"chatcmpl-CLuUkGwV3dcSX6yWzhpwvrYn0zoNo","object":"chat.completion.chunk","created":1759338090,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"1tZxY9WDI4f28"} - data: {"id":"chatcmpl-CLuB58oG2hAWdS5UCGdsSb4JO4Iht","object":"chat.completion.chunk","created":1759336871,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"NQDcLtw9ROusT"} + data: {"id":"chatcmpl-CLuUkGwV3dcSX6yWzhpwvrYn0zoNo","object":"chat.completion.chunk","created":1759338090,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"lang"}}]},"finish_reason":null}],"usage":null,"obfuscation":"NGFwVcO3ivYOHO"} - data: {"id":"chatcmpl-CLuB58oG2hAWdS5UCGdsSb4JO4Iht","object":"chat.completion.chunk","created":1759336871,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"lang"}}]},"finish_reason":null}],"usage":null,"obfuscation":"O9dsJnAuiFGsNp"} + data: {"id":"chatcmpl-CLuUkGwV3dcSX6yWzhpwvrYn0zoNo","object":"chat.completion.chunk","created":1759338090,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":":"}}]},"finish_reason":null}],"usage":null,"obfuscation":"u"} - data: {"id":"chatcmpl-CLuB58oG2hAWdS5UCGdsSb4JO4Iht","object":"chat.completion.chunk","created":1759336871,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":":"}}]},"finish_reason":null}],"usage":null,"obfuscation":"H"} + data: {"id":"chatcmpl-CLuUkGwV3dcSX6yWzhpwvrYn0zoNo","object":"chat.completion.chunk","created":1759338090,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"go"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLuB58oG2hAWdS5UCGdsSb4JO4Iht","object":"chat.completion.chunk","created":1759336871,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"go"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuUkGwV3dcSX6yWzhpwvrYn0zoNo","object":"chat.completion.chunk","created":1759338090,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" \\\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"Nz4AQI6bFNdOF"} - data: {"id":"chatcmpl-CLuB58oG2hAWdS5UCGdsSb4JO4Iht","object":"chat.completion.chunk","created":1759336871,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" \\\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"iJhvNpGxVScKs"} + data: {"id":"chatcmpl-CLuUkGwV3dcSX6yWzhpwvrYn0zoNo","object":"chat.completion.chunk","created":1759338090,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"func"}}]},"finish_reason":null}],"usage":null,"obfuscation":"Mgw3tzQsBDwYhC"} - data: {"id":"chatcmpl-CLuB58oG2hAWdS5UCGdsSb4JO4Iht","object":"chat.completion.chunk","created":1759336871,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"func"}}]},"finish_reason":null}],"usage":null,"obfuscation":"RjzUWeU4W2GCvY"} + data: {"id":"chatcmpl-CLuUkGwV3dcSX6yWzhpwvrYn0zoNo","object":"chat.completion.chunk","created":1759338090,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" main"}}]},"finish_reason":null}],"usage":null,"obfuscation":"XlVr89bfqnrru"} - data: {"id":"chatcmpl-CLuB58oG2hAWdS5UCGdsSb4JO4Iht","object":"chat.completion.chunk","created":1759336871,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" main"}}]},"finish_reason":null}],"usage":null,"obfuscation":"Xl7WT8xF1rwXe"} + data: {"id":"chatcmpl-CLuUkGwV3dcSX6yWzhpwvrYn0zoNo","object":"chat.completion.chunk","created":1759338090,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\\\"\","}}]},"finish_reason":null}],"usage":null,"obfuscation":"vZFnBJdXJA3"} - data: {"id":"chatcmpl-CLuB58oG2hAWdS5UCGdsSb4JO4Iht","object":"chat.completion.chunk","created":1759336871,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\\\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"hW0yLlGHbmOBK0"} + data: {"id":"chatcmpl-CLuUkGwV3dcSX6yWzhpwvrYn0zoNo","object":"chat.completion.chunk","created":1759338090,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" \""}}]},"finish_reason":null}],"usage":null,"obfuscation":"scwEWe5iVMjGdKZ"} - data: {"id":"chatcmpl-CLuB58oG2hAWdS5UCGdsSb4JO4Iht","object":"chat.completion.chunk","created":1759336871,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" type"}}]},"finish_reason":null}],"usage":null,"obfuscation":"DgL9ohxKTn1to"} + data: {"id":"chatcmpl-CLuUkGwV3dcSX6yWzhpwvrYn0zoNo","object":"chat.completion.chunk","created":1759338090,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"count"}}]},"finish_reason":null}],"usage":null,"obfuscation":"SngFnMCLlt2H5"} - data: {"id":"chatcmpl-CLuB58oG2hAWdS5UCGdsSb4JO4Iht","object":"chat.completion.chunk","created":1759336871,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":":file"}}]},"finish_reason":null}],"usage":null,"obfuscation":"MK8X9rHMIsJog"} + data: {"id":"chatcmpl-CLuUkGwV3dcSX6yWzhpwvrYn0zoNo","object":"chat.completion.chunk","created":1759338090,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":"}}]},"finish_reason":null}],"usage":null,"obfuscation":"bfQuZS1iV5YQwYt"} - data: {"id":"chatcmpl-CLuB58oG2hAWdS5UCGdsSb4JO4Iht","object":"chat.completion.chunk","created":1759336871,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\",\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"KTj5lJ2R8Flzf"} + data: {"id":"chatcmpl-CLuUkGwV3dcSX6yWzhpwvrYn0zoNo","object":"chat.completion.chunk","created":1759338090,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" "}}]},"finish_reason":null}],"usage":null,"obfuscation":"0"} - data: {"id":"chatcmpl-CLuB58oG2hAWdS5UCGdsSb4JO4Iht","object":"chat.completion.chunk","created":1759336871,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"count"}}]},"finish_reason":null}],"usage":null,"obfuscation":"jriHOKWRzr5Qz"} + data: {"id":"chatcmpl-CLuUkGwV3dcSX6yWzhpwvrYn0zoNo","object":"chat.completion.chunk","created":1759338090,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"10"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLuB58oG2hAWdS5UCGdsSb4JO4Iht","object":"chat.completion.chunk","created":1759336871,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":"}}]},"finish_reason":null}],"usage":null,"obfuscation":"dRgIQacE7J2HlJs"} + data: {"id":"chatcmpl-CLuUkGwV3dcSX6yWzhpwvrYn0zoNo","object":"chat.completion.chunk","created":1759338090,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":","}}]},"finish_reason":null}],"usage":null,"obfuscation":"V"} - data: {"id":"chatcmpl-CLuB58oG2hAWdS5UCGdsSb4JO4Iht","object":"chat.completion.chunk","created":1759336871,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"10"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuUkGwV3dcSX6yWzhpwvrYn0zoNo","object":"chat.completion.chunk","created":1759338090,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" \""}}]},"finish_reason":null}],"usage":null,"obfuscation":"aRRAVivCbmvXfWK"} - data: {"id":"chatcmpl-CLuB58oG2hAWdS5UCGdsSb4JO4Iht","object":"chat.completion.chunk","created":1759336871,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":",\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"FyaPJTELjsZzI8R"} + data: {"id":"chatcmpl-CLuUkGwV3dcSX6yWzhpwvrYn0zoNo","object":"chat.completion.chunk","created":1759338090,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"context"}}]},"finish_reason":null}],"usage":null,"obfuscation":"WkLUKOwvtXt"} - data: {"id":"chatcmpl-CLuB58oG2hAWdS5UCGdsSb4JO4Iht","object":"chat.completion.chunk","created":1759336871,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"context"}}]},"finish_reason":null}],"usage":null,"obfuscation":"MopfRQn3fxf"} + data: {"id":"chatcmpl-CLuUkGwV3dcSX6yWzhpwvrYn0zoNo","object":"chat.completion.chunk","created":1759338090,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_window"}}]},"finish_reason":null}],"usage":null,"obfuscation":"oXRa8CiXaFn"} - data: {"id":"chatcmpl-CLuB58oG2hAWdS5UCGdsSb4JO4Iht","object":"chat.completion.chunk","created":1759336871,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_window"}}]},"finish_reason":null}],"usage":null,"obfuscation":"1apR6Z2EciG"} + data: {"id":"chatcmpl-CLuUkGwV3dcSX6yWzhpwvrYn0zoNo","object":"chat.completion.chunk","created":1759338090,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":"}}]},"finish_reason":null}],"usage":null,"obfuscation":"Qng1aicThNT1Q4v"} - data: {"id":"chatcmpl-CLuB58oG2hAWdS5UCGdsSb4JO4Iht","object":"chat.completion.chunk","created":1759336871,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":"}}]},"finish_reason":null}],"usage":null,"obfuscation":"6HR1kAmVMgSl2Ju"} + data: {"id":"chatcmpl-CLuUkGwV3dcSX6yWzhpwvrYn0zoNo","object":"chat.completion.chunk","created":1759338090,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" "}}]},"finish_reason":null}],"usage":null,"obfuscation":"U"} - data: {"id":"chatcmpl-CLuB58oG2hAWdS5UCGdsSb4JO4Iht","object":"chat.completion.chunk","created":1759336871,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"5"}}]},"finish_reason":null}],"usage":null,"obfuscation":"E"} + data: {"id":"chatcmpl-CLuUkGwV3dcSX6yWzhpwvrYn0zoNo","object":"chat.completion.chunk","created":1759338090,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"5"}}]},"finish_reason":null}],"usage":null,"obfuscation":"M"} - data: {"id":"chatcmpl-CLuB58oG2hAWdS5UCGdsSb4JO4Iht","object":"chat.completion.chunk","created":1759336871,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"}"}}]},"finish_reason":null}],"usage":null,"obfuscation":"F"} + data: {"id":"chatcmpl-CLuUkGwV3dcSX6yWzhpwvrYn0zoNo","object":"chat.completion.chunk","created":1759338090,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"}"}}]},"finish_reason":null}],"usage":null,"obfuscation":"c"} - data: {"id":"chatcmpl-CLuB58oG2hAWdS5UCGdsSb4JO4Iht","object":"chat.completion.chunk","created":1759336871,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"tool_calls"}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuUkGwV3dcSX6yWzhpwvrYn0zoNo","object":"chat.completion.chunk","created":1759338090,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"tool_calls"}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLuB58oG2hAWdS5UCGdsSb4JO4Iht","object":"chat.completion.chunk","created":1759336871,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6554,"completion_tokens":296,"total_tokens":6850,"prompt_tokens_details":{"cached_tokens":1024,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":256,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"k"} + data: {"id":"chatcmpl-CLuUkGwV3dcSX6yWzhpwvrYn0zoNo","object":"chat.completion.chunk","created":1759338090,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6564,"completion_tokens":297,"total_tokens":6861,"prompt_tokens_details":{"cached_tokens":1024,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":256,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"n"} data: [DONE] @@ -144,15 +144,15 @@ interactions: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 10.421983s + duration: 8.88866525s - id: 2 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 438 + content_length: 428 host: sourcegraph.com - body: '{"query":"query Search($query: String!) { search(query: $query, version: V2, patternType: keyword ) { results { matchCount, limitHit, resultCount, approximateResultCount, missing { name }, timedout { name }, indexUnavailable, results { __typename, ... on FileMatch { repository { name }, file { path, url, content }, lineMatches { preview, lineNumber, offsetAndLengths } } } } } }","variables":{"query":"lang:go \"func main\" type:file"}}' + body: '{"query":"query Search($query: String!) { search(query: $query, version: V2, patternType: keyword ) { results { matchCount, limitHit, resultCount, approximateResultCount, missing { name }, timedout { name }, indexUnavailable, results { __typename, ... on FileMatch { repository { name }, file { path, url, content }, lineMatches { preview, lineNumber, offsetAndLengths } } } } } }","variables":{"query":"lang:go \"func main\""}}' headers: Content-Type: - application/json @@ -166,21 +166,21 @@ interactions: proto_minor: 0 content_length: -1 uncompressed: true - body: '{"data":{"search":{"results":{"matchCount":30,"limitHit":true,"resultCount":30,"approximateResultCount":"30+","missing":[],"timedout":[],"indexUnavailable":false,"results":[{"__typename":"FileMatch","repository":{"name":"github.com/inancgumus/learngo"},"file":{"path":"translation/chinese/02-编写第一个程序/main.go","url":"/github.com/inancgumus/learngo/-/blob/translation/chinese/02-%E7%BC%96%E5%86%99%E7%AC%AC%E4%B8%80%E4%B8%AA%E7%A8%8B%E5%BA%8F/main.go","content":"// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa/4.0/\n//\n// For more tutorials : https://learngoprogramming.com\n// In-person training : https://www.linkedin.com/in/inancgumus/\n// Follow me on twitter: https://twitter.com/inancgumus\n\n// package main 是一个特殊的包\n// 它允许 Go 创建一个可执行文件\npackage main\n\n/*\n这是一个多行注释\n\nimport 关键字引入另一个包\n 对于这个 .go ”文件“\n\nimport \"fmt\" 允许你使用 fmt 包的各种函数\n 在这个文件\n*/\nimport \"fmt\"\n\n// \"func main\" 是特殊的\n//\n// Go 必须知道从哪里开始执行\n//\n// func main 对于 Go 而言就是开始执行的位置\n//\n// 代码编译后,\n// Go runtime 第一个执行该函数\nfunc main() {\n\t// import \"fmt\" 之后\n\t// \"fmt\" 包中的 Println 函数就可以使用\n\n\t// 在控制台输入下面的命令可以查看它的源代码:\n\t// go doc -src fmt Println\n\n\t// Println 是一个 exported 函数来自\n\t// \"fmt\" 包\n\n\t// Exported = 首字母大写\n\tfmt.Println(\"Hello Gopher!\")\n\n\t// Go 本身不能调用 Println 函数\n\t// 这就是为什么你需要在这里调用它\n\t// Go 只能自动地调用 `func main`\n\n\t// -----\n\n\t// Go 字符串支持 Unicode 字符\n\t// 源代码同时也支持: KÖSTEBEK!\n\t//\n\t// 因为: 字面值 ~= 源代码\n\n\t// 练习: 删除下行注释的 --\u003e //\n\t// fmt.Println(\"Merhaba Köstebek!\")\n\n\t// 不重要的注释:\n\t// \"Merhaba Köstebek\" 的意思是 \"你好 Gopher\"\n\t// 在土耳其语\n}\n"},"lineMatches":[{"preview":"// \"func main\" 是特殊的","lineNumber":23,"offsetAndLengths":[[3,11]]},{"preview":"func main() {","lineNumber":31,"offsetAndLengths":[[0,9]]},{"preview":"\t// Go 只能自动地调用 `func main`","lineNumber":46,"offsetAndLengths":[[16,9]]},{"preview":"// func main 对于 Go 而言就是开始执行的位置","lineNumber":27,"offsetAndLengths":[[3,9]]}]},{"__typename":"FileMatch","repository":{"name":"github.com/inancgumus/learngo"},"file":{"path":"first/first/main.go","url":"/github.com/inancgumus/learngo/-/blob/first/first/main.go","content":"// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa/4.0/\n//\n// For more tutorials : https://learngoprogramming.com\n// In-person training : https://www.linkedin.com/in/inancgumus/\n// Follow me on twitter: https://twitter.com/inancgumus\n\n// package main is a special package\n// it allows Go to create an executable file\npackage main\n\n/*\nThis is a multi-line comment.\n\nimport keyword makes another package available\n for this .go \"file\".\n\nimport \"fmt\" lets you access fmt package''s functionality\n here in this file.\n*/\nimport \"fmt\"\n\n// \"func main\" is special.\n//\n// Go has to know where to start\n//\n// func main creates a starting point for Go\n//\n// After compiling the code,\n// Go runtime will first run this function\nfunc main() {\n\t// after: import \"fmt\"\n\t// Println function of \"fmt\" package becomes available\n\n\t// Look at what it looks like by typing in the console:\n\t// go doc -src fmt Println\n\n\t// Println is just an exported function from\n\t// \"fmt\" package\n\n\t// Exported = First Letter is uppercase\n\tfmt.Println(\"Hello Gopher!\")\n\n\t// Go cannot call Println function by itself.\n\t// That''s why you need to call it here.\n\t// It only calls `func main` automatically.\n\n\t// -----\n\n\t// Go supports Unicode characters in string literals\n\t// And also in source-code: KÖSTEBEK!\n\n\t// EXERCISE: Remove the comments from below --\u003e //\n\t// fmt.Println(\"Merhaba Köstebek!\")\n\n\t// Unnecessary note:\n\t// \"Merhaba Köstebek\" means \"Hello Gopher\"\n\t// in Turkish language\n}\n"},"lineMatches":[{"preview":"// \"func main\" is special.","lineNumber":23,"offsetAndLengths":[[3,11]]},{"preview":"func main() {","lineNumber":31,"offsetAndLengths":[[0,9]]},{"preview":"// func main creates a starting point for Go","lineNumber":27,"offsetAndLengths":[[3,9]]},{"preview":"\t// It only calls `func main` automatically.","lineNumber":46,"offsetAndLengths":[[19,9]]}]},{"__typename":"FileMatch","repository":{"name":"github.com/inancgumus/learngo"},"file":{"path":"translation/spanish/02-tu-primer-programa/main.go","url":"/github.com/inancgumus/learngo/-/blob/translation/spanish/02-tu-primer-programa/main.go","content":"// Copyright © 2021 Inanc Gumus\n// Learn Go Programming Course\n// Licencia: https://creativecommons.org/licenses/by-nc-sa/4.0/\n//\n// Para mas tutoriales: https://learngoprogramming.com\n// Clases particulares: https://www.linkedin.com/in/inancgumus/\n// Sigueme en twitter: https://twitter.com/inancgumus\n\n// package main es un paquete especial\n// le permite a Go crear un archivo ejecutable\npackage main\n\n/*\nEsto es un comentario multilinea.\n\nla palabra import hace que otro paquete este disponible\n para este \"archivo\" .go.\n\nimport \"fmt\" te permite acceder a la funcionaliddad del paquete fmt\n en este archivo.\n*/\nimport \"fmt\"\n\n// \"func main\" es especial.\n//\n// Go tiene que saber por donde empezar\n//\n// func main crea un punto de inicio para Go\n//\n// Después de compilar el codigo,\n// Go ejecutará esta función primero.\nfunc main() {\n\t// después del: import \"fmt\"\n\t// La función Println del paquete \"fmt\" estará disponible\n\n\t// Lee sobre ella escribiendo los siguiente en la consola:\n\t// go doc -src fmt Println\n\n\t// Println es simplemente una función exportada de:\n\t// \"fmt\" package\n\n\t// Para poder exportar una función tendrás que escribir el\n\t// primer caracter del nombre de la función en mayúscula.\n\tfmt.Println(\"Hello Gopher!\")\n\n\t// Go no puede llamar a la función Println por si mismo.\n\t// Por eso la tienes que llamar aqui.\n\t// Solo llama a la `func main` de forma automatica.\n\n\t// -----\n\n\t// Go soporta caracteres unicode en cadenas de texto literal\n\t// y tambien en el codigo fuente: KÖSTEBEK!\n\t//\n\t// Porque: Literal ~= Codigo Fuente\n}\n"},"lineMatches":[{"preview":"// \"func main\" es especial.","lineNumber":23,"offsetAndLengths":[[3,11]]},{"preview":"func main() {","lineNumber":31,"offsetAndLengths":[[0,9]]},{"preview":"// func main crea un punto de inicio para Go","lineNumber":27,"offsetAndLengths":[[3,9]]},{"preview":"\t// Solo llama a la `func main` de forma automatica.","lineNumber":47,"offsetAndLengths":[[21,9]]}]},{"__typename":"FileMatch","repository":{"name":"github.com/inancgumus/learngo"},"file":{"path":"02-write-your-first-program/main.go","url":"/github.com/inancgumus/learngo/-/blob/02-write-your-first-program/main.go","content":"// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa/4.0/\n//\n// For more tutorials : https://learngoprogramming.com\n// In-person training : https://www.linkedin.com/in/inancgumus/\n// Follow me on twitter: https://twitter.com/inancgumus\n\n// package main is a special package\n// it allows Go to create an executable file\npackage main\n\n/*\nThis is a multi-line comment.\n\nimport keyword makes another package available\n for this .go \"file\".\n\nimport \"fmt\" lets you access fmt package''s functionality\n here in this file.\n*/\nimport \"fmt\"\n\n// \"func main\" is special.\n//\n// Go has to know where to start\n//\n// func main creates a starting point for Go\n//\n// After compiling the code,\n// Go runtime will first run this function\nfunc main() {\n\t// after: import \"fmt\"\n\t// Println function of \"fmt\" package becomes available\n\n\t// Look at what it looks like by typing in the console:\n\t// go doc -src fmt Println\n\n\t// Println is just an exported function from\n\t// \"fmt\" package\n\n\t// Exported = First Letter is uppercase\n\tfmt.Println(\"Hello Gopher!\")\n\n\t// Go cannot call Println function by itself.\n\t// That''s why you need to call it here.\n\t// It only calls `func main` automatically.\n\n\t// -----\n\n\t// Go supports Unicode characters in string literals\n\t// And also in source-code: KÖSTEBEK!\n\t//\n\t// Because: Literal ~= Source Code\n\n\t// EXERCISE: Remove the comments from below --\u003e //\n\t// fmt.Println(\"Merhaba Köstebek!\")\n\n\t// Unnecessary note:\n\t// \"Merhaba Köstebek\" means \"Hello Gopher\"\n\t// in Turkish language\n}\n"},"lineMatches":[{"preview":"// \"func main\" is special.","lineNumber":23,"offsetAndLengths":[[3,11]]},{"preview":"func main() {","lineNumber":31,"offsetAndLengths":[[0,9]]},{"preview":"// func main creates a starting point for Go","lineNumber":27,"offsetAndLengths":[[3,9]]},{"preview":"\t// It only calls `func main` automatically.","lineNumber":46,"offsetAndLengths":[[19,9]]}]},{"__typename":"FileMatch","repository":{"name":"github.com/Go-Learning-Land/Go-Learning-Archive"},"file":{"path":"GolangBasics/learngo/translation/spanish/02-tu-primer-programa/main.go","url":"/github.com/Go-Learning-Land/Go-Learning-Archive/-/blob/GolangBasics/learngo/translation/spanish/02-tu-primer-programa/main.go","content":"// Copyright © 2021 Inanc Gumus\n// Learn Go Programming Course\n// Licencia: https://creativecommons.org/licenses/by-nc-sa/4.0/\n//\n// Para mas tutoriales: https://learngoprogramming.com\n// Clases particulares: https://www.linkedin.com/in/inancgumus/\n// Sigueme en twitter: https://twitter.com/inancgumus\n\n// package main es un paquete especial\n// le permite a Go crear un archivo ejecutable\npackage main\n\n/*\nEsto es un comentario multilinea.\n\nla palabra import hace que otro paquete este disponible\n para este \"archivo\" .go.\n\nimport \"fmt\" te permite acceder a la funcionaliddad del paquete fmt\n en este archivo.\n*/\nimport \"fmt\"\n\n// \"func main\" es especial.\n//\n// Go tiene que saber por donde empezar\n//\n// func main crea un punto de inicio para Go\n//\n// Despues de compilar el codigo,\n// Go ejecutara esta funcion primero.\nfunc main() {\n\t// despues del: import \"fmt\"\n\t// La funcion Println del paquete \"fmt\" estara disponible\n\n\t// Lee sobre ella escribiendo los siguiente en la consola:\n\t// go doc -src fmt Println\n\n\t// Println es simplemente una funcion exportada de:\n\t// \"fmt\" package\n\n\t// Exportada = Primera letra en mayuscula\n\tfmt.Println(\"Hello Gopher!\")\n\n\t// Go no puede llamar a la funcion Println por si mismo.\n\t// Por eso la tienes que llamar aqui.\n\t// Solo llama a la `func main` de forma automatica.\n\n\t// -----\n\n\t// Go soporta caracteres unicode en cadenas de texto literal\n\t// y tambien en el codigo fuente: KÖSTEBEK!\n\t//\n\t// Porque: Literal ~= Codigo Fuente\n}\n"},"lineMatches":[{"preview":"// \"func main\" es especial.","lineNumber":23,"offsetAndLengths":[[3,11]]},{"preview":"func main() {","lineNumber":31,"offsetAndLengths":[[0,9]]},{"preview":"// func main crea un punto de inicio para Go","lineNumber":27,"offsetAndLengths":[[3,9]]},{"preview":"\t// Solo llama a la `func main` de forma automatica.","lineNumber":46,"offsetAndLengths":[[21,9]]}]},{"__typename":"FileMatch","repository":{"name":"github.com/Go-Learning-Land/Go-Learning-Archive"},"file":{"path":"GolangBasics/learngo/translation/chinese/02-编写第一个程序/main.go","url":"/github.com/Go-Learning-Land/Go-Learning-Archive/-/blob/GolangBasics/learngo/translation/chinese/02-%E7%BC%96%E5%86%99%E7%AC%AC%E4%B8%80%E4%B8%AA%E7%A8%8B%E5%BA%8F/main.go","content":"// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa/4.0/\n//\n// For more tutorials : https://learngoprogramming.com\n// In-person training : https://www.linkedin.com/in/inancgumus/\n// Follow me on twitter: https://twitter.com/inancgumus\n\n// package main 是一个特殊的包\n// 它允许 Go 创建一个可执行文件\npackage main\n\n/*\n这是一个多行注释\n\nimport 关键字引入另一个包\n 对于这个 .go ”文件“\n\nimport \"fmt\" 允许你使用 fmt 包的各种函数\n 在这个文件\n*/\nimport \"fmt\"\n\n// \"func main\" 是特殊的\n//\n// Go 必须知道从哪里开始执行\n//\n// func main 对于 Go 而言就是开始执行的位置\n//\n// 代码编译后,\n// Go runtime 第一个执行该函数\nfunc main() {\n\t// import \"fmt\" 之后\n\t// \"fmt\" 包中的 Println 函数就可以使用\n\n\t// 在控制台输入下面的命令可以查看它的源代码:\n\t// go doc -src fmt Println\n\n\t// Println 是一个 exported 函数来自\n\t// \"fmt\" 包\n\n\t// Exported = 首字母大写\n\tfmt.Println(\"Hello Gopher!\")\n\n\t// Go 本身不能调用 Println 函数\n\t// 这就是为什么你需要在这里调用它\n\t// Go 只能自动地调用 `func main`\n\n\t// -----\n\n\t// Go 字符串支持 Unicode 字符\n\t// 源代码同时也支持: KÖSTEBEK!\n\t//\n\t// 因为: 字面值 ~= 源代码\n\n\t// 练习: 删除下行注释的 --\u003e //\n\t// fmt.Println(\"Merhaba Köstebek!\")\n\n\t// 不重要的注释:\n\t// \"Merhaba Köstebek\" 的意思是 \"你好 Gopher\"\n\t// 在土耳其语\n}\n"},"lineMatches":[{"preview":"// \"func main\" 是特殊的","lineNumber":23,"offsetAndLengths":[[3,11]]},{"preview":"func main() {","lineNumber":31,"offsetAndLengths":[[0,9]]},{"preview":"\t// Go 只能自动地调用 `func main`","lineNumber":46,"offsetAndLengths":[[16,9]]},{"preview":"// func main 对于 Go 而言就是开始执行的位置","lineNumber":27,"offsetAndLengths":[[3,9]]}]},{"__typename":"FileMatch","repository":{"name":"github.com/Go-Learning-Land/Go-Learning-Archive"},"file":{"path":"GolangBasics/learngo/first/first/main.go","url":"/github.com/Go-Learning-Land/Go-Learning-Archive/-/blob/GolangBasics/learngo/first/first/main.go","content":"// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa/4.0/\n//\n// For more tutorials : https://learngoprogramming.com\n// In-person training : https://www.linkedin.com/in/inancgumus/\n// Follow me on twitter: https://twitter.com/inancgumus\n\n// package main is a special package\n// it allows Go to create an executable file\npackage main\n\n/*\nThis is a multi-line comment.\n\nimport keyword makes another package available\n for this .go \"file\".\n\nimport \"fmt\" lets you access fmt package''s functionality\n here in this file.\n*/\nimport \"fmt\"\n\n// \"func main\" is special.\n//\n// Go has to know where to start\n//\n// func main creates a starting point for Go\n//\n// After compiling the code,\n// Go runtime will first run this function\nfunc main() {\n\t// after: import \"fmt\"\n\t// Println function of \"fmt\" package becomes available\n\n\t// Look at what it looks like by typing in the console:\n\t// go doc -src fmt Println\n\n\t// Println is just an exported function from\n\t// \"fmt\" package\n\n\t// Exported = First Letter is uppercase\n\tfmt.Println(\"Hello Gopher!\")\n\n\t// Go cannot call Println function by itself.\n\t// That''s why you need to call it here.\n\t// It only calls `func main` automatically.\n\n\t// -----\n\n\t// Go supports Unicode characters in string literals\n\t// And also in source-code: KÖSTEBEK!\n\n\t// EXERCISE: Remove the comments from below --\u003e //\n\t// fmt.Println(\"Merhaba Köstebek!\")\n\n\t// Unnecessary note:\n\t// \"Merhaba Köstebek\" means \"Hello Gopher\"\n\t// in Turkish language\n}\n"},"lineMatches":[{"preview":"// \"func main\" is special.","lineNumber":23,"offsetAndLengths":[[3,11]]},{"preview":"func main() {","lineNumber":31,"offsetAndLengths":[[0,9]]},{"preview":"// func main creates a starting point for Go","lineNumber":27,"offsetAndLengths":[[3,9]]},{"preview":"\t// It only calls `func main` automatically.","lineNumber":46,"offsetAndLengths":[[19,9]]}]},{"__typename":"FileMatch","repository":{"name":"github.com/Go-Learning-Land/Go-Learning-Archive"},"file":{"path":"GolangBasics/learngo/02-write-your-first-program/main.go","url":"/github.com/Go-Learning-Land/Go-Learning-Archive/-/blob/GolangBasics/learngo/02-write-your-first-program/main.go","content":"// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa/4.0/\n//\n// For more tutorials : https://learngoprogramming.com\n// In-person training : https://www.linkedin.com/in/inancgumus/\n// Follow me on twitter: https://twitter.com/inancgumus\n\n// package main is a special package\n// it allows Go to create an executable file\npackage main\n\n/*\nThis is a multi-line comment.\n\nimport keyword makes another package available\n for this .go \"file\".\n\nimport \"fmt\" lets you access fmt package''s functionality\n here in this file.\n*/\nimport \"fmt\"\n\n// \"func main\" is special.\n//\n// Go has to know where to start\n//\n// func main creates a starting point for Go\n//\n// After compiling the code,\n// Go runtime will first run this function\nfunc main() {\n\t// after: import \"fmt\"\n\t// Println function of \"fmt\" package becomes available\n\n\t// Look at what it looks like by typing in the console:\n\t// go doc -src fmt Println\n\n\t// Println is just an exported function from\n\t// \"fmt\" package\n\n\t// Exported = First Letter is uppercase\n\tfmt.Println(\"Hello Gopher!\")\n\n\t// Go cannot call Println function by itself.\n\t// That''s why you need to call it here.\n\t// It only calls `func main` automatically.\n\n\t// -----\n\n\t// Go supports Unicode characters in string literals\n\t// And also in source-code: KÖSTEBEK!\n\t//\n\t// Because: Literal ~= Source Code\n\n\t// EXERCISE: Remove the comments from below --\u003e //\n\t// fmt.Println(\"Merhaba Köstebek!\")\n\n\t// Unnecessary note:\n\t// \"Merhaba Köstebek\" means \"Hello Gopher\"\n\t// in Turkish language\n}\n"},"lineMatches":[{"preview":"// \"func main\" is special.","lineNumber":23,"offsetAndLengths":[[3,11]]},{"preview":"func main() {","lineNumber":31,"offsetAndLengths":[[0,9]]}]}]}}}}' + body: '{"data":{"search":{"results":{"matchCount":30,"limitHit":true,"resultCount":30,"approximateResultCount":"30+","missing":[],"timedout":[],"indexUnavailable":false,"results":[{"__typename":"FileMatch","repository":{"name":"github.com/wx-chevalier/Go-Notes"},"file":{"path":"99~参考资料/2017~A Huge Number of Go Examples/codes/first/first/main.go","url":"/github.com/wx-chevalier/Go-Notes/-/blob/99~%E5%8F%82%E8%80%83%E8%B5%84%E6%96%99/2017~A%20Huge%20Number%20of%20Go%20Examples/codes/first/first/main.go","content":"\n// package main is a special package\n// it allows Go to create an executable file\npackage main\n\n/*\nThis is a multi-line comment.\n\nimport keyword makes another package available\n for this .go \"file\".\n\nimport \"fmt\" lets you access fmt package''s functionality\n here in this file.\n*/\nimport \"fmt\"\n\n// \"func main\" is special.\n//\n// Go has to know where to start\n//\n// func main creates a starting point for Go\n//\n// After compiling the code,\n// Go runtime will first run this function\nfunc main() {\n\t// after: import \"fmt\"\n\t// Println function of \"fmt\" package becomes available\n\n\t// Look at what it looks like by typing in the console:\n\t// godoc -src fmt Println\n\n\t// Println is just an exported function from\n\t// \"fmt\" package\n\n\t// Exported = First Letter is uppercase\n\tfmt.Println(\"Hello Gopher!\")\n\n\t// Go cannot call Println function by itself.\n\t// That''s why you need to call it here.\n\t// It only calls `func main` automatically.\n\n\t// -----\n\n\t// Go supports Unicode characters in string literals\n\t// And also in source-code: KÖSTEBEK!\n\n\t// EXERCISE: Remove the comments from below --\u003e //\n\t// fmt.Println(\"Merhaba Köstebek!\")\n\n\t// Unnecessary note:\n\t// \"Merhaba Köstebek\" means \"Hello Gopher\"\n\t// in Turkish language\n}\n"},"lineMatches":[{"preview":"// \"func main\" is special.","lineNumber":16,"offsetAndLengths":[[3,11]]},{"preview":"func main() {","lineNumber":24,"offsetAndLengths":[[0,9]]},{"preview":"// func main creates a starting point for Go","lineNumber":20,"offsetAndLengths":[[3,9]]},{"preview":"\t// It only calls `func main` automatically.","lineNumber":39,"offsetAndLengths":[[19,9]]}]},{"__typename":"FileMatch","repository":{"name":"github.com/wx-chevalier/Go-Notes"},"file":{"path":"99~参考资料/2017~A Huge Number of Go Examples/codes/02-write-your-first-program/main.go","url":"/github.com/wx-chevalier/Go-Notes/-/blob/99~%E5%8F%82%E8%80%83%E8%B5%84%E6%96%99/2017~A%20Huge%20Number%20of%20Go%20Examples/codes/02-write-your-first-program/main.go","content":"\n// package main is a special package\n// it allows Go to create an executable file\npackage main\n\n/*\nThis is a multi-line comment.\n\nimport keyword makes another package available\n for this .go \"file\".\n\nimport \"fmt\" lets you access fmt package''s functionality\n here in this file.\n*/\nimport \"fmt\"\n\n// \"func main\" is special.\n//\n// Go has to know where to start\n//\n// func main creates a starting point for Go\n//\n// After compiling the code,\n// Go runtime will first run this function\nfunc main() {\n\t// after: import \"fmt\"\n\t// Println function of \"fmt\" package becomes available\n\n\t// Look at what it looks like by typing in the console:\n\t// go doc -src fmt Println\n\n\t// Println is just an exported function from\n\t// \"fmt\" package\n\n\t// Exported = First Letter is uppercase\n\tfmt.Println(\"Hello Gopher!\")\n\n\t// Go cannot call Println function by itself.\n\t// That''s why you need to call it here.\n\t// It only calls `func main` automatically.\n\n\t// -----\n\n\t// Go supports Unicode characters in string literals\n\t// And also in source-code: KÖSTEBEK!\n\t//\n\t// Because: Literal ~= Source Code\n\n\t// EXERCISE: Remove the comments from below --\u003e //\n\t// fmt.Println(\"Merhaba Köstebek!\")\n\n\t// Unnecessary note:\n\t// \"Merhaba Köstebek\" means \"Hello Gopher\"\n\t// in Turkish language\n}\n"},"lineMatches":[{"preview":"// \"func main\" is special.","lineNumber":16,"offsetAndLengths":[[3,11]]},{"preview":"func main() {","lineNumber":24,"offsetAndLengths":[[0,9]]},{"preview":"// func main creates a starting point for Go","lineNumber":20,"offsetAndLengths":[[3,9]]},{"preview":"\t// It only calls `func main` automatically.","lineNumber":39,"offsetAndLengths":[[19,9]]}]},{"__typename":"FileMatch","repository":{"name":"github.com/wx-chevalier/Go-Notes"},"file":{"path":"99~参考资料/2018~《Learn Go》/translation/chinese/02-编写第一个程序/main.go","url":"/github.com/wx-chevalier/Go-Notes/-/blob/99~%E5%8F%82%E8%80%83%E8%B5%84%E6%96%99/2018~%E3%80%8ALearn%20Go%E3%80%8B/translation/chinese/02-%E7%BC%96%E5%86%99%E7%AC%AC%E4%B8%80%E4%B8%AA%E7%A8%8B%E5%BA%8F/main.go","content":"// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa/4.0/\n//\n// For more tutorials : https://learngoprogramming.com\n// In-person training : https://www.linkedin.com/in/inancgumus/\n// Follow me on twitter: https://twitter.com/inancgumus\n\n// package main 是一个特殊的包\n// 它允许 Go 创建一个可执行文件\npackage main\n\n/*\n这是一个多行注释\n\nimport 关键字引入另一个包\n 对于这个 .go ”文件“\n\nimport \"fmt\" 允许你使用 fmt 包的各种函数\n 在这个文件\n*/\nimport \"fmt\"\n\n// \"func main\" 是特殊的\n//\n// Go 必须知道从哪里开始执行\n//\n// func main 对于 Go 而言就是开始执行的位置\n//\n// 代码编译后,\n// Go runtime 第一个执行该函数\nfunc main() {\n\t// import \"fmt\" 之后\n\t// \"fmt\" 包中的 Println 函数就可以使用\n\n\t// 在控制台输入下面的命令可以查看它的源代码:\n\t// go doc -src fmt Println\n\n\t// Println 是一个 exported 函数来自\n\t// \"fmt\" 包\n\n\t// Exported = 首字母大写\n\tfmt.Println(\"Hello Gopher!\")\n\n\t// Go 本身不能调用 Println 函数\n\t// 这就是为什么你需要在这里调用它\n\t// Go 只能自动地调用 `func main`\n\n\t// -----\n\n\t// Go 字符串支持 Unicode 字符\n\t// 源代码同时也支持: KÖSTEBEK!\n\t//\n\t// 因为: 字面值 ~= 源代码\n\n\t// 练习: 删除下行注释的 --\u003e //\n\t// fmt.Println(\"Merhaba Köstebek!\")\n\n\t// 不重要的注释:\n\t// \"Merhaba Köstebek\" 的意思是 \"你好 Gopher\"\n\t// 在土耳其语\n}\n"},"lineMatches":[{"preview":"// \"func main\" 是特殊的","lineNumber":23,"offsetAndLengths":[[3,11]]},{"preview":"func main() {","lineNumber":31,"offsetAndLengths":[[0,9]]},{"preview":"\t// Go 只能自动地调用 `func main`","lineNumber":46,"offsetAndLengths":[[16,9]]},{"preview":"// func main 对于 Go 而言就是开始执行的位置","lineNumber":27,"offsetAndLengths":[[3,9]]}]},{"__typename":"FileMatch","repository":{"name":"github.com/wx-chevalier/Go-Notes"},"file":{"path":"99~参考资料/2018~《Learn Go》/first/first/main.go","url":"/github.com/wx-chevalier/Go-Notes/-/blob/99~%E5%8F%82%E8%80%83%E8%B5%84%E6%96%99/2018~%E3%80%8ALearn%20Go%E3%80%8B/first/first/main.go","content":"// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa/4.0/\n//\n// For more tutorials : https://learngoprogramming.com\n// In-person training : https://www.linkedin.com/in/inancgumus/\n// Follow me on twitter: https://twitter.com/inancgumus\n\n// package main is a special package\n// it allows Go to create an executable file\npackage main\n\n/*\nThis is a multi-line comment.\n\nimport keyword makes another package available\n for this .go \"file\".\n\nimport \"fmt\" lets you access fmt package''s functionality\n here in this file.\n*/\nimport \"fmt\"\n\n// \"func main\" is special.\n//\n// Go has to know where to start\n//\n// func main creates a starting point for Go\n//\n// After compiling the code,\n// Go runtime will first run this function\nfunc main() {\n\t// after: import \"fmt\"\n\t// Println function of \"fmt\" package becomes available\n\n\t// Look at what it looks like by typing in the console:\n\t// go doc -src fmt Println\n\n\t// Println is just an exported function from\n\t// \"fmt\" package\n\n\t// Exported = First Letter is uppercase\n\tfmt.Println(\"Hello Gopher!\")\n\n\t// Go cannot call Println function by itself.\n\t// That''s why you need to call it here.\n\t// It only calls `func main` automatically.\n\n\t// -----\n\n\t// Go supports Unicode characters in string literals\n\t// And also in source-code: KÖSTEBEK!\n\n\t// EXERCISE: Remove the comments from below --\u003e //\n\t// fmt.Println(\"Merhaba Köstebek!\")\n\n\t// Unnecessary note:\n\t// \"Merhaba Köstebek\" means \"Hello Gopher\"\n\t// in Turkish language\n}\n"},"lineMatches":[{"preview":"// \"func main\" is special.","lineNumber":23,"offsetAndLengths":[[3,11]]},{"preview":"func main() {","lineNumber":31,"offsetAndLengths":[[0,9]]},{"preview":"// func main creates a starting point for Go","lineNumber":27,"offsetAndLengths":[[3,9]]},{"preview":"\t// It only calls `func main` automatically.","lineNumber":46,"offsetAndLengths":[[19,9]]}]},{"__typename":"FileMatch","repository":{"name":"github.com/wx-chevalier/Go-Notes"},"file":{"path":"99~参考资料/2018~《Learn Go》/translation/spanish/02-tu-primer-programa/main.go","url":"/github.com/wx-chevalier/Go-Notes/-/blob/99~%E5%8F%82%E8%80%83%E8%B5%84%E6%96%99/2018~%E3%80%8ALearn%20Go%E3%80%8B/translation/spanish/02-tu-primer-programa/main.go","content":"// Copyright © 2021 Inanc Gumus\n// Learn Go Programming Course\n// Licencia: https://creativecommons.org/licenses/by-nc-sa/4.0/\n//\n// Para mas tutoriales: https://learngoprogramming.com\n// Clases particulares: https://www.linkedin.com/in/inancgumus/\n// Sigueme en twitter: https://twitter.com/inancgumus\n\n// package main es un paquete especial\n// le permite a Go crear un archivo ejecutable\npackage main\n\n/*\nEsto es un comentario multilinea.\n\nla palabra import hace que otro paquete este disponible\n para este \"archivo\" .go.\n\nimport \"fmt\" te permite acceder a la funcionaliddad del paquete fmt\n en este archivo.\n*/\nimport \"fmt\"\n\n// \"func main\" es especial.\n//\n// Go tiene que saber por donde empezar\n//\n// func main crea un punto de inicio para Go\n//\n// Después de compilar el codigo,\n// Go ejecutará esta función primero.\nfunc main() {\n\t// después del: import \"fmt\"\n\t// La función Println del paquete \"fmt\" estará disponible\n\n\t// Lee sobre ella escribiendo los siguiente en la consola:\n\t// go doc -src fmt Println\n\n\t// Println es simplemente una función exportada de:\n\t// \"fmt\" package\n\n\t// Para poder exportar una función tendrás que escribir el\n\t// primer caracter del nombre de la función en mayúscula.\n\tfmt.Println(\"Hello Gopher!\")\n\n\t// Go no puede llamar a la función Println por si mismo.\n\t// Por eso la tienes que llamar aqui.\n\t// Solo llama a la `func main` de forma automatica.\n\n\t// -----\n\n\t// Go soporta caracteres unicode en cadenas de texto literal\n\t// y tambien en el codigo fuente: KÖSTEBEK!\n\t//\n\t// Porque: Literal ~= Codigo Fuente\n}\n"},"lineMatches":[{"preview":"// \"func main\" es especial.","lineNumber":23,"offsetAndLengths":[[3,11]]},{"preview":"func main() {","lineNumber":31,"offsetAndLengths":[[0,9]]},{"preview":"// func main crea un punto de inicio para Go","lineNumber":27,"offsetAndLengths":[[3,9]]},{"preview":"\t// Solo llama a la `func main` de forma automatica.","lineNumber":47,"offsetAndLengths":[[21,9]]}]},{"__typename":"FileMatch","repository":{"name":"github.com/wx-chevalier/Go-Notes"},"file":{"path":"99~参考资料/2018~《Learn Go》/02-write-your-first-program/main.go","url":"/github.com/wx-chevalier/Go-Notes/-/blob/99~%E5%8F%82%E8%80%83%E8%B5%84%E6%96%99/2018~%E3%80%8ALearn%20Go%E3%80%8B/02-write-your-first-program/main.go","content":"// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa/4.0/\n//\n// For more tutorials : https://learngoprogramming.com\n// In-person training : https://www.linkedin.com/in/inancgumus/\n// Follow me on twitter: https://twitter.com/inancgumus\n\n// package main is a special package\n// it allows Go to create an executable file\npackage main\n\n/*\nThis is a multi-line comment.\n\nimport keyword makes another package available\n for this .go \"file\".\n\nimport \"fmt\" lets you access fmt package''s functionality\n here in this file.\n*/\nimport \"fmt\"\n\n// \"func main\" is special.\n//\n// Go has to know where to start\n//\n// func main creates a starting point for Go\n//\n// After compiling the code,\n// Go runtime will first run this function\nfunc main() {\n\t// after: import \"fmt\"\n\t// Println function of \"fmt\" package becomes available\n\n\t// Look at what it looks like by typing in the console:\n\t// go doc -src fmt Println\n\n\t// Println is just an exported function from\n\t// \"fmt\" package\n\n\t// Exported = First Letter is uppercase\n\tfmt.Println(\"Hello Gopher!\")\n\n\t// Go cannot call Println function by itself.\n\t// That''s why you need to call it here.\n\t// It only calls `func main` automatically.\n\n\t// -----\n\n\t// Go supports Unicode characters in string literals\n\t// And also in source-code: KÖSTEBEK!\n\t//\n\t// Because: Literal ~= Source Code\n\n\t// EXERCISE: Remove the comments from below --\u003e //\n\t// fmt.Println(\"Merhaba Köstebek!\")\n\n\t// Unnecessary note:\n\t// \"Merhaba Köstebek\" means \"Hello Gopher\"\n\t// in Turkish language\n}\n"},"lineMatches":[{"preview":"// \"func main\" is special.","lineNumber":23,"offsetAndLengths":[[3,11]]},{"preview":"func main() {","lineNumber":31,"offsetAndLengths":[[0,9]]},{"preview":"// func main creates a starting point for Go","lineNumber":27,"offsetAndLengths":[[3,9]]},{"preview":"\t// It only calls `func main` automatically.","lineNumber":46,"offsetAndLengths":[[19,9]]}]},{"__typename":"FileMatch","repository":{"name":"github.com/ShixiangWang/self-study"},"file":{"path":"go/learngo/first/first/main.go","url":"/github.com/ShixiangWang/self-study/-/blob/go/learngo/first/first/main.go","content":"// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa/4.0/\n//\n// For more tutorials : https://learngoprogramming.com\n// In-person training : https://www.linkedin.com/in/inancgumus/\n// Follow me on twitter: https://twitter.com/inancgumus\n\n// package main is a special package\n// it allows Go to create an executable file\npackage main\n\n/*\nThis is a multi-line comment.\n\nimport keyword makes another package available\n for this .go \"file\".\n\nimport \"fmt\" lets you access fmt package''s functionality\n here in this file.\n*/\nimport \"fmt\"\n\n// \"func main\" is special.\n//\n// Go has to know where to start\n//\n// func main creates a starting point for Go\n//\n// After compiling the code,\n// Go runtime will first run this function\nfunc main() {\n\t// after: import \"fmt\"\n\t// Println function of \"fmt\" package becomes available\n\n\t// Look at what it looks like by typing in the console:\n\t// godoc -src fmt Println\n\n\t// Println is just an exported function from\n\t// \"fmt\" package\n\n\t// Exported = First Letter is uppercase\n\tfmt.Println(\"Hello Gopher!\")\n\n\t// Go cannot call Println function by itself.\n\t// That''s why you need to call it here.\n\t// It only calls `func main` automatically.\n\n\t// -----\n\n\t// Go supports Unicode characters in string literals\n\t// And also in source-code: KÖSTEBEK!\n\n\t// EXERCISE: Remove the comments from below --\u003e //\n\t// fmt.Println(\"Merhaba Köstebek!\")\n\n\t// Unnecessary note:\n\t// \"Merhaba Köstebek\" means \"Hello Gopher\"\n\t// in Turkish language\n}\n"},"lineMatches":[{"preview":"// \"func main\" is special.","lineNumber":23,"offsetAndLengths":[[3,11]]},{"preview":"func main() {","lineNumber":31,"offsetAndLengths":[[0,9]]},{"preview":"// func main creates a starting point for Go","lineNumber":27,"offsetAndLengths":[[3,9]]},{"preview":"\t// It only calls `func main` automatically.","lineNumber":46,"offsetAndLengths":[[19,9]]}]},{"__typename":"FileMatch","repository":{"name":"github.com/ShixiangWang/self-study"},"file":{"path":"go/learngo/02-write-your-first-program/main.go","url":"/github.com/ShixiangWang/self-study/-/blob/go/learngo/02-write-your-first-program/main.go","content":"// Copyright © 2018 Inanc Gumus\n// Learn Go Programming Course\n// License: https://creativecommons.org/licenses/by-nc-sa/4.0/\n//\n// For more tutorials : https://learngoprogramming.com\n// In-person training : https://www.linkedin.com/in/inancgumus/\n// Follow me on twitter: https://twitter.com/inancgumus\n\n// package main is a special package\n// it allows Go to create an executable file\npackage main\n\n/*\nThis is a multi-line comment.\n\nimport keyword makes another package available\n for this .go \"file\".\n\nimport \"fmt\" lets you access fmt package''s functionality\n here in this file.\n*/\nimport \"fmt\"\n\n// \"func main\" is special.\n//\n// Go has to know where to start\n//\n// func main creates a starting point for Go\n//\n// After compiling the code,\n// Go runtime will first run this function\nfunc main() {\n\t// after: import \"fmt\"\n\t// Println function of \"fmt\" package becomes available\n\n\t// Look at what it looks like by typing in the console:\n\t// go doc -src fmt Println\n\n\t// Println is just an exported function from\n\t// \"fmt\" package\n\n\t// Exported = First Letter is uppercase\n\tfmt.Println(\"Hello Gopher!\")\n\n\t// Go cannot call Println function by itself.\n\t// That''s why you need to call it here.\n\t// It only calls `func main` automatically.\n\n\t// -----\n\n\t// Go supports Unicode characters in string literals\n\t// And also in source-code: KÖSTEBEK!\n\t//\n\t// Because: Literal ~= Source Code\n\n\t// EXERCISE: Remove the comments from below --\u003e //\n\t// fmt.Println(\"Merhaba Köstebek!\")\n\n\t// Unnecessary note:\n\t// \"Merhaba Köstebek\" means \"Hello Gopher\"\n\t// in Turkish language\n}\n"},"lineMatches":[{"preview":"// \"func main\" is special.","lineNumber":23,"offsetAndLengths":[[3,11]]},{"preview":"func main() {","lineNumber":31,"offsetAndLengths":[[0,9]]}]}]}}}}' headers: Content-Type: - application/json status: 200 OK code: 200 - duration: 1.4178135s + duration: 1.407635542s - id: 3 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 43125 + content_length: 43480 host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/sourcegraph_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use sourcegraph to search for 'func main' in Go repositories\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"call_WcfEj9DQooqbUVduTRrsTR4k\",\"function\":{\"arguments\":\"{\\\"query\\\":\\\"lang:go \\\\\\\"func main\\\\\\\" type:file\\\",\\\"count\\\":10,\\\"context_window\\\":5}\",\"name\":\"sourcegraph\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"# Sourcegraph Search Results\\n\\nFound 30 matches across 30 results\\n(Result limit reached, try a more specific query)\\n\\n## Result 1: github.com/inancgumus/learngo/translation/chinese/02-编写第一个程序/main.go\\n\\nURL: /github.com/inancgumus/learngo/-/blob/translation/chinese/02-%E7%BC%96%E5%86%99%E7%AC%AC%E4%B8%80%E4%B8%AA%E7%A8%8B%E5%BA%8F/main.go\\n\\n```\\n18| \\n19| import \\\"fmt\\\" 允许你使用 fmt 包的各种函数\\n20| 在这个文件\\n21| */\\n22| import \\\"fmt\\\"\\n23| // \\\"func main\\\" 是特殊的\\n24| // \\\"func main\\\" 是特殊的\\n25| //\\n26| // Go 必须知道从哪里开始执行\\n27| //\\n28| // func main 对于 Go 而言就是开始执行的位置\\n```\\n\\n```\\n26| // Go 必须知道从哪里开始执行\\n27| //\\n28| // func main 对于 Go 而言就是开始执行的位置\\n29| //\\n30| // 代码编译后,\\n31| func main() {\\n32| func main() {\\n33| \\t// import \\\"fmt\\\" 之后\\n34| \\t// \\\"fmt\\\" 包中的 Println 函数就可以使用\\n35| \\n36| \\t// 在控制台输入下面的命令可以查看它的源代码:\\n```\\n\\n```\\n41| \\n42| \\t// Exported = 首字母大写\\n43| \\tfmt.Println(\\\"Hello Gopher!\\\")\\n44| \\n45| \\t// Go 本身不能调用 Println 函数\\n46| \\t// Go 只能自动地调用 `func main`\\n47| \\t// Go 只能自动地调用 `func main`\\n48| \\n49| \\t// -----\\n50| \\n51| \\t// Go 字符串支持 Unicode 字符\\n```\\n\\n```\\n22| import \\\"fmt\\\"\\n23| \\n24| // \\\"func main\\\" 是特殊的\\n25| //\\n26| // Go 必须知道从哪里开始执行\\n27| // func main 对于 Go 而言就是开始执行的位置\\n28| // func main 对于 Go 而言就是开始执行的位置\\n29| //\\n30| // 代码编译后,\\n31| // Go runtime 第一个执行该函数\\n32| func main() {\\n```\\n\\n## Result 2: github.com/inancgumus/learngo/first/first/main.go\\n\\nURL: /github.com/inancgumus/learngo/-/blob/first/first/main.go\\n\\n```\\n18| \\n19| import \\\"fmt\\\" lets you access fmt package's functionality\\n20| here in this file.\\n21| */\\n22| import \\\"fmt\\\"\\n23| // \\\"func main\\\" is special.\\n24| // \\\"func main\\\" is special.\\n25| //\\n26| // Go has to know where to start\\n27| //\\n28| // func main creates a starting point for Go\\n```\\n\\n```\\n26| // Go has to know where to start\\n27| //\\n28| // func main creates a starting point for Go\\n29| //\\n30| // After compiling the code,\\n31| func main() {\\n32| func main() {\\n33| \\t// after: import \\\"fmt\\\"\\n34| \\t// Println function of \\\"fmt\\\" package becomes available\\n35| \\n36| \\t// Look at what it looks like by typing in the console:\\n```\\n\\n```\\n22| import \\\"fmt\\\"\\n23| \\n24| // \\\"func main\\\" is special.\\n25| //\\n26| // Go has to know where to start\\n27| // func main creates a starting point for Go\\n28| // func main creates a starting point for Go\\n29| //\\n30| // After compiling the code,\\n31| // Go runtime will first run this function\\n32| func main() {\\n```\\n\\n```\\n41| \\n42| \\t// Exported = First Letter is uppercase\\n43| \\tfmt.Println(\\\"Hello Gopher!\\\")\\n44| \\n45| \\t// Go cannot call Println function by itself.\\n46| \\t// It only calls `func main` automatically.\\n47| \\t// It only calls `func main` automatically.\\n48| \\n49| \\t// -----\\n50| \\n51| \\t// Go supports Unicode characters in string literals\\n```\\n\\n## Result 3: github.com/inancgumus/learngo/translation/spanish/02-tu-primer-programa/main.go\\n\\nURL: /github.com/inancgumus/learngo/-/blob/translation/spanish/02-tu-primer-programa/main.go\\n\\n```\\n18| \\n19| import \\\"fmt\\\" te permite acceder a la funcionaliddad del paquete fmt\\n20| en este archivo.\\n21| */\\n22| import \\\"fmt\\\"\\n23| // \\\"func main\\\" es especial.\\n24| // \\\"func main\\\" es especial.\\n25| //\\n26| // Go tiene que saber por donde empezar\\n27| //\\n28| // func main crea un punto de inicio para Go\\n```\\n\\n```\\n26| // Go tiene que saber por donde empezar\\n27| //\\n28| // func main crea un punto de inicio para Go\\n29| //\\n30| // Después de compilar el codigo,\\n31| func main() {\\n32| func main() {\\n33| \\t// después del: import \\\"fmt\\\"\\n34| \\t// La función Println del paquete \\\"fmt\\\" estará disponible\\n35| \\n36| \\t// Lee sobre ella escribiendo los siguiente en la consola:\\n```\\n\\n```\\n22| import \\\"fmt\\\"\\n23| \\n24| // \\\"func main\\\" es especial.\\n25| //\\n26| // Go tiene que saber por donde empezar\\n27| // func main crea un punto de inicio para Go\\n28| // func main crea un punto de inicio para Go\\n29| //\\n30| // Después de compilar el codigo,\\n31| // Go ejecutará esta función primero.\\n32| func main() {\\n```\\n\\n```\\n42| \\t// Para poder exportar una función tendrás que escribir el\\n43| \\t// primer caracter del nombre de la función en mayúscula.\\n44| \\tfmt.Println(\\\"Hello Gopher!\\\")\\n45| \\n46| \\t// Go no puede llamar a la función Println por si mismo.\\n47| \\t// Solo llama a la `func main` de forma automatica.\\n48| \\t// Solo llama a la `func main` de forma automatica.\\n49| \\n50| \\t// -----\\n51| \\n52| \\t// Go soporta caracteres unicode en cadenas de texto literal\\n```\\n\\n## Result 4: github.com/inancgumus/learngo/02-write-your-first-program/main.go\\n\\nURL: /github.com/inancgumus/learngo/-/blob/02-write-your-first-program/main.go\\n\\n```\\n18| \\n19| import \\\"fmt\\\" lets you access fmt package's functionality\\n20| here in this file.\\n21| */\\n22| import \\\"fmt\\\"\\n23| // \\\"func main\\\" is special.\\n24| // \\\"func main\\\" is special.\\n25| //\\n26| // Go has to know where to start\\n27| //\\n28| // func main creates a starting point for Go\\n```\\n\\n```\\n26| // Go has to know where to start\\n27| //\\n28| // func main creates a starting point for Go\\n29| //\\n30| // After compiling the code,\\n31| func main() {\\n32| func main() {\\n33| \\t// after: import \\\"fmt\\\"\\n34| \\t// Println function of \\\"fmt\\\" package becomes available\\n35| \\n36| \\t// Look at what it looks like by typing in the console:\\n```\\n\\n```\\n22| import \\\"fmt\\\"\\n23| \\n24| // \\\"func main\\\" is special.\\n25| //\\n26| // Go has to know where to start\\n27| // func main creates a starting point for Go\\n28| // func main creates a starting point for Go\\n29| //\\n30| // After compiling the code,\\n31| // Go runtime will first run this function\\n32| func main() {\\n```\\n\\n```\\n41| \\n42| \\t// Exported = First Letter is uppercase\\n43| \\tfmt.Println(\\\"Hello Gopher!\\\")\\n44| \\n45| \\t// Go cannot call Println function by itself.\\n46| \\t// It only calls `func main` automatically.\\n47| \\t// It only calls `func main` automatically.\\n48| \\n49| \\t// -----\\n50| \\n51| \\t// Go supports Unicode characters in string literals\\n```\\n\\n## Result 5: github.com/Go-Learning-Land/Go-Learning-Archive/GolangBasics/learngo/translation/spanish/02-tu-primer-programa/main.go\\n\\nURL: /github.com/Go-Learning-Land/Go-Learning-Archive/-/blob/GolangBasics/learngo/translation/spanish/02-tu-primer-programa/main.go\\n\\n```\\n18| \\n19| import \\\"fmt\\\" te permite acceder a la funcionaliddad del paquete fmt\\n20| en este archivo.\\n21| */\\n22| import \\\"fmt\\\"\\n23| // \\\"func main\\\" es especial.\\n24| // \\\"func main\\\" es especial.\\n25| //\\n26| // Go tiene que saber por donde empezar\\n27| //\\n28| // func main crea un punto de inicio para Go\\n```\\n\\n```\\n26| // Go tiene que saber por donde empezar\\n27| //\\n28| // func main crea un punto de inicio para Go\\n29| //\\n30| // Despues de compilar el codigo,\\n31| func main() {\\n32| func main() {\\n33| \\t// despues del: import \\\"fmt\\\"\\n34| \\t// La funcion Println del paquete \\\"fmt\\\" estara disponible\\n35| \\n36| \\t// Lee sobre ella escribiendo los siguiente en la consola:\\n```\\n\\n```\\n22| import \\\"fmt\\\"\\n23| \\n24| // \\\"func main\\\" es especial.\\n25| //\\n26| // Go tiene que saber por donde empezar\\n27| // func main crea un punto de inicio para Go\\n28| // func main crea un punto de inicio para Go\\n29| //\\n30| // Despues de compilar el codigo,\\n31| // Go ejecutara esta funcion primero.\\n32| func main() {\\n```\\n\\n```\\n41| \\n42| \\t// Exportada = Primera letra en mayuscula\\n43| \\tfmt.Println(\\\"Hello Gopher!\\\")\\n44| \\n45| \\t// Go no puede llamar a la funcion Println por si mismo.\\n46| \\t// Solo llama a la `func main` de forma automatica.\\n47| \\t// Solo llama a la `func main` de forma automatica.\\n48| \\n49| \\t// -----\\n50| \\n51| \\t// Go soporta caracteres unicode en cadenas de texto literal\\n```\\n\\n## Result 6: github.com/Go-Learning-Land/Go-Learning-Archive/GolangBasics/learngo/translation/chinese/02-编写第一个程序/main.go\\n\\nURL: /github.com/Go-Learning-Land/Go-Learning-Archive/-/blob/GolangBasics/learngo/translation/chinese/02-%E7%BC%96%E5%86%99%E7%AC%AC%E4%B8%80%E4%B8%AA%E7%A8%8B%E5%BA%8F/main.go\\n\\n```\\n18| \\n19| import \\\"fmt\\\" 允许你使用 fmt 包的各种函数\\n20| 在这个文件\\n21| */\\n22| import \\\"fmt\\\"\\n23| // \\\"func main\\\" 是特殊的\\n24| // \\\"func main\\\" 是特殊的\\n25| //\\n26| // Go 必须知道从哪里开始执行\\n27| //\\n28| // func main 对于 Go 而言就是开始执行的位置\\n```\\n\\n```\\n26| // Go 必须知道从哪里开始执行\\n27| //\\n28| // func main 对于 Go 而言就是开始执行的位置\\n29| //\\n30| // 代码编译后,\\n31| func main() {\\n32| func main() {\\n33| \\t// import \\\"fmt\\\" 之后\\n34| \\t// \\\"fmt\\\" 包中的 Println 函数就可以使用\\n35| \\n36| \\t// 在控制台输入下面的命令可以查看它的源代码:\\n```\\n\\n```\\n41| \\n42| \\t// Exported = 首字母大写\\n43| \\tfmt.Println(\\\"Hello Gopher!\\\")\\n44| \\n45| \\t// Go 本身不能调用 Println 函数\\n46| \\t// Go 只能自动地调用 `func main`\\n47| \\t// Go 只能自动地调用 `func main`\\n48| \\n49| \\t// -----\\n50| \\n51| \\t// Go 字符串支持 Unicode 字符\\n```\\n\\n```\\n22| import \\\"fmt\\\"\\n23| \\n24| // \\\"func main\\\" 是特殊的\\n25| //\\n26| // Go 必须知道从哪里开始执行\\n27| // func main 对于 Go 而言就是开始执行的位置\\n28| // func main 对于 Go 而言就是开始执行的位置\\n29| //\\n30| // 代码编译后,\\n31| // Go runtime 第一个执行该函数\\n32| func main() {\\n```\\n\\n## Result 7: github.com/Go-Learning-Land/Go-Learning-Archive/GolangBasics/learngo/first/first/main.go\\n\\nURL: /github.com/Go-Learning-Land/Go-Learning-Archive/-/blob/GolangBasics/learngo/first/first/main.go\\n\\n```\\n18| \\n19| import \\\"fmt\\\" lets you access fmt package's functionality\\n20| here in this file.\\n21| */\\n22| import \\\"fmt\\\"\\n23| // \\\"func main\\\" is special.\\n24| // \\\"func main\\\" is special.\\n25| //\\n26| // Go has to know where to start\\n27| //\\n28| // func main creates a starting point for Go\\n```\\n\\n```\\n26| // Go has to know where to start\\n27| //\\n28| // func main creates a starting point for Go\\n29| //\\n30| // After compiling the code,\\n31| func main() {\\n32| func main() {\\n33| \\t// after: import \\\"fmt\\\"\\n34| \\t// Println function of \\\"fmt\\\" package becomes available\\n35| \\n36| \\t// Look at what it looks like by typing in the console:\\n```\\n\\n```\\n22| import \\\"fmt\\\"\\n23| \\n24| // \\\"func main\\\" is special.\\n25| //\\n26| // Go has to know where to start\\n27| // func main creates a starting point for Go\\n28| // func main creates a starting point for Go\\n29| //\\n30| // After compiling the code,\\n31| // Go runtime will first run this function\\n32| func main() {\\n```\\n\\n```\\n41| \\n42| \\t// Exported = First Letter is uppercase\\n43| \\tfmt.Println(\\\"Hello Gopher!\\\")\\n44| \\n45| \\t// Go cannot call Println function by itself.\\n46| \\t// It only calls `func main` automatically.\\n47| \\t// It only calls `func main` automatically.\\n48| \\n49| \\t// -----\\n50| \\n51| \\t// Go supports Unicode characters in string literals\\n```\\n\\n## Result 8: github.com/Go-Learning-Land/Go-Learning-Archive/GolangBasics/learngo/02-write-your-first-program/main.go\\n\\nURL: /github.com/Go-Learning-Land/Go-Learning-Archive/-/blob/GolangBasics/learngo/02-write-your-first-program/main.go\\n\\n```\\n18| \\n19| import \\\"fmt\\\" lets you access fmt package's functionality\\n20| here in this file.\\n21| */\\n22| import \\\"fmt\\\"\\n23| // \\\"func main\\\" is special.\\n24| // \\\"func main\\\" is special.\\n25| //\\n26| // Go has to know where to start\\n27| //\\n28| // func main creates a starting point for Go\\n```\\n\\n```\\n26| // Go has to know where to start\\n27| //\\n28| // func main creates a starting point for Go\\n29| //\\n30| // After compiling the code,\\n31| func main() {\\n32| func main() {\\n33| \\t// after: import \\\"fmt\\\"\\n34| \\t// Println function of \\\"fmt\\\" package becomes available\\n35| \\n36| \\t// Look at what it looks like by typing in the console:\\n```\\n\\n\",\"tool_call_id\":\"call_WcfEj9DQooqbUVduTRrsTR4k\",\"role\":\"tool\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/sourcegraph_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use sourcegraph to search for 'func main' in Go repositories\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"call_Gb0N6CATgy5P2XAarqc2RAlt\",\"function\":{\"arguments\":\"{\\\"query\\\":\\\"lang:go \\\\\\\"func main\\\\\\\"\\\", \\\"count\\\": 10, \\\"context_window\\\": 5}\",\"name\":\"sourcegraph\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"# Sourcegraph Search Results\\n\\nFound 30 matches across 30 results\\n(Result limit reached, try a more specific query)\\n\\n## Result 1: github.com/wx-chevalier/Go-Notes/99~参考资料/2017~A Huge Number of Go Examples/codes/first/first/main.go\\n\\nURL: /github.com/wx-chevalier/Go-Notes/-/blob/99~%E5%8F%82%E8%80%83%E8%B5%84%E6%96%99/2017~A%20Huge%20Number%20of%20Go%20Examples/codes/first/first/main.go\\n\\n```\\n11| \\n12| import \\\"fmt\\\" lets you access fmt package's functionality\\n13| here in this file.\\n14| */\\n15| import \\\"fmt\\\"\\n16| // \\\"func main\\\" is special.\\n17| // \\\"func main\\\" is special.\\n18| //\\n19| // Go has to know where to start\\n20| //\\n21| // func main creates a starting point for Go\\n```\\n\\n```\\n19| // Go has to know where to start\\n20| //\\n21| // func main creates a starting point for Go\\n22| //\\n23| // After compiling the code,\\n24| func main() {\\n25| func main() {\\n26| \\t// after: import \\\"fmt\\\"\\n27| \\t// Println function of \\\"fmt\\\" package becomes available\\n28| \\n29| \\t// Look at what it looks like by typing in the console:\\n```\\n\\n```\\n15| import \\\"fmt\\\"\\n16| \\n17| // \\\"func main\\\" is special.\\n18| //\\n19| // Go has to know where to start\\n20| // func main creates a starting point for Go\\n21| // func main creates a starting point for Go\\n22| //\\n23| // After compiling the code,\\n24| // Go runtime will first run this function\\n25| func main() {\\n```\\n\\n```\\n34| \\n35| \\t// Exported = First Letter is uppercase\\n36| \\tfmt.Println(\\\"Hello Gopher!\\\")\\n37| \\n38| \\t// Go cannot call Println function by itself.\\n39| \\t// It only calls `func main` automatically.\\n40| \\t// It only calls `func main` automatically.\\n41| \\n42| \\t// -----\\n43| \\n44| \\t// Go supports Unicode characters in string literals\\n```\\n\\n## Result 2: github.com/wx-chevalier/Go-Notes/99~参考资料/2017~A Huge Number of Go Examples/codes/02-write-your-first-program/main.go\\n\\nURL: /github.com/wx-chevalier/Go-Notes/-/blob/99~%E5%8F%82%E8%80%83%E8%B5%84%E6%96%99/2017~A%20Huge%20Number%20of%20Go%20Examples/codes/02-write-your-first-program/main.go\\n\\n```\\n11| \\n12| import \\\"fmt\\\" lets you access fmt package's functionality\\n13| here in this file.\\n14| */\\n15| import \\\"fmt\\\"\\n16| // \\\"func main\\\" is special.\\n17| // \\\"func main\\\" is special.\\n18| //\\n19| // Go has to know where to start\\n20| //\\n21| // func main creates a starting point for Go\\n```\\n\\n```\\n19| // Go has to know where to start\\n20| //\\n21| // func main creates a starting point for Go\\n22| //\\n23| // After compiling the code,\\n24| func main() {\\n25| func main() {\\n26| \\t// after: import \\\"fmt\\\"\\n27| \\t// Println function of \\\"fmt\\\" package becomes available\\n28| \\n29| \\t// Look at what it looks like by typing in the console:\\n```\\n\\n```\\n15| import \\\"fmt\\\"\\n16| \\n17| // \\\"func main\\\" is special.\\n18| //\\n19| // Go has to know where to start\\n20| // func main creates a starting point for Go\\n21| // func main creates a starting point for Go\\n22| //\\n23| // After compiling the code,\\n24| // Go runtime will first run this function\\n25| func main() {\\n```\\n\\n```\\n34| \\n35| \\t// Exported = First Letter is uppercase\\n36| \\tfmt.Println(\\\"Hello Gopher!\\\")\\n37| \\n38| \\t// Go cannot call Println function by itself.\\n39| \\t// It only calls `func main` automatically.\\n40| \\t// It only calls `func main` automatically.\\n41| \\n42| \\t// -----\\n43| \\n44| \\t// Go supports Unicode characters in string literals\\n```\\n\\n## Result 3: github.com/wx-chevalier/Go-Notes/99~参考资料/2018~《Learn Go》/translation/chinese/02-编写第一个程序/main.go\\n\\nURL: /github.com/wx-chevalier/Go-Notes/-/blob/99~%E5%8F%82%E8%80%83%E8%B5%84%E6%96%99/2018~%E3%80%8ALearn%20Go%E3%80%8B/translation/chinese/02-%E7%BC%96%E5%86%99%E7%AC%AC%E4%B8%80%E4%B8%AA%E7%A8%8B%E5%BA%8F/main.go\\n\\n```\\n18| \\n19| import \\\"fmt\\\" 允许你使用 fmt 包的各种函数\\n20| 在这个文件\\n21| */\\n22| import \\\"fmt\\\"\\n23| // \\\"func main\\\" 是特殊的\\n24| // \\\"func main\\\" 是特殊的\\n25| //\\n26| // Go 必须知道从哪里开始执行\\n27| //\\n28| // func main 对于 Go 而言就是开始执行的位置\\n```\\n\\n```\\n26| // Go 必须知道从哪里开始执行\\n27| //\\n28| // func main 对于 Go 而言就是开始执行的位置\\n29| //\\n30| // 代码编译后,\\n31| func main() {\\n32| func main() {\\n33| \\t// import \\\"fmt\\\" 之后\\n34| \\t// \\\"fmt\\\" 包中的 Println 函数就可以使用\\n35| \\n36| \\t// 在控制台输入下面的命令可以查看它的源代码:\\n```\\n\\n```\\n41| \\n42| \\t// Exported = 首字母大写\\n43| \\tfmt.Println(\\\"Hello Gopher!\\\")\\n44| \\n45| \\t// Go 本身不能调用 Println 函数\\n46| \\t// Go 只能自动地调用 `func main`\\n47| \\t// Go 只能自动地调用 `func main`\\n48| \\n49| \\t// -----\\n50| \\n51| \\t// Go 字符串支持 Unicode 字符\\n```\\n\\n```\\n22| import \\\"fmt\\\"\\n23| \\n24| // \\\"func main\\\" 是特殊的\\n25| //\\n26| // Go 必须知道从哪里开始执行\\n27| // func main 对于 Go 而言就是开始执行的位置\\n28| // func main 对于 Go 而言就是开始执行的位置\\n29| //\\n30| // 代码编译后,\\n31| // Go runtime 第一个执行该函数\\n32| func main() {\\n```\\n\\n## Result 4: github.com/wx-chevalier/Go-Notes/99~参考资料/2018~《Learn Go》/first/first/main.go\\n\\nURL: /github.com/wx-chevalier/Go-Notes/-/blob/99~%E5%8F%82%E8%80%83%E8%B5%84%E6%96%99/2018~%E3%80%8ALearn%20Go%E3%80%8B/first/first/main.go\\n\\n```\\n18| \\n19| import \\\"fmt\\\" lets you access fmt package's functionality\\n20| here in this file.\\n21| */\\n22| import \\\"fmt\\\"\\n23| // \\\"func main\\\" is special.\\n24| // \\\"func main\\\" is special.\\n25| //\\n26| // Go has to know where to start\\n27| //\\n28| // func main creates a starting point for Go\\n```\\n\\n```\\n26| // Go has to know where to start\\n27| //\\n28| // func main creates a starting point for Go\\n29| //\\n30| // After compiling the code,\\n31| func main() {\\n32| func main() {\\n33| \\t// after: import \\\"fmt\\\"\\n34| \\t// Println function of \\\"fmt\\\" package becomes available\\n35| \\n36| \\t// Look at what it looks like by typing in the console:\\n```\\n\\n```\\n22| import \\\"fmt\\\"\\n23| \\n24| // \\\"func main\\\" is special.\\n25| //\\n26| // Go has to know where to start\\n27| // func main creates a starting point for Go\\n28| // func main creates a starting point for Go\\n29| //\\n30| // After compiling the code,\\n31| // Go runtime will first run this function\\n32| func main() {\\n```\\n\\n```\\n41| \\n42| \\t// Exported = First Letter is uppercase\\n43| \\tfmt.Println(\\\"Hello Gopher!\\\")\\n44| \\n45| \\t// Go cannot call Println function by itself.\\n46| \\t// It only calls `func main` automatically.\\n47| \\t// It only calls `func main` automatically.\\n48| \\n49| \\t// -----\\n50| \\n51| \\t// Go supports Unicode characters in string literals\\n```\\n\\n## Result 5: github.com/wx-chevalier/Go-Notes/99~参考资料/2018~《Learn Go》/translation/spanish/02-tu-primer-programa/main.go\\n\\nURL: /github.com/wx-chevalier/Go-Notes/-/blob/99~%E5%8F%82%E8%80%83%E8%B5%84%E6%96%99/2018~%E3%80%8ALearn%20Go%E3%80%8B/translation/spanish/02-tu-primer-programa/main.go\\n\\n```\\n18| \\n19| import \\\"fmt\\\" te permite acceder a la funcionaliddad del paquete fmt\\n20| en este archivo.\\n21| */\\n22| import \\\"fmt\\\"\\n23| // \\\"func main\\\" es especial.\\n24| // \\\"func main\\\" es especial.\\n25| //\\n26| // Go tiene que saber por donde empezar\\n27| //\\n28| // func main crea un punto de inicio para Go\\n```\\n\\n```\\n26| // Go tiene que saber por donde empezar\\n27| //\\n28| // func main crea un punto de inicio para Go\\n29| //\\n30| // Después de compilar el codigo,\\n31| func main() {\\n32| func main() {\\n33| \\t// después del: import \\\"fmt\\\"\\n34| \\t// La función Println del paquete \\\"fmt\\\" estará disponible\\n35| \\n36| \\t// Lee sobre ella escribiendo los siguiente en la consola:\\n```\\n\\n```\\n22| import \\\"fmt\\\"\\n23| \\n24| // \\\"func main\\\" es especial.\\n25| //\\n26| // Go tiene que saber por donde empezar\\n27| // func main crea un punto de inicio para Go\\n28| // func main crea un punto de inicio para Go\\n29| //\\n30| // Después de compilar el codigo,\\n31| // Go ejecutará esta función primero.\\n32| func main() {\\n```\\n\\n```\\n42| \\t// Para poder exportar una función tendrás que escribir el\\n43| \\t// primer caracter del nombre de la función en mayúscula.\\n44| \\tfmt.Println(\\\"Hello Gopher!\\\")\\n45| \\n46| \\t// Go no puede llamar a la función Println por si mismo.\\n47| \\t// Solo llama a la `func main` de forma automatica.\\n48| \\t// Solo llama a la `func main` de forma automatica.\\n49| \\n50| \\t// -----\\n51| \\n52| \\t// Go soporta caracteres unicode en cadenas de texto literal\\n```\\n\\n## Result 6: github.com/wx-chevalier/Go-Notes/99~参考资料/2018~《Learn Go》/02-write-your-first-program/main.go\\n\\nURL: /github.com/wx-chevalier/Go-Notes/-/blob/99~%E5%8F%82%E8%80%83%E8%B5%84%E6%96%99/2018~%E3%80%8ALearn%20Go%E3%80%8B/02-write-your-first-program/main.go\\n\\n```\\n18| \\n19| import \\\"fmt\\\" lets you access fmt package's functionality\\n20| here in this file.\\n21| */\\n22| import \\\"fmt\\\"\\n23| // \\\"func main\\\" is special.\\n24| // \\\"func main\\\" is special.\\n25| //\\n26| // Go has to know where to start\\n27| //\\n28| // func main creates a starting point for Go\\n```\\n\\n```\\n26| // Go has to know where to start\\n27| //\\n28| // func main creates a starting point for Go\\n29| //\\n30| // After compiling the code,\\n31| func main() {\\n32| func main() {\\n33| \\t// after: import \\\"fmt\\\"\\n34| \\t// Println function of \\\"fmt\\\" package becomes available\\n35| \\n36| \\t// Look at what it looks like by typing in the console:\\n```\\n\\n```\\n22| import \\\"fmt\\\"\\n23| \\n24| // \\\"func main\\\" is special.\\n25| //\\n26| // Go has to know where to start\\n27| // func main creates a starting point for Go\\n28| // func main creates a starting point for Go\\n29| //\\n30| // After compiling the code,\\n31| // Go runtime will first run this function\\n32| func main() {\\n```\\n\\n```\\n41| \\n42| \\t// Exported = First Letter is uppercase\\n43| \\tfmt.Println(\\\"Hello Gopher!\\\")\\n44| \\n45| \\t// Go cannot call Println function by itself.\\n46| \\t// It only calls `func main` automatically.\\n47| \\t// It only calls `func main` automatically.\\n48| \\n49| \\t// -----\\n50| \\n51| \\t// Go supports Unicode characters in string literals\\n```\\n\\n## Result 7: github.com/ShixiangWang/self-study/go/learngo/first/first/main.go\\n\\nURL: /github.com/ShixiangWang/self-study/-/blob/go/learngo/first/first/main.go\\n\\n```\\n18| \\n19| import \\\"fmt\\\" lets you access fmt package's functionality\\n20| here in this file.\\n21| */\\n22| import \\\"fmt\\\"\\n23| // \\\"func main\\\" is special.\\n24| // \\\"func main\\\" is special.\\n25| //\\n26| // Go has to know where to start\\n27| //\\n28| // func main creates a starting point for Go\\n```\\n\\n```\\n26| // Go has to know where to start\\n27| //\\n28| // func main creates a starting point for Go\\n29| //\\n30| // After compiling the code,\\n31| func main() {\\n32| func main() {\\n33| \\t// after: import \\\"fmt\\\"\\n34| \\t// Println function of \\\"fmt\\\" package becomes available\\n35| \\n36| \\t// Look at what it looks like by typing in the console:\\n```\\n\\n```\\n22| import \\\"fmt\\\"\\n23| \\n24| // \\\"func main\\\" is special.\\n25| //\\n26| // Go has to know where to start\\n27| // func main creates a starting point for Go\\n28| // func main creates a starting point for Go\\n29| //\\n30| // After compiling the code,\\n31| // Go runtime will first run this function\\n32| func main() {\\n```\\n\\n```\\n41| \\n42| \\t// Exported = First Letter is uppercase\\n43| \\tfmt.Println(\\\"Hello Gopher!\\\")\\n44| \\n45| \\t// Go cannot call Println function by itself.\\n46| \\t// It only calls `func main` automatically.\\n47| \\t// It only calls `func main` automatically.\\n48| \\n49| \\t// -----\\n50| \\n51| \\t// Go supports Unicode characters in string literals\\n```\\n\\n## Result 8: github.com/ShixiangWang/self-study/go/learngo/02-write-your-first-program/main.go\\n\\nURL: /github.com/ShixiangWang/self-study/-/blob/go/learngo/02-write-your-first-program/main.go\\n\\n```\\n18| \\n19| import \\\"fmt\\\" lets you access fmt package's functionality\\n20| here in this file.\\n21| */\\n22| import \\\"fmt\\\"\\n23| // \\\"func main\\\" is special.\\n24| // \\\"func main\\\" is special.\\n25| //\\n26| // Go has to know where to start\\n27| //\\n28| // func main creates a starting point for Go\\n```\\n\\n```\\n26| // Go has to know where to start\\n27| //\\n28| // func main creates a starting point for Go\\n29| //\\n30| // After compiling the code,\\n31| func main() {\\n32| func main() {\\n33| \\t// after: import \\\"fmt\\\"\\n34| \\t// Println function of \\\"fmt\\\" package becomes available\\n35| \\n36| \\t// Look at what it looks like by typing in the console:\\n```\\n\\n\",\"tool_call_id\":\"call_Gb0N6CATgy5P2XAarqc2RAlt\",\"role\":\"tool\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" headers: Accept: - application/json @@ -196,155 +196,155 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"9dWs39D8jn"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"MEFPTIyvSV"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"Query"},"finish_reason":null}],"usage":null,"obfuscation":"5m49ZN2"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"Query"},"finish_reason":null}],"usage":null,"obfuscation":"c7Y209y"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":":"},"finish_reason":null}],"usage":null,"obfuscation":"CxDBYTMrQFp"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":":"},"finish_reason":null}],"usage":null,"obfuscation":"SwXD4fxiBSz"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" lang"},"finish_reason":null}],"usage":null,"obfuscation":"dvJBGIQ"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" lang"},"finish_reason":null}],"usage":null,"obfuscation":"OzDj4kt"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":":"},"finish_reason":null}],"usage":null,"obfuscation":"TNOrJISudB4"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":":"},"finish_reason":null}],"usage":null,"obfuscation":"n4haOtHePua"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"go"},"finish_reason":null}],"usage":null,"obfuscation":"fF2s5RmUpw"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"go"},"finish_reason":null}],"usage":null,"obfuscation":"nFldr0UKNv"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" \""},"finish_reason":null}],"usage":null,"obfuscation":"kE01RAKUl"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" \""},"finish_reason":null}],"usage":null,"obfuscation":"4wb4Ssgtu"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"func"},"finish_reason":null}],"usage":null,"obfuscation":"SFLMh3Yc"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"func"},"finish_reason":null}],"usage":null,"obfuscation":"0qU8Kpf8"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" main"},"finish_reason":null}],"usage":null,"obfuscation":"udTIfBb"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" main"},"finish_reason":null}],"usage":null,"obfuscation":"zZJqsac"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"\""},"finish_reason":null}],"usage":null,"obfuscation":"qLQs1NztNZ"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"\"\n"},"finish_reason":null}],"usage":null,"obfuscation":"xWtsYtx9"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" type"},"finish_reason":null}],"usage":null,"obfuscation":"LpU3sly"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"30"},"finish_reason":null}],"usage":null,"obfuscation":"0Ru7kCnHib"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":":file"},"finish_reason":null}],"usage":null,"obfuscation":"Z4zxWOO"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" matches"},"finish_reason":null}],"usage":null,"obfuscation":"vuLm"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"\n\n"},"finish_reason":null}],"usage":null,"obfuscation":"CMvok8xD"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" ("},"finish_reason":null}],"usage":null,"obfuscation":"h80UKlmVwc"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"Top"},"finish_reason":null}],"usage":null,"obfuscation":"Pt1SB2w2u"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"limit"},"finish_reason":null}],"usage":null,"obfuscation":"sZXWZ1O"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" results"},"finish_reason":null}],"usage":null,"obfuscation":"dKkQ"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":")."},"finish_reason":null}],"usage":null,"obfuscation":"tNOMvF3ZKK"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":":"},"finish_reason":null}],"usage":null,"obfuscation":"7OKziAjSphT"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" Examples"},"finish_reason":null}],"usage":null,"obfuscation":"rfX"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" github"},"finish_reason":null}],"usage":null,"obfuscation":"wXTmo"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":":\n"},"finish_reason":null}],"usage":null,"obfuscation":"u22xWfemn"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":".com"},"finish_reason":null}],"usage":null,"obfuscation":"keMWdoHx"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"github"},"finish_reason":null}],"usage":null,"obfuscation":"L7liWW"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"/in"},"finish_reason":null}],"usage":null,"obfuscation":"5r02WsW4f"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":".com"},"finish_reason":null}],"usage":null,"obfuscation":"dOS6lkoZ"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"anc"},"finish_reason":null}],"usage":null,"obfuscation":"CjyK5yxgW"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"/w"},"finish_reason":null}],"usage":null,"obfuscation":"iT1J01HBWQ"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"gum"},"finish_reason":null}],"usage":null,"obfuscation":"je1FH3go9"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"x"},"finish_reason":null}],"usage":null,"obfuscation":"b8Yopc75oDz"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"us"},"finish_reason":null}],"usage":null,"obfuscation":"7hTAVt8pKh"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"-che"},"finish_reason":null}],"usage":null,"obfuscation":"KXMzisGC"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"/"},"finish_reason":null}],"usage":null,"obfuscation":"Qjc1AOzz8on"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"val"},"finish_reason":null}],"usage":null,"obfuscation":"GPWqCm02N"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"lear"},"finish_reason":null}],"usage":null,"obfuscation":"Ip2A6nan"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"ier"},"finish_reason":null}],"usage":null,"obfuscation":"V91LoOYFv"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"ngo"},"finish_reason":null}],"usage":null,"obfuscation":"llT0K0hg4"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"/"},"finish_reason":null}],"usage":null,"obfuscation":"niREtqkM21i"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"/"},"finish_reason":null}],"usage":null,"obfuscation":"xRW7aSg2Tl2"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"Go"},"finish_reason":null}],"usage":null,"obfuscation":"vrENHvw8nL"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"translation"},"finish_reason":null}],"usage":null,"obfuscation":"u"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"-"},"finish_reason":null}],"usage":null,"obfuscation":"bIcQ5yvN0hX"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"/ch"},"finish_reason":null}],"usage":null,"obfuscation":"NrTLXvypj"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"Notes"},"finish_reason":null}],"usage":null,"obfuscation":"MYe7PAS"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"inese"},"finish_reason":null}],"usage":null,"obfuscation":"tuxyN17"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"/..."},"finish_reason":null}],"usage":null,"obfuscation":"7Son1sKr"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"/"},"finish_reason":null}],"usage":null,"obfuscation":"pah7lq6j9UV"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"/"},"finish_reason":null}],"usage":null,"obfuscation":"rc6R9CUBfcu"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"02"},"finish_reason":null}],"usage":null,"obfuscation":"IF4xNLjTMG"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"first"},"finish_reason":null}],"usage":null,"obfuscation":"6N1DkuH"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"-"},"finish_reason":null}],"usage":null,"obfuscation":"DozkaLe6FSq"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"/"},"finish_reason":null}],"usage":null,"obfuscation":"qNqwpvAP8Oz"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"编"},"finish_reason":null}],"usage":null,"obfuscation":"UFMUFS25Gmj"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"first"},"finish_reason":null}],"usage":null,"obfuscation":"rDMYU8R"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"写"},"finish_reason":null}],"usage":null,"obfuscation":"4IiW0xmECij"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"/main"},"finish_reason":null}],"usage":null,"obfuscation":"ic59ivo"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"第"},"finish_reason":null}],"usage":null,"obfuscation":"OAcKeTwyU1r"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":".go"},"finish_reason":null}],"usage":null,"obfuscation":"pA8rKUjQW"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"一个"},"finish_reason":null}],"usage":null,"obfuscation":"zQHdrKGsKQ"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":";"},"finish_reason":null}],"usage":null,"obfuscation":"P2WlFVizdUl"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"程序"},"finish_reason":null}],"usage":null,"obfuscation":"1kPMAACHoj"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" github"},"finish_reason":null}],"usage":null,"obfuscation":"yph1V"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"/main"},"finish_reason":null}],"usage":null,"obfuscation":"FZLmLb1"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":".com"},"finish_reason":null}],"usage":null,"obfuscation":"wfJvOWzj"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":".go"},"finish_reason":null}],"usage":null,"obfuscation":"yttiOZaB3"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"/w"},"finish_reason":null}],"usage":null,"obfuscation":"hig1ggz4F3"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":";"},"finish_reason":null}],"usage":null,"obfuscation":"ObTVYahQ2HV"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"x"},"finish_reason":null}],"usage":null,"obfuscation":"SkhSPMQ2AAB"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" github"},"finish_reason":null}],"usage":null,"obfuscation":"Ibe5Y"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"-che"},"finish_reason":null}],"usage":null,"obfuscation":"zeZZc63u"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":".com"},"finish_reason":null}],"usage":null,"obfuscation":"g2DWdjtx"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"val"},"finish_reason":null}],"usage":null,"obfuscation":"7Oo68cmsF"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"/in"},"finish_reason":null}],"usage":null,"obfuscation":"vhLXVJCem"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"ier"},"finish_reason":null}],"usage":null,"obfuscation":"sNSL7TW9Q"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"anc"},"finish_reason":null}],"usage":null,"obfuscation":"qZyCcvDtQ"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"/"},"finish_reason":null}],"usage":null,"obfuscation":"zCq2UVMYcCC"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"gum"},"finish_reason":null}],"usage":null,"obfuscation":"QrOkBO039"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"Go"},"finish_reason":null}],"usage":null,"obfuscation":"G3pyjZf4EC"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"us"},"finish_reason":null}],"usage":null,"obfuscation":"0FiFwdfqmM"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"-"},"finish_reason":null}],"usage":null,"obfuscation":"I5vw6NRokXY"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"/"},"finish_reason":null}],"usage":null,"obfuscation":"VEZ21QlmtfV"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"Notes"},"finish_reason":null}],"usage":null,"obfuscation":"JckNKYp"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"lear"},"finish_reason":null}],"usage":null,"obfuscation":"Qnca1uDw"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"/..."},"finish_reason":null}],"usage":null,"obfuscation":"MZIUCWel"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"ngo"},"finish_reason":null}],"usage":null,"obfuscation":"uL3Mg1Lm0"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"/"},"finish_reason":null}],"usage":null,"obfuscation":"anSt8Mze7gH"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"/"},"finish_reason":null}],"usage":null,"obfuscation":"kiEubDnLzDZ"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"02"},"finish_reason":null}],"usage":null,"obfuscation":"JnipOzSYTp"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"first"},"finish_reason":null}],"usage":null,"obfuscation":"OdPcUtw"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"-write"},"finish_reason":null}],"usage":null,"obfuscation":"VNQmCy"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"/"},"finish_reason":null}],"usage":null,"obfuscation":"JGnMSslPQjo"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"-your"},"finish_reason":null}],"usage":null,"obfuscation":"QDqNuyV"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"first"},"finish_reason":null}],"usage":null,"obfuscation":"jH2WvIZ"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"-first"},"finish_reason":null}],"usage":null,"obfuscation":"ddjLAc"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"/main"},"finish_reason":null}],"usage":null,"obfuscation":"TQBsYGv"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"-program"},"finish_reason":null}],"usage":null,"obfuscation":"eYJU"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":".go"},"finish_reason":null}],"usage":null,"obfuscation":"fEQSWfhJw"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"/main"},"finish_reason":null}],"usage":null,"obfuscation":"ZDsRTtK"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":";"},"finish_reason":null}],"usage":null,"obfuscation":"iXuC48OkFuJ"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":".go"},"finish_reason":null}],"usage":null,"obfuscation":"U8HXLG8H2"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" github"},"finish_reason":null}],"usage":null,"obfuscation":"zXNfM"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":";"},"finish_reason":null}],"usage":null,"obfuscation":"4c045KkHwRK"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":".com"},"finish_reason":null}],"usage":null,"obfuscation":"pbSDJR2B"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" github"},"finish_reason":null}],"usage":null,"obfuscation":"mrwPl"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"/in"},"finish_reason":null}],"usage":null,"obfuscation":"XxaKDFLAu"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":".com"},"finish_reason":null}],"usage":null,"obfuscation":"ZXe2N6du"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"anc"},"finish_reason":null}],"usage":null,"obfuscation":"sSBEfWOj9"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"/Sh"},"finish_reason":null}],"usage":null,"obfuscation":"OH0LdpNtE"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"gum"},"finish_reason":null}],"usage":null,"obfuscation":"iOZ1Lmnxw"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"ixi"},"finish_reason":null}],"usage":null,"obfuscation":"CRm126jXe"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"us"},"finish_reason":null}],"usage":null,"obfuscation":"8IZHusVZyY"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"ang"},"finish_reason":null}],"usage":null,"obfuscation":"xwt5JlDBq"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"/"},"finish_reason":null}],"usage":null,"obfuscation":"oMiNwx0OOOh"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"W"},"finish_reason":null}],"usage":null,"obfuscation":"lMOwcuDRXwP"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"lear"},"finish_reason":null}],"usage":null,"obfuscation":"mcJD0yDq"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"ang"},"finish_reason":null}],"usage":null,"obfuscation":"pfx47Yaq7"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"ngo"},"finish_reason":null}],"usage":null,"obfuscation":"VoVsKth34"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"/self"},"finish_reason":null}],"usage":null,"obfuscation":"JbfmI47"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"/"},"finish_reason":null}],"usage":null,"obfuscation":"cxnsiPwqxa2"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"-study"},"finish_reason":null}],"usage":null,"obfuscation":"H7UYXf"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"02"},"finish_reason":null}],"usage":null,"obfuscation":"Kag2NMvOWN"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"/..."},"finish_reason":null}],"usage":null,"obfuscation":"h8T3yENf"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"-write"},"finish_reason":null}],"usage":null,"obfuscation":"zMUvCm"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"/"},"finish_reason":null}],"usage":null,"obfuscation":"bCngSLaDUeU"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"-your"},"finish_reason":null}],"usage":null,"obfuscation":"F5sQbsf"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"first"},"finish_reason":null}],"usage":null,"obfuscation":"UwXEhNb"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"-first"},"finish_reason":null}],"usage":null,"obfuscation":"bZs4PS"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"/"},"finish_reason":null}],"usage":null,"obfuscation":"oplvF4nWpfe"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"-program"},"finish_reason":null}],"usage":null,"obfuscation":"cS1O"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"first"},"finish_reason":null}],"usage":null,"obfuscation":"JjW6Dkg"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"/main"},"finish_reason":null}],"usage":null,"obfuscation":"uSmmxEo"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"/main"},"finish_reason":null}],"usage":null,"obfuscation":"ADVVqEF"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":".go"},"finish_reason":null}],"usage":null,"obfuscation":"7wZMfZmVO"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":".go"},"finish_reason":null}],"usage":null,"obfuscation":"3sC4kOdHe"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"stop"}],"usage":null,"obfuscation":"XHb0tw"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"stop"}],"usage":null,"obfuscation":"EU3Y1O"} - data: {"id":"chatcmpl-CLuBHvDiVr0sRWkDl3zS1bb9dVnCO","object":"chat.completion.chunk","created":1759336883,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":10203,"completion_tokens":849,"total_tokens":11052,"prompt_tokens_details":{"cached_tokens":6528,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":768,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"q3F0bXXhlTmmGWB"} + data: {"id":"chatcmpl-CLuUuXKFKmnZCLyJ7bvMsvzPrmCmX","object":"chat.completion.chunk","created":1759338100,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":10423,"completion_tokens":721,"total_tokens":11144,"prompt_tokens_details":{"cached_tokens":6528,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":640,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"dvhefAstnRBRzyi"} data: [DONE] @@ -353,4 +353,4 @@ interactions: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 23.918505875s + duration: 18.216821s diff --git a/internal/agent/testdata/TestCoderAgent/openai-gpt-5/update_a_file.yaml b/internal/agent/testdata/TestCoderAgent/openai-gpt-5/update_a_file.yaml index 6a9d44f495a729438394cb37f00f38ff58010756..fb867d1eafa81bab221884c02c2df4fc2c7fae4c 100644 --- a/internal/agent/testdata/TestCoderAgent/openai-gpt-5/update_a_file.yaml +++ b/internal/agent/testdata/TestCoderAgent/openai-gpt-5/update_a_file.yaml @@ -24,25 +24,25 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"chatcmpl-CLu84UhzdZ1zrRIhmtT16922Ut9HJ","object":"chat.completion.chunk","created":1759336684,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"PDwMpyDrrIjjgI"} + data: {"id":"chatcmpl-CLuSIABs2T781fy3TB5oxKKq1rp7R","object":"chat.completion.chunk","created":1759337938,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"ik4ONex1kYkXvD"} - data: {"id":"chatcmpl-CLu84UhzdZ1zrRIhmtT16922Ut9HJ","object":"chat.completion.chunk","created":1759336684,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"Update"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"z0nOLpLNiD"} + data: {"id":"chatcmpl-CLuSIABs2T781fy3TB5oxKKq1rp7R","object":"chat.completion.chunk","created":1759337938,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":"Update"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"FcPhRIjBE2"} - data: {"id":"chatcmpl-CLu84UhzdZ1zrRIhmtT16922Ut9HJ","object":"chat.completion.chunk","created":1759336684,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Print"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"TW54tBWj2U"} + data: {"id":"chatcmpl-CLuSIABs2T781fy3TB5oxKKq1rp7R","object":"chat.completion.chunk","created":1759337938,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" main"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"UGUa348zEJV"} - data: {"id":"chatcmpl-CLu84UhzdZ1zrRIhmtT16922Ut9HJ","object":"chat.completion.chunk","created":1759336684,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Statement"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"0AK5rV"} + data: {"id":"chatcmpl-CLuSIABs2T781fy3TB5oxKKq1rp7R","object":"chat.completion.chunk","created":1759337938,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":".go"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"RxmOnRcqO2SHa"} - data: {"id":"chatcmpl-CLu84UhzdZ1zrRIhmtT16922Ut9HJ","object":"chat.completion.chunk","created":1759336684,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" in"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"KLlpTIwoYd3E9"} + data: {"id":"chatcmpl-CLuSIABs2T781fy3TB5oxKKq1rp7R","object":"chat.completion.chunk","created":1759337938,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":":"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"OFfCbzKVKZXAmj2"} - data: {"id":"chatcmpl-CLu84UhzdZ1zrRIhmtT16922Ut9HJ","object":"chat.completion.chunk","created":1759336684,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Main"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"QvEJY0flWco"} + data: {"id":"chatcmpl-CLuSIABs2T781fy3TB5oxKKq1rp7R","object":"chat.completion.chunk","created":1759337938,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Change"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"bEQ7drkAq"} - data: {"id":"chatcmpl-CLu84UhzdZ1zrRIhmtT16922Ut9HJ","object":"chat.completion.chunk","created":1759336684,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":".go"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"KCaffuNe2cXj9"} + data: {"id":"chatcmpl-CLuSIABs2T781fy3TB5oxKKq1rp7R","object":"chat.completion.chunk","created":1759337938,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Print"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"mku27xpqAg"} - data: {"id":"chatcmpl-CLu84UhzdZ1zrRIhmtT16922Ut9HJ","object":"chat.completion.chunk","created":1759336684,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" File"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"dtWpTnjJZsP"} + data: {"id":"chatcmpl-CLuSIABs2T781fy3TB5oxKKq1rp7R","object":"chat.completion.chunk","created":1759337938,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{"content":" Message"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"DaN2NEkg"} - data: {"id":"chatcmpl-CLu84UhzdZ1zrRIhmtT16922Ut9HJ","object":"chat.completion.chunk","created":1759336684,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"iOpTa9Rv9B"} + data: {"id":"chatcmpl-CLuSIABs2T781fy3TB5oxKKq1rp7R","object":"chat.completion.chunk","created":1759337938,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"bEaKtby0w2"} - data: {"id":"chatcmpl-CLu84UhzdZ1zrRIhmtT16922Ut9HJ","object":"chat.completion.chunk","created":1759336684,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[],"usage":{"prompt_tokens":122,"completion_tokens":7,"total_tokens":129,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"nXTHWpAsOLfx2Z"} + data: {"id":"chatcmpl-CLuSIABs2T781fy3TB5oxKKq1rp7R","object":"chat.completion.chunk","created":1759337938,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_cbf1785567","choices":[],"usage":{"prompt_tokens":122,"completion_tokens":7,"total_tokens":129,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"QRkc7kvcLB2QQ8"} data: [DONE] @@ -51,15 +51,15 @@ interactions: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 2.15164075s + duration: 516.295ms - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 30588 + content_length: 30661 host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/update_a_file\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"update the main.go file by changing the print to say hello from crush\",\"role\":\"user\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/update_a_file\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"update the main.go file by changing the print to say hello from crush\",\"role\":\"user\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" headers: Accept: - application/json @@ -75,53 +75,65 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"chatcmpl-CLu84z7y9qTMcNMcgsB1i4QoTHebV","object":"chat.completion.chunk","created":1759336684,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"call_1U6na1Eco9KjhdxIX6ZkvD5X","type":"function","function":{"name":"ls","arguments":""}}],"refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"DnIFdSmZI3s0ok"} + data: {"id":"chatcmpl-CLuSIuqpwbXPmspGagXpLurNI3yv6","object":"chat.completion.chunk","created":1759337938,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"call_IcfcVn3GDejckDVAwO8qTDrB","type":"function","function":{"name":"ls","arguments":""}}],"refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"BjWk8iAlMB3nzk"} - data: {"id":"chatcmpl-CLu84z7y9qTMcNMcgsB1i4QoTHebV","object":"chat.completion.chunk","created":1759336684,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"sPW20hrpzl70g5Q"} + data: {"id":"chatcmpl-CLuSIuqpwbXPmspGagXpLurNI3yv6","object":"chat.completion.chunk","created":1759337938,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"v9zuKyyvGXmpF8i"} - data: {"id":"chatcmpl-CLu84z7y9qTMcNMcgsB1i4QoTHebV","object":"chat.completion.chunk","created":1759336684,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"path"}}]},"finish_reason":null}],"usage":null,"obfuscation":"JVSE0KpYkBzYqj"} + data: {"id":"chatcmpl-CLuSIuqpwbXPmspGagXpLurNI3yv6","object":"chat.completion.chunk","created":1759337938,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"path"}}]},"finish_reason":null}],"usage":null,"obfuscation":"2T9OzOpw2TrcNU"} - data: {"id":"chatcmpl-CLu84z7y9qTMcNMcgsB1i4QoTHebV","object":"chat.completion.chunk","created":1759336684,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":"}}]},"finish_reason":null}],"usage":null,"obfuscation":"OgiELuBSANoCMjx"} + data: {"id":"chatcmpl-CLuSIuqpwbXPmspGagXpLurNI3yv6","object":"chat.completion.chunk","created":1759337938,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":"}}]},"finish_reason":null}],"usage":null,"obfuscation":"7hfyN7W0zEAgzDq"} - data: {"id":"chatcmpl-CLu84z7y9qTMcNMcgsB1i4QoTHebV","object":"chat.completion.chunk","created":1759336684,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" \"/"}}]},"finish_reason":null}],"usage":null,"obfuscation":"sLGWZtTktB9C64"} + data: {"id":"chatcmpl-CLuSIuqpwbXPmspGagXpLurNI3yv6","object":"chat.completion.chunk","created":1759337938,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" \"/"}}]},"finish_reason":null}],"usage":null,"obfuscation":"1eJ2hC0MJCMqmu"} - data: {"id":"chatcmpl-CLu84z7y9qTMcNMcgsB1i4QoTHebV","object":"chat.completion.chunk","created":1759336684,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"tmp"}}]},"finish_reason":null}],"usage":null,"obfuscation":"sfv9XMTX3LaIDYG"} + data: {"id":"chatcmpl-CLuSIuqpwbXPmspGagXpLurNI3yv6","object":"chat.completion.chunk","created":1759337938,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"tmp"}}]},"finish_reason":null}],"usage":null,"obfuscation":"LvnxL3tMabOrbcJ"} - data: {"id":"chatcmpl-CLu84z7y9qTMcNMcgsB1i4QoTHebV","object":"chat.completion.chunk","created":1759336684,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/cr"}}]},"finish_reason":null}],"usage":null,"obfuscation":"aWSxp9xosDNEwnu"} + data: {"id":"chatcmpl-CLuSIuqpwbXPmspGagXpLurNI3yv6","object":"chat.completion.chunk","created":1759337938,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/cr"}}]},"finish_reason":null}],"usage":null,"obfuscation":"DPpUCRlpPnkwsr5"} - data: {"id":"chatcmpl-CLu84z7y9qTMcNMcgsB1i4QoTHebV","object":"chat.completion.chunk","created":1759336684,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ush"}}]},"finish_reason":null}],"usage":null,"obfuscation":"qClfnSZJHLlZnmv"} + data: {"id":"chatcmpl-CLuSIuqpwbXPmspGagXpLurNI3yv6","object":"chat.completion.chunk","created":1759337938,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ush"}}]},"finish_reason":null}],"usage":null,"obfuscation":"hUbknqqSY9mXsFC"} - data: {"id":"chatcmpl-CLu84z7y9qTMcNMcgsB1i4QoTHebV","object":"chat.completion.chunk","created":1759336684,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"-test"}}]},"finish_reason":null}],"usage":null,"obfuscation":"aYE1NTvUYEC1O"} + data: {"id":"chatcmpl-CLuSIuqpwbXPmspGagXpLurNI3yv6","object":"chat.completion.chunk","created":1759337938,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"-test"}}]},"finish_reason":null}],"usage":null,"obfuscation":"EkQ9cTNXarJ42"} - data: {"id":"chatcmpl-CLu84z7y9qTMcNMcgsB1i4QoTHebV","object":"chat.completion.chunk","created":1759336684,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/Test"}}]},"finish_reason":null}],"usage":null,"obfuscation":"ngUN57KPIpF6Q"} + data: {"id":"chatcmpl-CLuSIuqpwbXPmspGagXpLurNI3yv6","object":"chat.completion.chunk","created":1759337938,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/Test"}}]},"finish_reason":null}],"usage":null,"obfuscation":"y3I7EapRpykhH"} - data: {"id":"chatcmpl-CLu84z7y9qTMcNMcgsB1i4QoTHebV","object":"chat.completion.chunk","created":1759336684,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Coder"}}]},"finish_reason":null}],"usage":null,"obfuscation":"yvAfec14c9fED"} + data: {"id":"chatcmpl-CLuSIuqpwbXPmspGagXpLurNI3yv6","object":"chat.completion.chunk","created":1759337938,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Coder"}}]},"finish_reason":null}],"usage":null,"obfuscation":"abQqF2EeLdZfA"} - data: {"id":"chatcmpl-CLu84z7y9qTMcNMcgsB1i4QoTHebV","object":"chat.completion.chunk","created":1759336684,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Agent"}}]},"finish_reason":null}],"usage":null,"obfuscation":"ox0wLn9NKochs"} + data: {"id":"chatcmpl-CLuSIuqpwbXPmspGagXpLurNI3yv6","object":"chat.completion.chunk","created":1759337938,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Agent"}}]},"finish_reason":null}],"usage":null,"obfuscation":"2ZIRBuHmkixoY"} - data: {"id":"chatcmpl-CLu84z7y9qTMcNMcgsB1i4QoTHebV","object":"chat.completion.chunk","created":1759336684,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/open"}}]},"finish_reason":null}],"usage":null,"obfuscation":"6fVYP51uqTyqb"} + data: {"id":"chatcmpl-CLuSIuqpwbXPmspGagXpLurNI3yv6","object":"chat.completion.chunk","created":1759337938,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/open"}}]},"finish_reason":null}],"usage":null,"obfuscation":"rmODCLed09mDY"} - data: {"id":"chatcmpl-CLu84z7y9qTMcNMcgsB1i4QoTHebV","object":"chat.completion.chunk","created":1759336684,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ai"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuSIuqpwbXPmspGagXpLurNI3yv6","object":"chat.completion.chunk","created":1759337938,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ai"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLu84z7y9qTMcNMcgsB1i4QoTHebV","object":"chat.completion.chunk","created":1759336684,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"-g"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuSIuqpwbXPmspGagXpLurNI3yv6","object":"chat.completion.chunk","created":1759337938,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"-g"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLu84z7y9qTMcNMcgsB1i4QoTHebV","object":"chat.completion.chunk","created":1759336684,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"pt"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuSIuqpwbXPmspGagXpLurNI3yv6","object":"chat.completion.chunk","created":1759337938,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"pt"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLu84z7y9qTMcNMcgsB1i4QoTHebV","object":"chat.completion.chunk","created":1759336684,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"-"}}]},"finish_reason":null}],"usage":null,"obfuscation":"g"} + data: {"id":"chatcmpl-CLuSIuqpwbXPmspGagXpLurNI3yv6","object":"chat.completion.chunk","created":1759337938,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"-"}}]},"finish_reason":null}],"usage":null,"obfuscation":"6"} - data: {"id":"chatcmpl-CLu84z7y9qTMcNMcgsB1i4QoTHebV","object":"chat.completion.chunk","created":1759336684,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"5"}}]},"finish_reason":null}],"usage":null,"obfuscation":"z"} + data: {"id":"chatcmpl-CLuSIuqpwbXPmspGagXpLurNI3yv6","object":"chat.completion.chunk","created":1759337938,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"5"}}]},"finish_reason":null}],"usage":null,"obfuscation":"4"} - data: {"id":"chatcmpl-CLu84z7y9qTMcNMcgsB1i4QoTHebV","object":"chat.completion.chunk","created":1759336684,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/update"}}]},"finish_reason":null}],"usage":null,"obfuscation":"chk9vdDYasC"} + data: {"id":"chatcmpl-CLuSIuqpwbXPmspGagXpLurNI3yv6","object":"chat.completion.chunk","created":1759337938,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/update"}}]},"finish_reason":null}],"usage":null,"obfuscation":"wGIDiHnNkbt"} - data: {"id":"chatcmpl-CLu84z7y9qTMcNMcgsB1i4QoTHebV","object":"chat.completion.chunk","created":1759336684,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_a"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuSIuqpwbXPmspGagXpLurNI3yv6","object":"chat.completion.chunk","created":1759337938,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_a"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLu84z7y9qTMcNMcgsB1i4QoTHebV","object":"chat.completion.chunk","created":1759336684,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_file"}}]},"finish_reason":null}],"usage":null,"obfuscation":"aXQ4XZqCUFOAj"} + data: {"id":"chatcmpl-CLuSIuqpwbXPmspGagXpLurNI3yv6","object":"chat.completion.chunk","created":1759337938,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_file"}}]},"finish_reason":null}],"usage":null,"obfuscation":"uT9yrrMfRUiUt"} - data: {"id":"chatcmpl-CLu84z7y9qTMcNMcgsB1i4QoTHebV","object":"chat.completion.chunk","created":1759336684,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"}"}}]},"finish_reason":null}],"usage":null,"obfuscation":"rCJmkS6sExUsTZF"} + data: {"id":"chatcmpl-CLuSIuqpwbXPmspGagXpLurNI3yv6","object":"chat.completion.chunk","created":1759337938,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\","}}]},"finish_reason":null}],"usage":null,"obfuscation":"3WGFRghvJ2HHRGF"} - data: {"id":"chatcmpl-CLu84z7y9qTMcNMcgsB1i4QoTHebV","object":"chat.completion.chunk","created":1759336684,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"tool_calls"}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuSIuqpwbXPmspGagXpLurNI3yv6","object":"chat.completion.chunk","created":1759337938,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" \""}}]},"finish_reason":null}],"usage":null,"obfuscation":"0smP1rLv0fo0iVs"} - data: {"id":"chatcmpl-CLu84z7y9qTMcNMcgsB1i4QoTHebV","object":"chat.completion.chunk","created":1759336684,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6555,"completion_tokens":231,"total_tokens":6786,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":192,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"VXch"} + data: {"id":"chatcmpl-CLuSIuqpwbXPmspGagXpLurNI3yv6","object":"chat.completion.chunk","created":1759337938,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"depth"}}]},"finish_reason":null}],"usage":null,"obfuscation":"TUHebxB8vx8br"} + + data: {"id":"chatcmpl-CLuSIuqpwbXPmspGagXpLurNI3yv6","object":"chat.completion.chunk","created":1759337938,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":"}}]},"finish_reason":null}],"usage":null,"obfuscation":"ftPjIOpltOrMr5J"} + + data: {"id":"chatcmpl-CLuSIuqpwbXPmspGagXpLurNI3yv6","object":"chat.completion.chunk","created":1759337938,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" "}}]},"finish_reason":null}],"usage":null,"obfuscation":"4"} + + data: {"id":"chatcmpl-CLuSIuqpwbXPmspGagXpLurNI3yv6","object":"chat.completion.chunk","created":1759337938,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"2"}}]},"finish_reason":null}],"usage":null,"obfuscation":"D"} + + data: {"id":"chatcmpl-CLuSIuqpwbXPmspGagXpLurNI3yv6","object":"chat.completion.chunk","created":1759337938,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"}"}}]},"finish_reason":null}],"usage":null,"obfuscation":"3"} + + data: {"id":"chatcmpl-CLuSIuqpwbXPmspGagXpLurNI3yv6","object":"chat.completion.chunk","created":1759337938,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"tool_calls"}],"usage":null,"obfuscation":""} + + data: {"id":"chatcmpl-CLuSIuqpwbXPmspGagXpLurNI3yv6","object":"chat.completion.chunk","created":1759337938,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6565,"completion_tokens":45,"total_tokens":6610,"prompt_tokens_details":{"cached_tokens":1024,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"MY6l"} data: [DONE] @@ -130,15 +142,15 @@ interactions: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 7.4756415s + duration: 2.050277125s - id: 2 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 30957 + content_length: 31046 host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/update_a_file\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"update the main.go file by changing the print to say hello from crush\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"call_1U6na1Eco9KjhdxIX6ZkvD5X\",\"function\":{\"arguments\":\"{\\\"path\\\": \\\"/tmp/crush-test/TestCoderAgent/openai-gpt-5/update_a_file\\\"}\",\"name\":\"ls\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"- /tmp/crush-test/TestCoderAgent/openai-gpt-5/update_a_file/\\n - go.mod\\n - main.go\\n\",\"tool_call_id\":\"call_1U6na1Eco9KjhdxIX6ZkvD5X\",\"role\":\"tool\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/update_a_file\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"update the main.go file by changing the print to say hello from crush\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"call_IcfcVn3GDejckDVAwO8qTDrB\",\"function\":{\"arguments\":\"{\\\"path\\\": \\\"/tmp/crush-test/TestCoderAgent/openai-gpt-5/update_a_file\\\", \\\"depth\\\": 2}\",\"name\":\"ls\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"\\n- /tmp/crush-test/TestCoderAgent/openai-gpt-5/update_a_file/\\n - go.mod\\n - main.go\\n\",\"tool_call_id\":\"call_IcfcVn3GDejckDVAwO8qTDrB\",\"role\":\"tool\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" headers: Accept: - application/json @@ -154,59 +166,59 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"chatcmpl-CLu8Bl45eOpFstLCUfCBD7YQChsDr","object":"chat.completion.chunk","created":1759336691,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"call_MvWgY6YVjEzAmq8kEt3995Mk","type":"function","function":{"name":"view","arguments":""}}],"refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"Myjvy0X4oVGf"} + data: {"id":"chatcmpl-CLuSKTcaZxAQhKWcADt4CHTG1lWL0","object":"chat.completion.chunk","created":1759337940,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"call_ReMIw0Q9IfSHd43DsxYRIQ0V","type":"function","function":{"name":"view","arguments":""}}],"refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"s6W3slK2ZBJl"} - data: {"id":"chatcmpl-CLu8Bl45eOpFstLCUfCBD7YQChsDr","object":"chat.completion.chunk","created":1759336691,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"u5avCuJQxHASMJt"} + data: {"id":"chatcmpl-CLuSKTcaZxAQhKWcADt4CHTG1lWL0","object":"chat.completion.chunk","created":1759337940,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"YTDzlwPDWRFNYwU"} - data: {"id":"chatcmpl-CLu8Bl45eOpFstLCUfCBD7YQChsDr","object":"chat.completion.chunk","created":1759336691,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"file"}}]},"finish_reason":null}],"usage":null,"obfuscation":"g8yCIMojTnh5IV"} + data: {"id":"chatcmpl-CLuSKTcaZxAQhKWcADt4CHTG1lWL0","object":"chat.completion.chunk","created":1759337940,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"file"}}]},"finish_reason":null}],"usage":null,"obfuscation":"Xe8ptcpB6fP3Vi"} - data: {"id":"chatcmpl-CLu8Bl45eOpFstLCUfCBD7YQChsDr","object":"chat.completion.chunk","created":1759336691,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_path"}}]},"finish_reason":null}],"usage":null,"obfuscation":"dbXR0Yc5FzMuw"} + data: {"id":"chatcmpl-CLuSKTcaZxAQhKWcADt4CHTG1lWL0","object":"chat.completion.chunk","created":1759337940,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_path"}}]},"finish_reason":null}],"usage":null,"obfuscation":"2aWEUEBL8wN17"} - data: {"id":"chatcmpl-CLu8Bl45eOpFstLCUfCBD7YQChsDr","object":"chat.completion.chunk","created":1759336691,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":"}}]},"finish_reason":null}],"usage":null,"obfuscation":"HtMeqDR5oQPwuMM"} + data: {"id":"chatcmpl-CLuSKTcaZxAQhKWcADt4CHTG1lWL0","object":"chat.completion.chunk","created":1759337940,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":"}}]},"finish_reason":null}],"usage":null,"obfuscation":"zgyLRAEPZvTp26m"} - data: {"id":"chatcmpl-CLu8Bl45eOpFstLCUfCBD7YQChsDr","object":"chat.completion.chunk","created":1759336691,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"/"}}]},"finish_reason":null}],"usage":null,"obfuscation":"SUAmWMbzjANZ8F2"} + data: {"id":"chatcmpl-CLuSKTcaZxAQhKWcADt4CHTG1lWL0","object":"chat.completion.chunk","created":1759337940,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"/"}}]},"finish_reason":null}],"usage":null,"obfuscation":"dCvSDNjqigrDto4"} - data: {"id":"chatcmpl-CLu8Bl45eOpFstLCUfCBD7YQChsDr","object":"chat.completion.chunk","created":1759336691,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"tmp"}}]},"finish_reason":null}],"usage":null,"obfuscation":"TYhrnD6WgOaiMyC"} + data: {"id":"chatcmpl-CLuSKTcaZxAQhKWcADt4CHTG1lWL0","object":"chat.completion.chunk","created":1759337940,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"tmp"}}]},"finish_reason":null}],"usage":null,"obfuscation":"XYjAgprTrRCfaD8"} - data: {"id":"chatcmpl-CLu8Bl45eOpFstLCUfCBD7YQChsDr","object":"chat.completion.chunk","created":1759336691,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/cr"}}]},"finish_reason":null}],"usage":null,"obfuscation":"CiqqFAn1MEckLag"} + data: {"id":"chatcmpl-CLuSKTcaZxAQhKWcADt4CHTG1lWL0","object":"chat.completion.chunk","created":1759337940,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/cr"}}]},"finish_reason":null}],"usage":null,"obfuscation":"z6UUed3KUF8j38J"} - data: {"id":"chatcmpl-CLu8Bl45eOpFstLCUfCBD7YQChsDr","object":"chat.completion.chunk","created":1759336691,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ush"}}]},"finish_reason":null}],"usage":null,"obfuscation":"rPuQsMmozYUMRe8"} + data: {"id":"chatcmpl-CLuSKTcaZxAQhKWcADt4CHTG1lWL0","object":"chat.completion.chunk","created":1759337940,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ush"}}]},"finish_reason":null}],"usage":null,"obfuscation":"ZHM1HbXwo5cj1XC"} - data: {"id":"chatcmpl-CLu8Bl45eOpFstLCUfCBD7YQChsDr","object":"chat.completion.chunk","created":1759336691,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"-test"}}]},"finish_reason":null}],"usage":null,"obfuscation":"LVjGc63qtZ4bM"} + data: {"id":"chatcmpl-CLuSKTcaZxAQhKWcADt4CHTG1lWL0","object":"chat.completion.chunk","created":1759337940,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"-test"}}]},"finish_reason":null}],"usage":null,"obfuscation":"uX6raee5bRHas"} - data: {"id":"chatcmpl-CLu8Bl45eOpFstLCUfCBD7YQChsDr","object":"chat.completion.chunk","created":1759336691,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/Test"}}]},"finish_reason":null}],"usage":null,"obfuscation":"OUUkqNBwm5v7d"} + data: {"id":"chatcmpl-CLuSKTcaZxAQhKWcADt4CHTG1lWL0","object":"chat.completion.chunk","created":1759337940,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/Test"}}]},"finish_reason":null}],"usage":null,"obfuscation":"9xp4eRtcopj4s"} - data: {"id":"chatcmpl-CLu8Bl45eOpFstLCUfCBD7YQChsDr","object":"chat.completion.chunk","created":1759336691,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Coder"}}]},"finish_reason":null}],"usage":null,"obfuscation":"HljDOLUFUJoMc"} + data: {"id":"chatcmpl-CLuSKTcaZxAQhKWcADt4CHTG1lWL0","object":"chat.completion.chunk","created":1759337940,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Coder"}}]},"finish_reason":null}],"usage":null,"obfuscation":"wZQw1zAHM7twz"} - data: {"id":"chatcmpl-CLu8Bl45eOpFstLCUfCBD7YQChsDr","object":"chat.completion.chunk","created":1759336691,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Agent"}}]},"finish_reason":null}],"usage":null,"obfuscation":"KDQxY9Xm9UDR6"} + data: {"id":"chatcmpl-CLuSKTcaZxAQhKWcADt4CHTG1lWL0","object":"chat.completion.chunk","created":1759337940,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Agent"}}]},"finish_reason":null}],"usage":null,"obfuscation":"Wnr2yQ6DAFGSs"} - data: {"id":"chatcmpl-CLu8Bl45eOpFstLCUfCBD7YQChsDr","object":"chat.completion.chunk","created":1759336691,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/open"}}]},"finish_reason":null}],"usage":null,"obfuscation":"AvWlwV8lkbI6B"} + data: {"id":"chatcmpl-CLuSKTcaZxAQhKWcADt4CHTG1lWL0","object":"chat.completion.chunk","created":1759337940,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/open"}}]},"finish_reason":null}],"usage":null,"obfuscation":"Nkf8uqjOXuULr"} - data: {"id":"chatcmpl-CLu8Bl45eOpFstLCUfCBD7YQChsDr","object":"chat.completion.chunk","created":1759336691,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ai"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuSKTcaZxAQhKWcADt4CHTG1lWL0","object":"chat.completion.chunk","created":1759337940,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ai"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLu8Bl45eOpFstLCUfCBD7YQChsDr","object":"chat.completion.chunk","created":1759336691,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"-g"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuSKTcaZxAQhKWcADt4CHTG1lWL0","object":"chat.completion.chunk","created":1759337940,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"-g"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLu8Bl45eOpFstLCUfCBD7YQChsDr","object":"chat.completion.chunk","created":1759336691,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"pt"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuSKTcaZxAQhKWcADt4CHTG1lWL0","object":"chat.completion.chunk","created":1759337940,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"pt"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLu8Bl45eOpFstLCUfCBD7YQChsDr","object":"chat.completion.chunk","created":1759336691,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"-"}}]},"finish_reason":null}],"usage":null,"obfuscation":"8"} + data: {"id":"chatcmpl-CLuSKTcaZxAQhKWcADt4CHTG1lWL0","object":"chat.completion.chunk","created":1759337940,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"-"}}]},"finish_reason":null}],"usage":null,"obfuscation":"V"} - data: {"id":"chatcmpl-CLu8Bl45eOpFstLCUfCBD7YQChsDr","object":"chat.completion.chunk","created":1759336691,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"5"}}]},"finish_reason":null}],"usage":null,"obfuscation":"c"} + data: {"id":"chatcmpl-CLuSKTcaZxAQhKWcADt4CHTG1lWL0","object":"chat.completion.chunk","created":1759337940,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"5"}}]},"finish_reason":null}],"usage":null,"obfuscation":"h"} - data: {"id":"chatcmpl-CLu8Bl45eOpFstLCUfCBD7YQChsDr","object":"chat.completion.chunk","created":1759336691,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/update"}}]},"finish_reason":null}],"usage":null,"obfuscation":"SBdj473qTHW"} + data: {"id":"chatcmpl-CLuSKTcaZxAQhKWcADt4CHTG1lWL0","object":"chat.completion.chunk","created":1759337940,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/update"}}]},"finish_reason":null}],"usage":null,"obfuscation":"mCM6NNP5Jqj"} - data: {"id":"chatcmpl-CLu8Bl45eOpFstLCUfCBD7YQChsDr","object":"chat.completion.chunk","created":1759336691,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_a"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuSKTcaZxAQhKWcADt4CHTG1lWL0","object":"chat.completion.chunk","created":1759337940,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_a"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLu8Bl45eOpFstLCUfCBD7YQChsDr","object":"chat.completion.chunk","created":1759336691,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_file"}}]},"finish_reason":null}],"usage":null,"obfuscation":"rXE5UFl8kmhXI"} + data: {"id":"chatcmpl-CLuSKTcaZxAQhKWcADt4CHTG1lWL0","object":"chat.completion.chunk","created":1759337940,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_file"}}]},"finish_reason":null}],"usage":null,"obfuscation":"o8pruI7hk2SQI"} - data: {"id":"chatcmpl-CLu8Bl45eOpFstLCUfCBD7YQChsDr","object":"chat.completion.chunk","created":1759336691,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/main"}}]},"finish_reason":null}],"usage":null,"obfuscation":"FqFpAeOdlQlGD"} + data: {"id":"chatcmpl-CLuSKTcaZxAQhKWcADt4CHTG1lWL0","object":"chat.completion.chunk","created":1759337940,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/main"}}]},"finish_reason":null}],"usage":null,"obfuscation":"g1eQtvYACPT6M"} - data: {"id":"chatcmpl-CLu8Bl45eOpFstLCUfCBD7YQChsDr","object":"chat.completion.chunk","created":1759336691,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":".go"}}]},"finish_reason":null}],"usage":null,"obfuscation":"hau3zmx0mt4OcT8"} + data: {"id":"chatcmpl-CLuSKTcaZxAQhKWcADt4CHTG1lWL0","object":"chat.completion.chunk","created":1759337940,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":".go"}}]},"finish_reason":null}],"usage":null,"obfuscation":"6b3VmhCeVHwc5cv"} - data: {"id":"chatcmpl-CLu8Bl45eOpFstLCUfCBD7YQChsDr","object":"chat.completion.chunk","created":1759336691,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"}"}}]},"finish_reason":null}],"usage":null,"obfuscation":"wKfdrxqzuY4LY9O"} + data: {"id":"chatcmpl-CLuSKTcaZxAQhKWcADt4CHTG1lWL0","object":"chat.completion.chunk","created":1759337940,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"}"}}]},"finish_reason":null}],"usage":null,"obfuscation":"AmagafmrRk46j3N"} - data: {"id":"chatcmpl-CLu8Bl45eOpFstLCUfCBD7YQChsDr","object":"chat.completion.chunk","created":1759336691,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"tool_calls"}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuSKTcaZxAQhKWcADt4CHTG1lWL0","object":"chat.completion.chunk","created":1759337940,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"tool_calls"}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLu8Bl45eOpFstLCUfCBD7YQChsDr","object":"chat.completion.chunk","created":1759336691,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6627,"completion_tokens":35,"total_tokens":6662,"prompt_tokens_details":{"cached_tokens":6528,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"Tyl7"} + data: {"id":"chatcmpl-CLuSKTcaZxAQhKWcADt4CHTG1lWL0","object":"chat.completion.chunk","created":1759337940,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6642,"completion_tokens":41,"total_tokens":6683,"prompt_tokens_details":{"cached_tokens":6528,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"1jMs"} data: [DONE] @@ -215,15 +227,15 @@ interactions: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 1.63808175s + duration: 1.364120708s - id: 3 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 31405 + content_length: 31494 host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/update_a_file\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"update the main.go file by changing the print to say hello from crush\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"call_1U6na1Eco9KjhdxIX6ZkvD5X\",\"function\":{\"arguments\":\"{\\\"path\\\": \\\"/tmp/crush-test/TestCoderAgent/openai-gpt-5/update_a_file\\\"}\",\"name\":\"ls\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"- /tmp/crush-test/TestCoderAgent/openai-gpt-5/update_a_file/\\n - go.mod\\n - main.go\\n\",\"tool_call_id\":\"call_1U6na1Eco9KjhdxIX6ZkvD5X\",\"role\":\"tool\"},{\"tool_calls\":[{\"id\":\"call_MvWgY6YVjEzAmq8kEt3995Mk\",\"function\":{\"arguments\":\"{\\\"file_path\\\":\\\"/tmp/crush-test/TestCoderAgent/openai-gpt-5/update_a_file/main.go\\\"}\",\"name\":\"view\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"\\n 1|package main\\n 2|\\n 3|import \\\"fmt\\\"\\n 4|\\n 5|func main() {\\n 6|\\tfmt.Println(\\\"Hello, World!\\\")\\n 7|}\\n\\n\",\"tool_call_id\":\"call_MvWgY6YVjEzAmq8kEt3995Mk\",\"role\":\"tool\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/update_a_file\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"update the main.go file by changing the print to say hello from crush\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"call_IcfcVn3GDejckDVAwO8qTDrB\",\"function\":{\"arguments\":\"{\\\"path\\\": \\\"/tmp/crush-test/TestCoderAgent/openai-gpt-5/update_a_file\\\", \\\"depth\\\": 2}\",\"name\":\"ls\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"\\n- /tmp/crush-test/TestCoderAgent/openai-gpt-5/update_a_file/\\n - go.mod\\n - main.go\\n\",\"tool_call_id\":\"call_IcfcVn3GDejckDVAwO8qTDrB\",\"role\":\"tool\"},{\"tool_calls\":[{\"id\":\"call_ReMIw0Q9IfSHd43DsxYRIQ0V\",\"function\":{\"arguments\":\"{\\\"file_path\\\":\\\"/tmp/crush-test/TestCoderAgent/openai-gpt-5/update_a_file/main.go\\\"}\",\"name\":\"view\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"\\n 1|package main\\n 2|\\n 3|import \\\"fmt\\\"\\n 4|\\n 5|func main() {\\n 6|\\tfmt.Println(\\\"Hello, World!\\\")\\n 7|}\\n\\n\",\"tool_call_id\":\"call_ReMIw0Q9IfSHd43DsxYRIQ0V\",\"role\":\"tool\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" headers: Accept: - application/json @@ -239,145 +251,145 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"call_XB9nEje7aogpf3820gJpuVXj","type":"function","function":{"name":"edit","arguments":""}}],"refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"mcdOhKWi0Mor"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"call_4ids2gFKXwaeUQjbJ8YKBrtP","type":"function","function":{"name":"edit","arguments":""}}],"refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"TXfPHnQDeCvr"} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"JNSVNvT96weBkaT"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"mubN2JErMCotBin"} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"file"}}]},"finish_reason":null}],"usage":null,"obfuscation":"K0EOMWGxOlHtou"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"file"}}]},"finish_reason":null}],"usage":null,"obfuscation":"AuMsqow2vwI6Wp"} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_path"}}]},"finish_reason":null}],"usage":null,"obfuscation":"tsc2hV1zUtwb5"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_path"}}]},"finish_reason":null}],"usage":null,"obfuscation":"XfO2IlqKtnGu0"} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":"}}]},"finish_reason":null}],"usage":null,"obfuscation":"FfMKRBFvmxhsfqU"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":"}}]},"finish_reason":null}],"usage":null,"obfuscation":"32rysojmdQ6odkF"} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"/"}}]},"finish_reason":null}],"usage":null,"obfuscation":"1VwOzZFPvKN4z2j"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"/"}}]},"finish_reason":null}],"usage":null,"obfuscation":"37W4WS4ChSDu1gu"} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"tmp"}}]},"finish_reason":null}],"usage":null,"obfuscation":"DcVG1r3kQVvVNfF"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"tmp"}}]},"finish_reason":null}],"usage":null,"obfuscation":"DUSIOII7eVY5wj6"} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/cr"}}]},"finish_reason":null}],"usage":null,"obfuscation":"tSWmxHvaBndSxkx"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/cr"}}]},"finish_reason":null}],"usage":null,"obfuscation":"oeXx8eHf92pE4j0"} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ush"}}]},"finish_reason":null}],"usage":null,"obfuscation":"cAsShq3cPzgq6XE"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ush"}}]},"finish_reason":null}],"usage":null,"obfuscation":"KqvXyfosjUWzG70"} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"-test"}}]},"finish_reason":null}],"usage":null,"obfuscation":"y434lhxQOWnjQ"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"-test"}}]},"finish_reason":null}],"usage":null,"obfuscation":"aLj6um8SHDrD5"} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/Test"}}]},"finish_reason":null}],"usage":null,"obfuscation":"9rPqzH8xleYYd"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/Test"}}]},"finish_reason":null}],"usage":null,"obfuscation":"4qGQkUVij2jOX"} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Coder"}}]},"finish_reason":null}],"usage":null,"obfuscation":"l0kPvSl5dR4XN"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Coder"}}]},"finish_reason":null}],"usage":null,"obfuscation":"6kiuUdwdsdhDj"} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Agent"}}]},"finish_reason":null}],"usage":null,"obfuscation":"6CSmPq35wwhlK"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Agent"}}]},"finish_reason":null}],"usage":null,"obfuscation":"UqNLL9eLXL9ti"} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/open"}}]},"finish_reason":null}],"usage":null,"obfuscation":"9xTmGy5bPQovI"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/open"}}]},"finish_reason":null}],"usage":null,"obfuscation":"tf3VeBMazOZOl"} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ai"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ai"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"-g"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"-g"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"pt"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"pt"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"-"}}]},"finish_reason":null}],"usage":null,"obfuscation":"U"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"-"}}]},"finish_reason":null}],"usage":null,"obfuscation":"4"} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"5"}}]},"finish_reason":null}],"usage":null,"obfuscation":"A"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"5"}}]},"finish_reason":null}],"usage":null,"obfuscation":"T"} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/update"}}]},"finish_reason":null}],"usage":null,"obfuscation":"IfNfuBnmeQq"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/update"}}]},"finish_reason":null}],"usage":null,"obfuscation":"gXPTfBuOmk7"} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_a"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_a"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_file"}}]},"finish_reason":null}],"usage":null,"obfuscation":"E7WvQohiL7N7y"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_file"}}]},"finish_reason":null}],"usage":null,"obfuscation":"msGyXYEe8ANmu"} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/main"}}]},"finish_reason":null}],"usage":null,"obfuscation":"Tiedhn4F1EKRg"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/main"}}]},"finish_reason":null}],"usage":null,"obfuscation":"YThCaTGpTsPIL"} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":".go"}}]},"finish_reason":null}],"usage":null,"obfuscation":"kZlBkKVzh9rjBDX"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":".go"}}]},"finish_reason":null}],"usage":null,"obfuscation":"4L5bF8KpE7acwcb"} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\",\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"uyJEgCtjprxlX"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\",\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"RL6kMFeTOUHbG"} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"old"}}]},"finish_reason":null}],"usage":null,"obfuscation":"gwdQvcHfF8XeW1V"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"old"}}]},"finish_reason":null}],"usage":null,"obfuscation":"gQBtoAaxvJ1Ew67"} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_string"}}]},"finish_reason":null}],"usage":null,"obfuscation":"om8IDlz3AqF"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_string"}}]},"finish_reason":null}],"usage":null,"obfuscation":"ZS08aTReWwc"} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"EDlJYg0eBlm9y"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"zastMRak3RQ7G"} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"func"}}]},"finish_reason":null}],"usage":null,"obfuscation":"K5l1ji66scgFAh"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"func"}}]},"finish_reason":null}],"usage":null,"obfuscation":"qEaGL9W8HFccOG"} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" main"}}]},"finish_reason":null}],"usage":null,"obfuscation":"s4C2KAN3LpKBe"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" main"}}]},"finish_reason":null}],"usage":null,"obfuscation":"KNtYwpoNAwduL"} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"()"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"()"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" {\\"}}]},"finish_reason":null}],"usage":null,"obfuscation":"zDgm4MoukDG4uO"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" {\\"}}]},"finish_reason":null}],"usage":null,"obfuscation":"17zy0l7QLdkGnL"} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"n"}}]},"finish_reason":null}],"usage":null,"obfuscation":"m"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"n"}}]},"finish_reason":null}],"usage":null,"obfuscation":"u"} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\\t"}}]},"finish_reason":null}],"usage":null,"obfuscation":"pkiaMyf4Q6yqAL5"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\\t"}}]},"finish_reason":null}],"usage":null,"obfuscation":"NJHcJJfeyZv7CUL"} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"fmt"}}]},"finish_reason":null}],"usage":null,"obfuscation":"fdsZikygOMEDJfd"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"fmt"}}]},"finish_reason":null}],"usage":null,"obfuscation":"GqaU3ZX3s6d89mY"} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":".Println"}}]},"finish_reason":null}],"usage":null,"obfuscation":"UvzPjGYg4L"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":".Println"}}]},"finish_reason":null}],"usage":null,"obfuscation":"S8UdTsGpcl"} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"(\\\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"ZkiWWbmjiy6k4"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"(\\\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"LOeMME1ksD8FH"} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Hello"}}]},"finish_reason":null}],"usage":null,"obfuscation":"e0JI6knGl52kn"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Hello"}}]},"finish_reason":null}],"usage":null,"obfuscation":"HbvNPTcOmZYkj"} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":","}}]},"finish_reason":null}],"usage":null,"obfuscation":"i"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":","}}]},"finish_reason":null}],"usage":null,"obfuscation":"y"} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" World"}}]},"finish_reason":null}],"usage":null,"obfuscation":"JicLx9jDuDkM"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" World"}}]},"finish_reason":null}],"usage":null,"obfuscation":"oRC0wzuYvg37"} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"!\\"}}]},"finish_reason":null}],"usage":null,"obfuscation":"2T7FPkLw9VtfVoH"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"!\\"}}]},"finish_reason":null}],"usage":null,"obfuscation":"U6TszEW72ieK9Af"} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\")"}}]},"finish_reason":null}],"usage":null,"obfuscation":"0Q6By9C9fLVOP9w"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\")"}}]},"finish_reason":null}],"usage":null,"obfuscation":"PXtG2Ykf6DyvuGI"} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\\"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\\"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"n"}}]},"finish_reason":null}],"usage":null,"obfuscation":"H"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"n"}}]},"finish_reason":null}],"usage":null,"obfuscation":"f"} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"}\\"}}]},"finish_reason":null}],"usage":null,"obfuscation":"t8MqMuOUpe4V3Vv"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"}\\"}}]},"finish_reason":null}],"usage":null,"obfuscation":"9n4205yW6CTD6rg"} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"n"}}]},"finish_reason":null}],"usage":null,"obfuscation":"h"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"n"}}]},"finish_reason":null}],"usage":null,"obfuscation":"H"} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\",\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"C0I42ACBGbAfM"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\",\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"nclvyKWTloR4a"} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"new"}}]},"finish_reason":null}],"usage":null,"obfuscation":"bN2XPBHQS8iyXpH"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"new"}}]},"finish_reason":null}],"usage":null,"obfuscation":"s5rnav2RHibpmnt"} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_string"}}]},"finish_reason":null}],"usage":null,"obfuscation":"hH3qQ8UmxeX"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_string"}}]},"finish_reason":null}],"usage":null,"obfuscation":"grZC5FFiUhH"} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"0dTMvZpZukogO"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"Lr7vcT1z6Huic"} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"func"}}]},"finish_reason":null}],"usage":null,"obfuscation":"uEB2wMcjaw6ZoN"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"func"}}]},"finish_reason":null}],"usage":null,"obfuscation":"O2BYSbfeqK0SQ3"} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" main"}}]},"finish_reason":null}],"usage":null,"obfuscation":"lgKKAgRKFutOO"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" main"}}]},"finish_reason":null}],"usage":null,"obfuscation":"bEk10QZ2jfth2"} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"()"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"()"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" {\\"}}]},"finish_reason":null}],"usage":null,"obfuscation":"RN4IiVTT9OqwrS"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" {\\"}}]},"finish_reason":null}],"usage":null,"obfuscation":"9vLkqO21JyoisS"} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"n"}}]},"finish_reason":null}],"usage":null,"obfuscation":"u"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"n"}}]},"finish_reason":null}],"usage":null,"obfuscation":"J"} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\\t"}}]},"finish_reason":null}],"usage":null,"obfuscation":"CS4q8QiwfEYthbC"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\\t"}}]},"finish_reason":null}],"usage":null,"obfuscation":"0aU1ViuLUt7VNlD"} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"fmt"}}]},"finish_reason":null}],"usage":null,"obfuscation":"z2YdwIazmzDfouc"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"fmt"}}]},"finish_reason":null}],"usage":null,"obfuscation":"geHgZECyT2sxjHg"} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":".Println"}}]},"finish_reason":null}],"usage":null,"obfuscation":"PEIUBevTYH"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":".Println"}}]},"finish_reason":null}],"usage":null,"obfuscation":"eby7vGGb9H"} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"(\\\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"e888ms2OUQf34"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"(\\\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"rFjLtcBW9GzVf"} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"hello"}}]},"finish_reason":null}],"usage":null,"obfuscation":"kJF7yiIiXMMCx"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"hello"}}]},"finish_reason":null}],"usage":null,"obfuscation":"5c4AoruiTdKoS"} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" from"}}]},"finish_reason":null}],"usage":null,"obfuscation":"TfCLX2nBN96pA"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" from"}}]},"finish_reason":null}],"usage":null,"obfuscation":"IlNVciZ1Kl5Hy"} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" crush"}}]},"finish_reason":null}],"usage":null,"obfuscation":"dIN0UqOA2xoY"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" crush"}}]},"finish_reason":null}],"usage":null,"obfuscation":"CP7aqlYiMDYA"} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\\\")"}}]},"finish_reason":null}],"usage":null,"obfuscation":"TeNy85307TzDz"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\\\")"}}]},"finish_reason":null}],"usage":null,"obfuscation":"Rysf6pnTvCUCe"} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\\"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\\"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"n"}}]},"finish_reason":null}],"usage":null,"obfuscation":"z"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"n"}}]},"finish_reason":null}],"usage":null,"obfuscation":"1"} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"}\\"}}]},"finish_reason":null}],"usage":null,"obfuscation":"KlDDOSt3DB029KS"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"}\\"}}]},"finish_reason":null}],"usage":null,"obfuscation":"d3FfzQK9tW6bNHH"} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"n"}}]},"finish_reason":null}],"usage":null,"obfuscation":"9"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"n"}}]},"finish_reason":null}],"usage":null,"obfuscation":"G"} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"}"}}]},"finish_reason":null}],"usage":null,"obfuscation":"iVjfy2BnO8GpLcm"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"}"}}]},"finish_reason":null}],"usage":null,"obfuscation":"x5YNOu7QTgUJbb5"} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"tool_calls"}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"tool_calls"}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLu8DCLPTwuy86yQu65Av4Gnr9wEE","object":"chat.completion.chunk","created":1759336693,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6724,"completion_tokens":788,"total_tokens":7512,"prompt_tokens_details":{"cached_tokens":6656,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":704,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"Q"} + data: {"id":"chatcmpl-CLuSMF2bvXxldVp02LGxkuQLg37hi","object":"chat.completion.chunk","created":1759337942,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6739,"completion_tokens":852,"total_tokens":7591,"prompt_tokens_details":{"cached_tokens":6528,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":768,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"2"} data: [DONE] @@ -386,15 +398,90 @@ interactions: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 11.575774875s + duration: 13.274909459s - id: 4 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 31978 + content_length: 32067 + host: "" + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/update_a_file\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"update the main.go file by changing the print to say hello from crush\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"call_IcfcVn3GDejckDVAwO8qTDrB\",\"function\":{\"arguments\":\"{\\\"path\\\": \\\"/tmp/crush-test/TestCoderAgent/openai-gpt-5/update_a_file\\\", \\\"depth\\\": 2}\",\"name\":\"ls\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"\\n- /tmp/crush-test/TestCoderAgent/openai-gpt-5/update_a_file/\\n - go.mod\\n - main.go\\n\",\"tool_call_id\":\"call_IcfcVn3GDejckDVAwO8qTDrB\",\"role\":\"tool\"},{\"tool_calls\":[{\"id\":\"call_ReMIw0Q9IfSHd43DsxYRIQ0V\",\"function\":{\"arguments\":\"{\\\"file_path\\\":\\\"/tmp/crush-test/TestCoderAgent/openai-gpt-5/update_a_file/main.go\\\"}\",\"name\":\"view\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"\\n 1|package main\\n 2|\\n 3|import \\\"fmt\\\"\\n 4|\\n 5|func main() {\\n 6|\\tfmt.Println(\\\"Hello, World!\\\")\\n 7|}\\n\\n\",\"tool_call_id\":\"call_ReMIw0Q9IfSHd43DsxYRIQ0V\",\"role\":\"tool\"},{\"tool_calls\":[{\"id\":\"call_4ids2gFKXwaeUQjbJ8YKBrtP\",\"function\":{\"arguments\":\"{\\\"file_path\\\":\\\"/tmp/crush-test/TestCoderAgent/openai-gpt-5/update_a_file/main.go\\\",\\\"old_string\\\":\\\"func main() {\\\\n\\\\tfmt.Println(\\\\\\\"Hello, World!\\\\\\\")\\\\n}\\\\n\\\",\\\"new_string\\\":\\\"func main() {\\\\n\\\\tfmt.Println(\\\\\\\"hello from crush\\\\\\\")\\\\n}\\\\n\\\"}\",\"name\":\"edit\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"\\nContent replaced in file: /tmp/crush-test/TestCoderAgent/openai-gpt-5/update_a_file/main.go\\n\\n\",\"tool_call_id\":\"call_4ids2gFKXwaeUQjbJ8YKBrtP\",\"role\":\"tool\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://api.openai.com/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: |+ + data: {"id":"chatcmpl-CLuSaIXnFIZxR7gUf7r8JiSSs6OD2","object":"chat.completion.chunk","created":1759337956,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"call_FaZis1UeQ4lB4HEBRRZVTz1q","type":"function","function":{"name":"bash","arguments":""}}],"refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"2duRj7PgCftD"} + + data: {"id":"chatcmpl-CLuSaIXnFIZxR7gUf7r8JiSSs6OD2","object":"chat.completion.chunk","created":1759337956,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"BqvPNTkb3NnqNAu"} + + data: {"id":"chatcmpl-CLuSaIXnFIZxR7gUf7r8JiSSs6OD2","object":"chat.completion.chunk","created":1759337956,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"command"}}]},"finish_reason":null}],"usage":null,"obfuscation":"G1lOiGNOajW"} + + data: {"id":"chatcmpl-CLuSaIXnFIZxR7gUf7r8JiSSs6OD2","object":"chat.completion.chunk","created":1759337956,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"OwHUgfZn5IX8R"} + + data: {"id":"chatcmpl-CLuSaIXnFIZxR7gUf7r8JiSSs6OD2","object":"chat.completion.chunk","created":1759337956,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"go"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + + data: {"id":"chatcmpl-CLuSaIXnFIZxR7gUf7r8JiSSs6OD2","object":"chat.completion.chunk","created":1759337956,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" build"}}]},"finish_reason":null}],"usage":null,"obfuscation":"mpe1bc4ihYlB"} + + data: {"id":"chatcmpl-CLuSaIXnFIZxR7gUf7r8JiSSs6OD2","object":"chat.completion.chunk","created":1759337956,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" ./"}}]},"finish_reason":null}],"usage":null,"obfuscation":"xgdLMtv3aUXwYhb"} + + data: {"id":"chatcmpl-CLuSaIXnFIZxR7gUf7r8JiSSs6OD2","object":"chat.completion.chunk","created":1759337956,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"..."}}]},"finish_reason":null}],"usage":null,"obfuscation":"LU3GWa5azfpovr5"} + + data: {"id":"chatcmpl-CLuSaIXnFIZxR7gUf7r8JiSSs6OD2","object":"chat.completion.chunk","created":1759337956,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\",\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"BEXeqRVAMUQEY"} + + data: {"id":"chatcmpl-CLuSaIXnFIZxR7gUf7r8JiSSs6OD2","object":"chat.completion.chunk","created":1759337956,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"description"}}]},"finish_reason":null}],"usage":null,"obfuscation":"SZE3Jdl"} + + data: {"id":"chatcmpl-CLuSaIXnFIZxR7gUf7r8JiSSs6OD2","object":"chat.completion.chunk","created":1759337956,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"lwdEGs174cXbc"} + + data: {"id":"chatcmpl-CLuSaIXnFIZxR7gUf7r8JiSSs6OD2","object":"chat.completion.chunk","created":1759337956,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Build"}}]},"finish_reason":null}],"usage":null,"obfuscation":"htXpObunQ6zQK"} + + data: {"id":"chatcmpl-CLuSaIXnFIZxR7gUf7r8JiSSs6OD2","object":"chat.completion.chunk","created":1759337956,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" the"}}]},"finish_reason":null}],"usage":null,"obfuscation":"lv9RvQLaF0EjtL"} + + data: {"id":"chatcmpl-CLuSaIXnFIZxR7gUf7r8JiSSs6OD2","object":"chat.completion.chunk","created":1759337956,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" Go"}}]},"finish_reason":null}],"usage":null,"obfuscation":"O40icLct80qSuUR"} + + data: {"id":"chatcmpl-CLuSaIXnFIZxR7gUf7r8JiSSs6OD2","object":"chat.completion.chunk","created":1759337956,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" project"}}]},"finish_reason":null}],"usage":null,"obfuscation":"z4DN8pReHd"} + + data: {"id":"chatcmpl-CLuSaIXnFIZxR7gUf7r8JiSSs6OD2","object":"chat.completion.chunk","created":1759337956,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" to"}}]},"finish_reason":null}],"usage":null,"obfuscation":"YZ1msDq4VmPGp9R"} + + data: {"id":"chatcmpl-CLuSaIXnFIZxR7gUf7r8JiSSs6OD2","object":"chat.completion.chunk","created":1759337956,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" ensure"}}]},"finish_reason":null}],"usage":null,"obfuscation":"vT0ZUwYPJQA"} + + data: {"id":"chatcmpl-CLuSaIXnFIZxR7gUf7r8JiSSs6OD2","object":"chat.completion.chunk","created":1759337956,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" compilation"}}]},"finish_reason":null}],"usage":null,"obfuscation":"LJl8xB"} + + data: {"id":"chatcmpl-CLuSaIXnFIZxR7gUf7r8JiSSs6OD2","object":"chat.completion.chunk","created":1759337956,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" succeeds"}}]},"finish_reason":null}],"usage":null,"obfuscation":"U5AUwEM0n"} + + data: {"id":"chatcmpl-CLuSaIXnFIZxR7gUf7r8JiSSs6OD2","object":"chat.completion.chunk","created":1759337956,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"}"}}]},"finish_reason":null}],"usage":null,"obfuscation":"E2K9Z4lHTlKI43K"} + + data: {"id":"chatcmpl-CLuSaIXnFIZxR7gUf7r8JiSSs6OD2","object":"chat.completion.chunk","created":1759337956,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"tool_calls"}],"usage":null,"obfuscation":""} + + data: {"id":"chatcmpl-CLuSaIXnFIZxR7gUf7r8JiSSs6OD2","object":"chat.completion.chunk","created":1759337956,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6858,"completion_tokens":229,"total_tokens":7087,"prompt_tokens_details":{"cached_tokens":6656,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":192,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"6"} + + data: [DONE] + + headers: + Content-Type: + - text/event-stream; charset=utf-8 + status: 200 OK + code: 200 + duration: 5.177007542s +- id: 5 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 32391 host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/update_a_file\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"update the main.go file by changing the print to say hello from crush\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"call_1U6na1Eco9KjhdxIX6ZkvD5X\",\"function\":{\"arguments\":\"{\\\"path\\\": \\\"/tmp/crush-test/TestCoderAgent/openai-gpt-5/update_a_file\\\"}\",\"name\":\"ls\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"- /tmp/crush-test/TestCoderAgent/openai-gpt-5/update_a_file/\\n - go.mod\\n - main.go\\n\",\"tool_call_id\":\"call_1U6na1Eco9KjhdxIX6ZkvD5X\",\"role\":\"tool\"},{\"tool_calls\":[{\"id\":\"call_MvWgY6YVjEzAmq8kEt3995Mk\",\"function\":{\"arguments\":\"{\\\"file_path\\\":\\\"/tmp/crush-test/TestCoderAgent/openai-gpt-5/update_a_file/main.go\\\"}\",\"name\":\"view\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"\\n 1|package main\\n 2|\\n 3|import \\\"fmt\\\"\\n 4|\\n 5|func main() {\\n 6|\\tfmt.Println(\\\"Hello, World!\\\")\\n 7|}\\n\\n\",\"tool_call_id\":\"call_MvWgY6YVjEzAmq8kEt3995Mk\",\"role\":\"tool\"},{\"tool_calls\":[{\"id\":\"call_XB9nEje7aogpf3820gJpuVXj\",\"function\":{\"arguments\":\"{\\\"file_path\\\":\\\"/tmp/crush-test/TestCoderAgent/openai-gpt-5/update_a_file/main.go\\\",\\\"old_string\\\":\\\"func main() {\\\\n\\\\tfmt.Println(\\\\\\\"Hello, World!\\\\\\\")\\\\n}\\\\n\\\",\\\"new_string\\\":\\\"func main() {\\\\n\\\\tfmt.Println(\\\\\\\"hello from crush\\\\\\\")\\\\n}\\\\n\\\"}\",\"name\":\"edit\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"\\nContent replaced in file: /tmp/crush-test/TestCoderAgent/openai-gpt-5/update_a_file/main.go\\n\\n\",\"tool_call_id\":\"call_XB9nEje7aogpf3820gJpuVXj\",\"role\":\"tool\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/update_a_file\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"update the main.go file by changing the print to say hello from crush\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"call_IcfcVn3GDejckDVAwO8qTDrB\",\"function\":{\"arguments\":\"{\\\"path\\\": \\\"/tmp/crush-test/TestCoderAgent/openai-gpt-5/update_a_file\\\", \\\"depth\\\": 2}\",\"name\":\"ls\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"\\n- /tmp/crush-test/TestCoderAgent/openai-gpt-5/update_a_file/\\n - go.mod\\n - main.go\\n\",\"tool_call_id\":\"call_IcfcVn3GDejckDVAwO8qTDrB\",\"role\":\"tool\"},{\"tool_calls\":[{\"id\":\"call_ReMIw0Q9IfSHd43DsxYRIQ0V\",\"function\":{\"arguments\":\"{\\\"file_path\\\":\\\"/tmp/crush-test/TestCoderAgent/openai-gpt-5/update_a_file/main.go\\\"}\",\"name\":\"view\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"\\n 1|package main\\n 2|\\n 3|import \\\"fmt\\\"\\n 4|\\n 5|func main() {\\n 6|\\tfmt.Println(\\\"Hello, World!\\\")\\n 7|}\\n\\n\",\"tool_call_id\":\"call_ReMIw0Q9IfSHd43DsxYRIQ0V\",\"role\":\"tool\"},{\"tool_calls\":[{\"id\":\"call_4ids2gFKXwaeUQjbJ8YKBrtP\",\"function\":{\"arguments\":\"{\\\"file_path\\\":\\\"/tmp/crush-test/TestCoderAgent/openai-gpt-5/update_a_file/main.go\\\",\\\"old_string\\\":\\\"func main() {\\\\n\\\\tfmt.Println(\\\\\\\"Hello, World!\\\\\\\")\\\\n}\\\\n\\\",\\\"new_string\\\":\\\"func main() {\\\\n\\\\tfmt.Println(\\\\\\\"hello from crush\\\\\\\")\\\\n}\\\\n\\\"}\",\"name\":\"edit\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"\\nContent replaced in file: /tmp/crush-test/TestCoderAgent/openai-gpt-5/update_a_file/main.go\\n\\n\",\"tool_call_id\":\"call_4ids2gFKXwaeUQjbJ8YKBrtP\",\"role\":\"tool\"},{\"tool_calls\":[{\"id\":\"call_FaZis1UeQ4lB4HEBRRZVTz1q\",\"function\":{\"arguments\":\"{\\\"command\\\":\\\"go build ./...\\\",\\\"description\\\":\\\"Build the Go project to ensure compilation succeeds\\\"}\",\"name\":\"bash\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"no output\",\"tool_call_id\":\"call_FaZis1UeQ4lB4HEBRRZVTz1q\",\"role\":\"tool\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" headers: Accept: - application/json @@ -410,13 +497,13 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"chatcmpl-CLu8PDqXEZZKib5jyc5ds9xwmLkRA","object":"chat.completion.chunk","created":1759336705,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"pyEvEVLpWI"} + data: {"id":"chatcmpl-CLuSfo48hBfo9AddxlMKNOHTJ9wvW","object":"chat.completion.chunk","created":1759337961,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"xDmO4tkrms"} - data: {"id":"chatcmpl-CLu8PDqXEZZKib5jyc5ds9xwmLkRA","object":"chat.completion.chunk","created":1759336705,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"updated"},"finish_reason":null}],"usage":null,"obfuscation":"gsx3K"} + data: {"id":"chatcmpl-CLuSfo48hBfo9AddxlMKNOHTJ9wvW","object":"chat.completion.chunk","created":1759337961,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"done"},"finish_reason":null}],"usage":null,"obfuscation":"BgrfFph9"} - data: {"id":"chatcmpl-CLu8PDqXEZZKib5jyc5ds9xwmLkRA","object":"chat.completion.chunk","created":1759336705,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"stop"}],"usage":null,"obfuscation":"5jebs9"} + data: {"id":"chatcmpl-CLuSfo48hBfo9AddxlMKNOHTJ9wvW","object":"chat.completion.chunk","created":1759337961,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"stop"}],"usage":null,"obfuscation":"y6Fdzm"} - data: {"id":"chatcmpl-CLu8PDqXEZZKib5jyc5ds9xwmLkRA","object":"chat.completion.chunk","created":1759336705,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6843,"completion_tokens":4,"total_tokens":6847,"prompt_tokens_details":{"cached_tokens":6656,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"xy5Hv"} + data: {"id":"chatcmpl-CLuSfo48hBfo9AddxlMKNOHTJ9wvW","object":"chat.completion.chunk","created":1759337961,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6901,"completion_tokens":4,"total_tokens":6905,"prompt_tokens_details":{"cached_tokens":6784,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"7N40y"} data: [DONE] @@ -425,4 +512,4 @@ interactions: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 1.279328875s + duration: 1.309019875s diff --git a/internal/agent/testdata/TestCoderAgent/openai-gpt-5/write_tool.yaml b/internal/agent/testdata/TestCoderAgent/openai-gpt-5/write_tool.yaml index c13fc79d862f70d49870019dfbb1d987fce33bf0..dddbfd3aca000095df271a3617234b72d8df2a8c 100644 --- a/internal/agent/testdata/TestCoderAgent/openai-gpt-5/write_tool.yaml +++ b/internal/agent/testdata/TestCoderAgent/openai-gpt-5/write_tool.yaml @@ -24,23 +24,27 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"chatcmpl-CLuBhnEkyysqwgjgp0bOe60gZLnhY","object":"chat.completion.chunk","created":1759336909,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"yGefhqtHLOSEAa"} + data: {"id":"chatcmpl-CLuVDj86LO7uoa1CdG2mfD3JVwbzF","object":"chat.completion.chunk","created":1759338119,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"n0hU8uavVOkbSZ"} - data: {"id":"chatcmpl-CLuBhnEkyysqwgjgp0bOe60gZLnhY","object":"chat.completion.chunk","created":1759336909,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":"Creating"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"bcKH4sYI"} + data: {"id":"chatcmpl-CLuVDj86LO7uoa1CdG2mfD3JVwbzF","object":"chat.completion.chunk","created":1759338119,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":"Creating"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"yB2tVfbL"} - data: {"id":"chatcmpl-CLuBhnEkyysqwgjgp0bOe60gZLnhY","object":"chat.completion.chunk","created":1759336909,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":" config"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"uGpgKHgmz"} + data: {"id":"chatcmpl-CLuVDj86LO7uoa1CdG2mfD3JVwbzF","object":"chat.completion.chunk","created":1759338119,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":" a"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"fAGfXdgPdq1bTp"} - data: {"id":"chatcmpl-CLuBhnEkyysqwgjgp0bOe60gZLnhY","object":"chat.completion.chunk","created":1759336909,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":".json"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"pbAuY789tgg"} + data: {"id":"chatcmpl-CLuVDj86LO7uoa1CdG2mfD3JVwbzF","object":"chat.completion.chunk","created":1759338119,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":" JSON"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"1e0rbDm5JBK"} - data: {"id":"chatcmpl-CLuBhnEkyysqwgjgp0bOe60gZLnhY","object":"chat.completion.chunk","created":1759336909,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":" with"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"WM8xN1hScCN"} + data: {"id":"chatcmpl-CLuVDj86LO7uoa1CdG2mfD3JVwbzF","object":"chat.completion.chunk","created":1759338119,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":" Config"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"9K9gPZ6dr"} - data: {"id":"chatcmpl-CLuBhnEkyysqwgjgp0bOe60gZLnhY","object":"chat.completion.chunk","created":1759336909,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":" JSON"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"Q3NUW4DBpIi"} + data: {"id":"chatcmpl-CLuVDj86LO7uoa1CdG2mfD3JVwbzF","object":"chat.completion.chunk","created":1759338119,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":" File"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"Sewxok0B5hH"} - data: {"id":"chatcmpl-CLuBhnEkyysqwgjgp0bOe60gZLnhY","object":"chat.completion.chunk","created":1759336909,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":" Content"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"BmSH0JVZ"} + data: {"id":"chatcmpl-CLuVDj86LO7uoa1CdG2mfD3JVwbzF","object":"chat.completion.chunk","created":1759338119,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":" with"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"LVZfga5gIAT"} - data: {"id":"chatcmpl-CLuBhnEkyysqwgjgp0bOe60gZLnhY","object":"chat.completion.chunk","created":1759336909,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"m6y68mVIuN"} + data: {"id":"chatcmpl-CLuVDj86LO7uoa1CdG2mfD3JVwbzF","object":"chat.completion.chunk","created":1759338119,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":" Version"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"7FYI6qjD"} - data: {"id":"chatcmpl-CLuBhnEkyysqwgjgp0bOe60gZLnhY","object":"chat.completion.chunk","created":1759336909,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[],"usage":{"prompt_tokens":137,"completion_tokens":6,"total_tokens":143,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"KZSc2loCPfEiDI"} + data: {"id":"chatcmpl-CLuVDj86LO7uoa1CdG2mfD3JVwbzF","object":"chat.completion.chunk","created":1759338119,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{"content":" Info"},"logprobs":null,"finish_reason":null}],"usage":null,"obfuscation":"dWSAttdAR9J"} + + data: {"id":"chatcmpl-CLuVDj86LO7uoa1CdG2mfD3JVwbzF","object":"chat.completion.chunk","created":1759338119,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}],"usage":null,"obfuscation":"yEK5tZLeR2"} + + data: {"id":"chatcmpl-CLuVDj86LO7uoa1CdG2mfD3JVwbzF","object":"chat.completion.chunk","created":1759338119,"model":"gpt-4o-2024-08-06","service_tier":"default","system_fingerprint":"fp_f33640a400","choices":[],"usage":{"prompt_tokens":137,"completion_tokens":8,"total_tokens":145,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"36VYWrnOo8PuzR"} data: [DONE] @@ -49,15 +53,15 @@ interactions: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 621.512625ms + duration: 615.102334ms - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 30625 + content_length: 30698 host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/write_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use write to create a new file called config.json with content '{\\\"name\\\": \\\"test\\\", \\\"version\\\": \\\"1.0.0\\\"}'\",\"role\":\"user\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/write_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use write to create a new file called config.json with content '{\\\"name\\\": \\\"test\\\", \\\"version\\\": \\\"1.0.0\\\"}'\",\"role\":\"user\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" headers: Accept: - application/json @@ -73,97 +77,97 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"chatcmpl-CLuBhSR44pSKvR5yS77v599H7UO4P","object":"chat.completion.chunk","created":1759336909,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"call_Vh5tT5MxJ5CaBmLkNwTjfWms","type":"function","function":{"name":"write","arguments":""}}],"refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"7LwyNuaAL5T"} + data: {"id":"chatcmpl-CLuVD0fuQTRxBQykmVxJYpGwNvYNG","object":"chat.completion.chunk","created":1759338119,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"call_kYU1819sCpbdml5v79PhaFOK","type":"function","function":{"name":"write","arguments":""}}],"refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"s2bhEvgGX6Z"} - data: {"id":"chatcmpl-CLuBhSR44pSKvR5yS77v599H7UO4P","object":"chat.completion.chunk","created":1759336909,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"nhKZw9X1SfdTmUa"} + data: {"id":"chatcmpl-CLuVD0fuQTRxBQykmVxJYpGwNvYNG","object":"chat.completion.chunk","created":1759338119,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"IQioX8ojahgoEbE"} - data: {"id":"chatcmpl-CLuBhSR44pSKvR5yS77v599H7UO4P","object":"chat.completion.chunk","created":1759336909,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"file"}}]},"finish_reason":null}],"usage":null,"obfuscation":"FSjVXdw1VEqO6G"} + data: {"id":"chatcmpl-CLuVD0fuQTRxBQykmVxJYpGwNvYNG","object":"chat.completion.chunk","created":1759338119,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"file"}}]},"finish_reason":null}],"usage":null,"obfuscation":"dYStDxHqxs9qxN"} - data: {"id":"chatcmpl-CLuBhSR44pSKvR5yS77v599H7UO4P","object":"chat.completion.chunk","created":1759336909,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_path"}}]},"finish_reason":null}],"usage":null,"obfuscation":"6LSuEol49qZMY"} + data: {"id":"chatcmpl-CLuVD0fuQTRxBQykmVxJYpGwNvYNG","object":"chat.completion.chunk","created":1759338119,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_path"}}]},"finish_reason":null}],"usage":null,"obfuscation":"WU9U1GvdNSIRP"} - data: {"id":"chatcmpl-CLuBhSR44pSKvR5yS77v599H7UO4P","object":"chat.completion.chunk","created":1759336909,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":"}}]},"finish_reason":null}],"usage":null,"obfuscation":"pqwwqMuUt9P4zLB"} + data: {"id":"chatcmpl-CLuVD0fuQTRxBQykmVxJYpGwNvYNG","object":"chat.completion.chunk","created":1759338119,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":"}}]},"finish_reason":null}],"usage":null,"obfuscation":"XEfAF1EOAuMlQ3h"} - data: {"id":"chatcmpl-CLuBhSR44pSKvR5yS77v599H7UO4P","object":"chat.completion.chunk","created":1759336909,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"/"}}]},"finish_reason":null}],"usage":null,"obfuscation":"DVZ6DkedMSYMDLW"} + data: {"id":"chatcmpl-CLuVD0fuQTRxBQykmVxJYpGwNvYNG","object":"chat.completion.chunk","created":1759338119,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"/"}}]},"finish_reason":null}],"usage":null,"obfuscation":"0CeXd5Z0DWJGivW"} - data: {"id":"chatcmpl-CLuBhSR44pSKvR5yS77v599H7UO4P","object":"chat.completion.chunk","created":1759336909,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"tmp"}}]},"finish_reason":null}],"usage":null,"obfuscation":"ISOS4M0DwfRpm4a"} + data: {"id":"chatcmpl-CLuVD0fuQTRxBQykmVxJYpGwNvYNG","object":"chat.completion.chunk","created":1759338119,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"tmp"}}]},"finish_reason":null}],"usage":null,"obfuscation":"p87ge1ekzIaPDB3"} - data: {"id":"chatcmpl-CLuBhSR44pSKvR5yS77v599H7UO4P","object":"chat.completion.chunk","created":1759336909,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/cr"}}]},"finish_reason":null}],"usage":null,"obfuscation":"cryCnEfrtfEysV2"} + data: {"id":"chatcmpl-CLuVD0fuQTRxBQykmVxJYpGwNvYNG","object":"chat.completion.chunk","created":1759338119,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/cr"}}]},"finish_reason":null}],"usage":null,"obfuscation":"qc7oPvjcF1vbBkl"} - data: {"id":"chatcmpl-CLuBhSR44pSKvR5yS77v599H7UO4P","object":"chat.completion.chunk","created":1759336909,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ush"}}]},"finish_reason":null}],"usage":null,"obfuscation":"6vO7TK8pkLYpSNm"} + data: {"id":"chatcmpl-CLuVD0fuQTRxBQykmVxJYpGwNvYNG","object":"chat.completion.chunk","created":1759338119,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ush"}}]},"finish_reason":null}],"usage":null,"obfuscation":"MaHrUT2jjg6uxMO"} - data: {"id":"chatcmpl-CLuBhSR44pSKvR5yS77v599H7UO4P","object":"chat.completion.chunk","created":1759336909,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"-test"}}]},"finish_reason":null}],"usage":null,"obfuscation":"bVBCVOT0f2wik"} + data: {"id":"chatcmpl-CLuVD0fuQTRxBQykmVxJYpGwNvYNG","object":"chat.completion.chunk","created":1759338119,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"-test"}}]},"finish_reason":null}],"usage":null,"obfuscation":"QsHkSfx1g3fc3"} - data: {"id":"chatcmpl-CLuBhSR44pSKvR5yS77v599H7UO4P","object":"chat.completion.chunk","created":1759336909,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/Test"}}]},"finish_reason":null}],"usage":null,"obfuscation":"AjsOzO5lUCajn"} + data: {"id":"chatcmpl-CLuVD0fuQTRxBQykmVxJYpGwNvYNG","object":"chat.completion.chunk","created":1759338119,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/Test"}}]},"finish_reason":null}],"usage":null,"obfuscation":"g4YTM2RISS7bF"} - data: {"id":"chatcmpl-CLuBhSR44pSKvR5yS77v599H7UO4P","object":"chat.completion.chunk","created":1759336909,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Coder"}}]},"finish_reason":null}],"usage":null,"obfuscation":"OjeO06O8lHKaX"} + data: {"id":"chatcmpl-CLuVD0fuQTRxBQykmVxJYpGwNvYNG","object":"chat.completion.chunk","created":1759338119,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Coder"}}]},"finish_reason":null}],"usage":null,"obfuscation":"NQ9vWVOuN8GaS"} - data: {"id":"chatcmpl-CLuBhSR44pSKvR5yS77v599H7UO4P","object":"chat.completion.chunk","created":1759336909,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Agent"}}]},"finish_reason":null}],"usage":null,"obfuscation":"NqXFItxWbFrRn"} + data: {"id":"chatcmpl-CLuVD0fuQTRxBQykmVxJYpGwNvYNG","object":"chat.completion.chunk","created":1759338119,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"Agent"}}]},"finish_reason":null}],"usage":null,"obfuscation":"A0OF4EOOICk8E"} - data: {"id":"chatcmpl-CLuBhSR44pSKvR5yS77v599H7UO4P","object":"chat.completion.chunk","created":1759336909,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/open"}}]},"finish_reason":null}],"usage":null,"obfuscation":"KIoCkHTMD6p2z"} + data: {"id":"chatcmpl-CLuVD0fuQTRxBQykmVxJYpGwNvYNG","object":"chat.completion.chunk","created":1759338119,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/open"}}]},"finish_reason":null}],"usage":null,"obfuscation":"k0OZ3VWcfbl66"} - data: {"id":"chatcmpl-CLuBhSR44pSKvR5yS77v599H7UO4P","object":"chat.completion.chunk","created":1759336909,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ai"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuVD0fuQTRxBQykmVxJYpGwNvYNG","object":"chat.completion.chunk","created":1759338119,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"ai"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLuBhSR44pSKvR5yS77v599H7UO4P","object":"chat.completion.chunk","created":1759336909,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"-g"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuVD0fuQTRxBQykmVxJYpGwNvYNG","object":"chat.completion.chunk","created":1759338119,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"-g"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLuBhSR44pSKvR5yS77v599H7UO4P","object":"chat.completion.chunk","created":1759336909,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"pt"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuVD0fuQTRxBQykmVxJYpGwNvYNG","object":"chat.completion.chunk","created":1759338119,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"pt"}}]},"finish_reason":null}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLuBhSR44pSKvR5yS77v599H7UO4P","object":"chat.completion.chunk","created":1759336909,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"-"}}]},"finish_reason":null}],"usage":null,"obfuscation":"k"} + data: {"id":"chatcmpl-CLuVD0fuQTRxBQykmVxJYpGwNvYNG","object":"chat.completion.chunk","created":1759338119,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"-"}}]},"finish_reason":null}],"usage":null,"obfuscation":"z"} - data: {"id":"chatcmpl-CLuBhSR44pSKvR5yS77v599H7UO4P","object":"chat.completion.chunk","created":1759336909,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"5"}}]},"finish_reason":null}],"usage":null,"obfuscation":"L"} + data: {"id":"chatcmpl-CLuVD0fuQTRxBQykmVxJYpGwNvYNG","object":"chat.completion.chunk","created":1759338119,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"5"}}]},"finish_reason":null}],"usage":null,"obfuscation":"L"} - data: {"id":"chatcmpl-CLuBhSR44pSKvR5yS77v599H7UO4P","object":"chat.completion.chunk","created":1759336909,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/write"}}]},"finish_reason":null}],"usage":null,"obfuscation":"O6Bs50BmSlKo"} + data: {"id":"chatcmpl-CLuVD0fuQTRxBQykmVxJYpGwNvYNG","object":"chat.completion.chunk","created":1759338119,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/write"}}]},"finish_reason":null}],"usage":null,"obfuscation":"qEHrayGB0SyW"} - data: {"id":"chatcmpl-CLuBhSR44pSKvR5yS77v599H7UO4P","object":"chat.completion.chunk","created":1759336909,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_tool"}}]},"finish_reason":null}],"usage":null,"obfuscation":"IQ5Qlcl7EEr2S"} + data: {"id":"chatcmpl-CLuVD0fuQTRxBQykmVxJYpGwNvYNG","object":"chat.completion.chunk","created":1759338119,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"_tool"}}]},"finish_reason":null}],"usage":null,"obfuscation":"IvWutZTdjvJI7"} - data: {"id":"chatcmpl-CLuBhSR44pSKvR5yS77v599H7UO4P","object":"chat.completion.chunk","created":1759336909,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/config"}}]},"finish_reason":null}],"usage":null,"obfuscation":"8luremBjToF"} + data: {"id":"chatcmpl-CLuVD0fuQTRxBQykmVxJYpGwNvYNG","object":"chat.completion.chunk","created":1759338119,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"/config"}}]},"finish_reason":null}],"usage":null,"obfuscation":"mkUVjbFFWjQ"} - data: {"id":"chatcmpl-CLuBhSR44pSKvR5yS77v599H7UO4P","object":"chat.completion.chunk","created":1759336909,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":".json"}}]},"finish_reason":null}],"usage":null,"obfuscation":"mbRxYdCQ2iLNo"} + data: {"id":"chatcmpl-CLuVD0fuQTRxBQykmVxJYpGwNvYNG","object":"chat.completion.chunk","created":1759338119,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":".json"}}]},"finish_reason":null}],"usage":null,"obfuscation":"1pTDrHGS2Uqa0"} - data: {"id":"chatcmpl-CLuBhSR44pSKvR5yS77v599H7UO4P","object":"chat.completion.chunk","created":1759336909,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\",\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"EY9IEDsw9meDH"} + data: {"id":"chatcmpl-CLuVD0fuQTRxBQykmVxJYpGwNvYNG","object":"chat.completion.chunk","created":1759338119,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\",\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"lz0JptwqtQoME"} - data: {"id":"chatcmpl-CLuBhSR44pSKvR5yS77v599H7UO4P","object":"chat.completion.chunk","created":1759336909,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"content"}}]},"finish_reason":null}],"usage":null,"obfuscation":"rWCByBxnIZR"} + data: {"id":"chatcmpl-CLuVD0fuQTRxBQykmVxJYpGwNvYNG","object":"chat.completion.chunk","created":1759338119,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"content"}}]},"finish_reason":null}],"usage":null,"obfuscation":"hiHC0UyN2Wj"} - data: {"id":"chatcmpl-CLuBhSR44pSKvR5yS77v599H7UO4P","object":"chat.completion.chunk","created":1759336909,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"doiI4zHEzx1MF"} + data: {"id":"chatcmpl-CLuVD0fuQTRxBQykmVxJYpGwNvYNG","object":"chat.completion.chunk","created":1759338119,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\":\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"FWAMFtPo2ZYWT"} - data: {"id":"chatcmpl-CLuBhSR44pSKvR5yS77v599H7UO4P","object":"chat.completion.chunk","created":1759336909,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\\\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"3pFEGHVZ6nanj"} + data: {"id":"chatcmpl-CLuVD0fuQTRxBQykmVxJYpGwNvYNG","object":"chat.completion.chunk","created":1759338119,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"{\\\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"6cnORAOSPAOPP"} - data: {"id":"chatcmpl-CLuBhSR44pSKvR5yS77v599H7UO4P","object":"chat.completion.chunk","created":1759336909,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"name"}}]},"finish_reason":null}],"usage":null,"obfuscation":"CsOxXtLXfyHaP8"} + data: {"id":"chatcmpl-CLuVD0fuQTRxBQykmVxJYpGwNvYNG","object":"chat.completion.chunk","created":1759338119,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"name"}}]},"finish_reason":null}],"usage":null,"obfuscation":"ktBQgV7JgaDDTz"} - data: {"id":"chatcmpl-CLuBhSR44pSKvR5yS77v599H7UO4P","object":"chat.completion.chunk","created":1759336909,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\\\":"}}]},"finish_reason":null}],"usage":null,"obfuscation":"oLJiB9q3AmjBo"} + data: {"id":"chatcmpl-CLuVD0fuQTRxBQykmVxJYpGwNvYNG","object":"chat.completion.chunk","created":1759338119,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\\\":"}}]},"finish_reason":null}],"usage":null,"obfuscation":"WXceV6I8Miwhj"} - data: {"id":"chatcmpl-CLuBhSR44pSKvR5yS77v599H7UO4P","object":"chat.completion.chunk","created":1759336909,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" \\\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"NDgrTByKCVUEO"} + data: {"id":"chatcmpl-CLuVD0fuQTRxBQykmVxJYpGwNvYNG","object":"chat.completion.chunk","created":1759338119,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" \\\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"B73Y5IuY3TShQ"} - data: {"id":"chatcmpl-CLuBhSR44pSKvR5yS77v599H7UO4P","object":"chat.completion.chunk","created":1759336909,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"test"}}]},"finish_reason":null}],"usage":null,"obfuscation":"WLWUY8d99jH3jj"} + data: {"id":"chatcmpl-CLuVD0fuQTRxBQykmVxJYpGwNvYNG","object":"chat.completion.chunk","created":1759338119,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"test"}}]},"finish_reason":null}],"usage":null,"obfuscation":"Of2TodpyDkiPkC"} - data: {"id":"chatcmpl-CLuBhSR44pSKvR5yS77v599H7UO4P","object":"chat.completion.chunk","created":1759336909,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\\\","}}]},"finish_reason":null}],"usage":null,"obfuscation":"DWLjTD7EkSwjo"} + data: {"id":"chatcmpl-CLuVD0fuQTRxBQykmVxJYpGwNvYNG","object":"chat.completion.chunk","created":1759338119,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\\\","}}]},"finish_reason":null}],"usage":null,"obfuscation":"1JP5z9WDENxnk"} - data: {"id":"chatcmpl-CLuBhSR44pSKvR5yS77v599H7UO4P","object":"chat.completion.chunk","created":1759336909,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" \\\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"ckGpdYIWC3ati"} + data: {"id":"chatcmpl-CLuVD0fuQTRxBQykmVxJYpGwNvYNG","object":"chat.completion.chunk","created":1759338119,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" \\\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"ii3UpMbAwcTk2"} - data: {"id":"chatcmpl-CLuBhSR44pSKvR5yS77v599H7UO4P","object":"chat.completion.chunk","created":1759336909,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"version"}}]},"finish_reason":null}],"usage":null,"obfuscation":"ijBi1bSrTqB"} + data: {"id":"chatcmpl-CLuVD0fuQTRxBQykmVxJYpGwNvYNG","object":"chat.completion.chunk","created":1759338119,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"version"}}]},"finish_reason":null}],"usage":null,"obfuscation":"HlEG9mtGkFZ"} - data: {"id":"chatcmpl-CLuBhSR44pSKvR5yS77v599H7UO4P","object":"chat.completion.chunk","created":1759336909,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\\\":"}}]},"finish_reason":null}],"usage":null,"obfuscation":"zG4MjeWbrXFH8"} + data: {"id":"chatcmpl-CLuVD0fuQTRxBQykmVxJYpGwNvYNG","object":"chat.completion.chunk","created":1759338119,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\\\":"}}]},"finish_reason":null}],"usage":null,"obfuscation":"10fnVwekl3Tlm"} - data: {"id":"chatcmpl-CLuBhSR44pSKvR5yS77v599H7UO4P","object":"chat.completion.chunk","created":1759336909,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" \\\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"ApCQobh5kSFmJ"} + data: {"id":"chatcmpl-CLuVD0fuQTRxBQykmVxJYpGwNvYNG","object":"chat.completion.chunk","created":1759338119,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":" \\\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"O4IJo4uSFZ6bA"} - data: {"id":"chatcmpl-CLuBhSR44pSKvR5yS77v599H7UO4P","object":"chat.completion.chunk","created":1759336909,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"1"}}]},"finish_reason":null}],"usage":null,"obfuscation":"G"} + data: {"id":"chatcmpl-CLuVD0fuQTRxBQykmVxJYpGwNvYNG","object":"chat.completion.chunk","created":1759338119,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"1"}}]},"finish_reason":null}],"usage":null,"obfuscation":"W"} - data: {"id":"chatcmpl-CLuBhSR44pSKvR5yS77v599H7UO4P","object":"chat.completion.chunk","created":1759336909,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"."}}]},"finish_reason":null}],"usage":null,"obfuscation":"I"} + data: {"id":"chatcmpl-CLuVD0fuQTRxBQykmVxJYpGwNvYNG","object":"chat.completion.chunk","created":1759338119,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"."}}]},"finish_reason":null}],"usage":null,"obfuscation":"a"} - data: {"id":"chatcmpl-CLuBhSR44pSKvR5yS77v599H7UO4P","object":"chat.completion.chunk","created":1759336909,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"0"}}]},"finish_reason":null}],"usage":null,"obfuscation":"B"} + data: {"id":"chatcmpl-CLuVD0fuQTRxBQykmVxJYpGwNvYNG","object":"chat.completion.chunk","created":1759338119,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"0"}}]},"finish_reason":null}],"usage":null,"obfuscation":"T"} - data: {"id":"chatcmpl-CLuBhSR44pSKvR5yS77v599H7UO4P","object":"chat.completion.chunk","created":1759336909,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"."}}]},"finish_reason":null}],"usage":null,"obfuscation":"W"} + data: {"id":"chatcmpl-CLuVD0fuQTRxBQykmVxJYpGwNvYNG","object":"chat.completion.chunk","created":1759338119,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"."}}]},"finish_reason":null}],"usage":null,"obfuscation":"I"} - data: {"id":"chatcmpl-CLuBhSR44pSKvR5yS77v599H7UO4P","object":"chat.completion.chunk","created":1759336909,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"0"}}]},"finish_reason":null}],"usage":null,"obfuscation":"S"} + data: {"id":"chatcmpl-CLuVD0fuQTRxBQykmVxJYpGwNvYNG","object":"chat.completion.chunk","created":1759338119,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"0"}}]},"finish_reason":null}],"usage":null,"obfuscation":"r"} - data: {"id":"chatcmpl-CLuBhSR44pSKvR5yS77v599H7UO4P","object":"chat.completion.chunk","created":1759336909,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\\\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"nxEUAeuXDzRdgu"} + data: {"id":"chatcmpl-CLuVD0fuQTRxBQykmVxJYpGwNvYNG","object":"chat.completion.chunk","created":1759338119,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\\\""}}]},"finish_reason":null}],"usage":null,"obfuscation":"ckUQFh9o0chUvc"} - data: {"id":"chatcmpl-CLuBhSR44pSKvR5yS77v599H7UO4P","object":"chat.completion.chunk","created":1759336909,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"}"}}]},"finish_reason":null}],"usage":null,"obfuscation":"w"} + data: {"id":"chatcmpl-CLuVD0fuQTRxBQykmVxJYpGwNvYNG","object":"chat.completion.chunk","created":1759338119,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"}"}}]},"finish_reason":null}],"usage":null,"obfuscation":"r"} - data: {"id":"chatcmpl-CLuBhSR44pSKvR5yS77v599H7UO4P","object":"chat.completion.chunk","created":1759336909,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"}"}}]},"finish_reason":null}],"usage":null,"obfuscation":"uMKkMh49Cp0sTY9"} + data: {"id":"chatcmpl-CLuVD0fuQTRxBQykmVxJYpGwNvYNG","object":"chat.completion.chunk","created":1759338119,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"function":{"arguments":"\"}"}}]},"finish_reason":null}],"usage":null,"obfuscation":"1Bp8bcPCPa1K66p"} - data: {"id":"chatcmpl-CLuBhSR44pSKvR5yS77v599H7UO4P","object":"chat.completion.chunk","created":1759336909,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"tool_calls"}],"usage":null,"obfuscation":""} + data: {"id":"chatcmpl-CLuVD0fuQTRxBQykmVxJYpGwNvYNG","object":"chat.completion.chunk","created":1759338119,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"tool_calls"}],"usage":null,"obfuscation":""} - data: {"id":"chatcmpl-CLuBhSR44pSKvR5yS77v599H7UO4P","object":"chat.completion.chunk","created":1759336909,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6569,"completion_tokens":252,"total_tokens":6821,"prompt_tokens_details":{"cached_tokens":1024,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":192,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"L"} + data: {"id":"chatcmpl-CLuVD0fuQTRxBQykmVxJYpGwNvYNG","object":"chat.completion.chunk","created":1759338119,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6579,"completion_tokens":188,"total_tokens":6767,"prompt_tokens_details":{"cached_tokens":1024,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":128,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"8"} data: [DONE] @@ -172,15 +176,15 @@ interactions: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 7.993457459s + duration: 8.004937917s - id: 2 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 31114 + content_length: 31187 host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/write_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use write to create a new file called config.json with content '{\\\"name\\\": \\\"test\\\", \\\"version\\\": \\\"1.0.0\\\"}'\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"call_Vh5tT5MxJ5CaBmLkNwTjfWms\",\"function\":{\"arguments\":\"{\\\"file_path\\\":\\\"/tmp/crush-test/TestCoderAgent/openai-gpt-5/write_tool/config.json\\\",\\\"content\\\":\\\"{\\\\\\\"name\\\\\\\": \\\\\\\"test\\\\\\\", \\\\\\\"version\\\\\\\": \\\\\\\"1.0.0\\\\\\\"}\\\"}\",\"name\":\"write\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"\\nFile successfully written: /tmp/crush-test/TestCoderAgent/openai-gpt-5/write_tool/config.json\\n\",\"tool_call_id\":\"call_Vh5tT5MxJ5CaBmLkNwTjfWms\",\"role\":\"tool\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openai-gpt-5/write_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use write to create a new file called config.json with content '{\\\"name\\\": \\\"test\\\", \\\"version\\\": \\\"1.0.0\\\"}'\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"call_kYU1819sCpbdml5v79PhaFOK\",\"function\":{\"arguments\":\"{\\\"file_path\\\":\\\"/tmp/crush-test/TestCoderAgent/openai-gpt-5/write_tool/config.json\\\",\\\"content\\\":\\\"{\\\\\\\"name\\\\\\\": \\\\\\\"test\\\\\\\", \\\\\\\"version\\\\\\\": \\\\\\\"1.0.0\\\\\\\"}\\\"}\",\"name\":\"write\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"\\nFile successfully written: /tmp/crush-test/TestCoderAgent/openai-gpt-5/write_tool/config.json\\n\",\"tool_call_id\":\"call_kYU1819sCpbdml5v79PhaFOK\",\"role\":\"tool\"}],\"model\":\"gpt-5\",\"max_completion_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}" headers: Accept: - application/json @@ -196,13 +200,13 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"chatcmpl-CLuBqBstADwxGrH1Xc6fMFeAqHf7k","object":"chat.completion.chunk","created":1759336918,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"2RQTFRux8q"} + data: {"id":"chatcmpl-CLuVLBCvlzlS6aAwKoGIyzeU35JOZ","object":"chat.completion.chunk","created":1759338127,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"finish_reason":null}],"usage":null,"obfuscation":"iz2piHhjGq"} - data: {"id":"chatcmpl-CLuBqBstADwxGrH1Xc6fMFeAqHf7k","object":"chat.completion.chunk","created":1759336918,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"done"},"finish_reason":null}],"usage":null,"obfuscation":"BgV3ViON"} + data: {"id":"chatcmpl-CLuVLBCvlzlS6aAwKoGIyzeU35JOZ","object":"chat.completion.chunk","created":1759338127,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"done"},"finish_reason":null}],"usage":null,"obfuscation":"VIjT69id"} - data: {"id":"chatcmpl-CLuBqBstADwxGrH1Xc6fMFeAqHf7k","object":"chat.completion.chunk","created":1759336918,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"stop"}],"usage":null,"obfuscation":"lcy2cb"} + data: {"id":"chatcmpl-CLuVLBCvlzlS6aAwKoGIyzeU35JOZ","object":"chat.completion.chunk","created":1759338127,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{},"finish_reason":"stop"}],"usage":null,"obfuscation":"EwULX5"} - data: {"id":"chatcmpl-CLuBqBstADwxGrH1Xc6fMFeAqHf7k","object":"chat.completion.chunk","created":1759336918,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6662,"completion_tokens":4,"total_tokens":6666,"prompt_tokens_details":{"cached_tokens":1024,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"kVGQE"} + data: {"id":"chatcmpl-CLuVLBCvlzlS6aAwKoGIyzeU35JOZ","object":"chat.completion.chunk","created":1759338127,"model":"gpt-5-2025-08-07","service_tier":"default","system_fingerprint":null,"choices":[],"usage":{"prompt_tokens":6672,"completion_tokens":4,"total_tokens":6676,"prompt_tokens_details":{"cached_tokens":6528,"audio_tokens":0},"completion_tokens_details":{"reasoning_tokens":0,"audio_tokens":0,"accepted_prediction_tokens":0,"rejected_prediction_tokens":0}},"obfuscation":"iC4TO"} data: [DONE] @@ -211,4 +215,4 @@ interactions: - text/event-stream; charset=utf-8 status: 200 OK code: 200 - duration: 2.395777583s + duration: 1.795134333s diff --git a/internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/bash_tool.yaml b/internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/bash_tool.yaml index bfe210f1ad7c7eb63d750efffcb43a281d24b07b..d6894355b7cb9d685347c3de6b06114d00e2bb98 100644 --- a/internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/bash_tool.yaml +++ b/internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/bash_tool.yaml @@ -24,21 +24,21 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"gen-1759336954-fEBioyfTEln652sh0qHZ","provider":"Hyperbolic","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336954,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338160-lia6XT1140YVD1V8HPPw","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338160,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336954-fEBioyfTEln652sh0qHZ","provider":"Hyperbolic","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336954,"choices":[{"index":0,"delta":{"role":"assistant","content":"Create"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338160-lia6XT1140YVD1V8HPPw","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338160,"choices":[{"index":0,"delta":{"role":"assistant","content":"Create"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336954-fEBioyfTEln652sh0qHZ","provider":"Hyperbolic","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336954,"choices":[{"index":0,"delta":{"role":"assistant","content":" test"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338160-lia6XT1140YVD1V8HPPw","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338160,"choices":[{"index":0,"delta":{"role":"assistant","content":" test"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336954-fEBioyfTEln652sh0qHZ","provider":"Hyperbolic","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336954,"choices":[{"index":0,"delta":{"role":"assistant","content":".txt with"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338160-lia6XT1140YVD1V8HPPw","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338160,"choices":[{"index":0,"delta":{"role":"assistant","content":".txt with"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336954-fEBioyfTEln652sh0qHZ","provider":"Hyperbolic","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336954,"choices":[{"index":0,"delta":{"role":"assistant","content":" hello bash using"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338160-lia6XT1140YVD1V8HPPw","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338160,"choices":[{"index":0,"delta":{"role":"assistant","content":" hello bash using"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336954-fEBioyfTEln652sh0qHZ","provider":"Hyperbolic","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336954,"choices":[{"index":0,"delta":{"role":"assistant","content":" bash"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338160-lia6XT1140YVD1V8HPPw","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338160,"choices":[{"index":0,"delta":{"role":"assistant","content":" bash"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336954-fEBioyfTEln652sh0qHZ","provider":"Hyperbolic","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336954,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]} + data: {"id":"gen-1759338160-lia6XT1140YVD1V8HPPw","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338160,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]} - data: {"id":"gen-1759336954-fEBioyfTEln652sh0qHZ","provider":"Hyperbolic","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336954,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":127,"completion_tokens":9,"total_tokens":136,"cost":0.0000408,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0000381,"upstream_inference_completions_cost":0.0000027},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} + data: {"id":"gen-1759338160-lia6XT1140YVD1V8HPPw","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338160,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":127,"completion_tokens":9,"total_tokens":136,"cost":0.00002985,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.00001905,"upstream_inference_completions_cost":0.0000108},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} data: [DONE] @@ -47,15 +47,15 @@ interactions: - text/event-stream status: 200 OK code: 200 - duration: 1.5252395s + duration: 685.759709ms - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 30619 + content_length: 30692 host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/bash_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use bash to create a file named test.txt with content 'hello bash'\",\"role\":\"user\"}],\"model\":\"moonshotai/kimi-k2-0905\",\"max_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"usage\":{\"include\":true},\"stream\":true}" + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/bash_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use bash to create a file named test.txt with content 'hello bash'\",\"role\":\"user\"}],\"model\":\"moonshotai/kimi-k2-0905\",\"max_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"usage\":{\"include\":true},\"stream\":true}" headers: Accept: - application/json @@ -71,61 +71,63 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"gen-1759336954-gkw7fOBXCpFOxg4ADB83","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336954,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338160-FSX9vWUPmpA3qKMJIEJE","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338160,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336954-gkw7fOBXCpFOxg4ADB83","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336954,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":"functions.bash:0","index":0,"type":"function","function":{"name":"bash","arguments":""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338160-FSX9vWUPmpA3qKMJIEJE","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338160,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"bash:0","type":"function","function":{"name":"bash"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336954-gkw7fOBXCpFOxg4ADB83","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336954,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"{\"command"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338160-FSX9vWUPmpA3qKMJIEJE","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338160,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"{\""},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336954-gkw7fOBXCpFOxg4ADB83","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336954,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338160-FSX9vWUPmpA3qKMJIEJE","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338160,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"command"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336954-gkw7fOBXCpFOxg4ADB83","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336954,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":" \""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338160-FSX9vWUPmpA3qKMJIEJE","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338160,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"\":"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336954-gkw7fOBXCpFOxg4ADB83","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336954,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"echo"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338160-FSX9vWUPmpA3qKMJIEJE","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338160,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":" \""},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336954-gkw7fOBXCpFOxg4ADB83","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336954,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":" '"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338160-FSX9vWUPmpA3qKMJIEJE","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338160,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"echo"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336954-gkw7fOBXCpFOxg4ADB83","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336954,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"hello"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338160-FSX9vWUPmpA3qKMJIEJE","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338160,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":" '"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336954-gkw7fOBXCpFOxg4ADB83","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336954,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":" bash"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338160-FSX9vWUPmpA3qKMJIEJE","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338160,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"hello"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336954-gkw7fOBXCpFOxg4ADB83","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336954,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"'"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338160-FSX9vWUPmpA3qKMJIEJE","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338160,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":" bash"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336954-gkw7fOBXCpFOxg4ADB83","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336954,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":" >"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338160-FSX9vWUPmpA3qKMJIEJE","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338160,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"'"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336954-gkw7fOBXCpFOxg4ADB83","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336954,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":" test"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338160-FSX9vWUPmpA3qKMJIEJE","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338160,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":" >"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336954-gkw7fOBXCpFOxg4ADB83","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336954,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":".txt"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338160-FSX9vWUPmpA3qKMJIEJE","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338160,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":" test"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336954-gkw7fOBXCpFOxg4ADB83","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336954,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"\","}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338160-FSX9vWUPmpA3qKMJIEJE","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338160,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":".txt"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336954-gkw7fOBXCpFOxg4ADB83","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336954,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":" \""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338160-FSX9vWUPmpA3qKMJIEJE","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338160,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"\","},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336954-gkw7fOBXCpFOxg4ADB83","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336954,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"description"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338160-FSX9vWUPmpA3qKMJIEJE","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338160,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":" \""},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336954-gkw7fOBXCpFOxg4ADB83","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336954,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338160-FSX9vWUPmpA3qKMJIEJE","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338160,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"description"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336954-gkw7fOBXCpFOxg4ADB83","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336954,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":" \""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338160-FSX9vWUPmpA3qKMJIEJE","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338160,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"\":"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336954-gkw7fOBXCpFOxg4ADB83","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336954,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"Create"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338160-FSX9vWUPmpA3qKMJIEJE","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338160,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":" \""},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336954-gkw7fOBXCpFOxg4ADB83","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336954,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":" test"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338160-FSX9vWUPmpA3qKMJIEJE","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338160,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"Create"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336954-gkw7fOBXCpFOxg4ADB83","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336954,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":".txt"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338160-FSX9vWUPmpA3qKMJIEJE","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338160,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":" test"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336954-gkw7fOBXCpFOxg4ADB83","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336954,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":" with"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338160-FSX9vWUPmpA3qKMJIEJE","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338160,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":".txt"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336954-gkw7fOBXCpFOxg4ADB83","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336954,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":" hello"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338160-FSX9vWUPmpA3qKMJIEJE","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338160,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":" with"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336954-gkw7fOBXCpFOxg4ADB83","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336954,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":" bash"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338160-FSX9vWUPmpA3qKMJIEJE","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338160,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":" hello"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336954-gkw7fOBXCpFOxg4ADB83","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336954,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":" content"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338160-FSX9vWUPmpA3qKMJIEJE","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338160,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":" bash"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336954-gkw7fOBXCpFOxg4ADB83","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336954,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"\"}"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338160-FSX9vWUPmpA3qKMJIEJE","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338160,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":" content"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336954-gkw7fOBXCpFOxg4ADB83","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336954,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"tool_calls","native_finish_reason":"tool_calls","logprobs":null}]} + data: {"id":"gen-1759338160-FSX9vWUPmpA3qKMJIEJE","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338160,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"\"}"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336954-gkw7fOBXCpFOxg4ADB83","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336954,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":7195,"completion_tokens":36,"total_tokens":7231,"cost":0.002959,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.002878,"upstream_inference_completions_cost":0.000081},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} + data: {"id":"gen-1759338160-FSX9vWUPmpA3qKMJIEJE","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338160,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"tool_calls","native_finish_reason":"tool_calls","logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759338160-FSX9vWUPmpA3qKMJIEJE","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338160,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":7579,"completion_tokens":35,"total_tokens":7614,"cost":0.0046349,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0045474,"upstream_inference_completions_cost":0.0000875},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} data: [DONE] @@ -134,15 +136,15 @@ interactions: - text/event-stream status: 200 OK code: 200 - duration: 1.524237958s + duration: 5.550751333s - id: 2 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 30980 + content_length: 31053 host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/bash_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use bash to create a file named test.txt with content 'hello bash'\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"TestCoderAgent/openrouter-kimi-k2/bash_tool-1\",\"function\":{\"arguments\":\"{\\\"command\\\": \\\"echo 'hello bash' > test.txt\\\", \\\"description\\\": \\\"Create test.txt with hello bash content\\\"}\",\"name\":\"bash\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"no output\",\"tool_call_id\":\"TestCoderAgent/openrouter-kimi-k2/bash_tool-1\",\"role\":\"tool\"}],\"model\":\"moonshotai/kimi-k2-0905\",\"max_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"usage\":{\"include\":true},\"stream\":true}" + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/bash_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use bash to create a file named test.txt with content 'hello bash'\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"TestCoderAgent/openrouter-kimi-k2/bash_tool-1\",\"function\":{\"arguments\":\"{\\\"command\\\": \\\"echo 'hello bash' > test.txt\\\", \\\"description\\\": \\\"Create test.txt with hello bash content\\\"}\",\"name\":\"bash\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"no output\",\"tool_call_id\":\"TestCoderAgent/openrouter-kimi-k2/bash_tool-1\",\"role\":\"tool\"}],\"model\":\"moonshotai/kimi-k2-0905\",\"max_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"usage\":{\"include\":true},\"stream\":true}" headers: Accept: - application/json @@ -158,11 +160,39 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"gen-1759336956-wWHLSVfXxk0HK6zkkdO2","provider":"DeepInfra","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336956,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338167-r4zXlPvWV8RM56vkzlDF","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338167,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759338167-r4zXlPvWV8RM56vkzlDF","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338167,"choices":[{"index":0,"delta":{"role":"assistant","content":"Done"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759338167-r4zXlPvWV8RM56vkzlDF","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338167,"choices":[{"index":0,"delta":{"role":"assistant","content":"."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759338167-r4zXlPvWV8RM56vkzlDF","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338167,"choices":[{"index":0,"delta":{"role":"assistant","content":" Created"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759338167-r4zXlPvWV8RM56vkzlDF","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338167,"choices":[{"index":0,"delta":{"role":"assistant","content":" `"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759338167-r4zXlPvWV8RM56vkzlDF","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338167,"choices":[{"index":0,"delta":{"role":"assistant","content":"test"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759338167-r4zXlPvWV8RM56vkzlDF","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338167,"choices":[{"index":0,"delta":{"role":"assistant","content":".txt"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759338167-r4zXlPvWV8RM56vkzlDF","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338167,"choices":[{"index":0,"delta":{"role":"assistant","content":"`"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759338167-r4zXlPvWV8RM56vkzlDF","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338167,"choices":[{"index":0,"delta":{"role":"assistant","content":" with"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759338167-r4zXlPvWV8RM56vkzlDF","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338167,"choices":[{"index":0,"delta":{"role":"assistant","content":" '"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759338167-r4zXlPvWV8RM56vkzlDF","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338167,"choices":[{"index":0,"delta":{"role":"assistant","content":"hello"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759338167-r4zXlPvWV8RM56vkzlDF","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338167,"choices":[{"index":0,"delta":{"role":"assistant","content":" bash"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759338167-r4zXlPvWV8RM56vkzlDF","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338167,"choices":[{"index":0,"delta":{"role":"assistant","content":"'"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759338167-r4zXlPvWV8RM56vkzlDF","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338167,"choices":[{"index":0,"delta":{"role":"assistant","content":" content"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759338167-r4zXlPvWV8RM56vkzlDF","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338167,"choices":[{"index":0,"delta":{"role":"assistant","content":"."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336956-wWHLSVfXxk0HK6zkkdO2","provider":"DeepInfra","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336956,"choices":[{"index":0,"delta":{"role":"assistant","content":"done"},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]} + data: {"id":"gen-1759338167-r4zXlPvWV8RM56vkzlDF","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338167,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336956-wWHLSVfXxk0HK6zkkdO2","provider":"DeepInfra","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336956,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":7348,"completion_tokens":1,"total_tokens":7349,"cost":0.003676,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.003674,"upstream_inference_completions_cost":0.000002},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} + data: {"id":"gen-1759338167-r4zXlPvWV8RM56vkzlDF","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338167,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":7633,"completion_tokens":15,"total_tokens":7648,"cost":0.0046173,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0045798,"upstream_inference_completions_cost":0.0000375},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} data: [DONE] @@ -171,4 +201,4 @@ interactions: - text/event-stream status: 200 OK code: 200 - duration: 767.031583ms + duration: 1.8852045s diff --git a/internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/download_tool.yaml b/internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/download_tool.yaml index a5c7d4c630a034e669ef76ad879659eead1cd7dd..1c3be13d8e788fe5c4e48b288efc961dd5cbb85a 100644 --- a/internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/download_tool.yaml +++ b/internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/download_tool.yaml @@ -24,19 +24,19 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"gen-1759337052-ukmOPu82M3vZjAu1m5mk","provider":"GMICloud","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759337052,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338169-VQuyzuINOaDHVo3ymv6R","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338170,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337052-ukmOPu82M3vZjAu1m5mk","provider":"GMICloud","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759337052,"choices":[{"index":0,"delta":{"role":"assistant","content":"Download"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338169-VQuyzuINOaDHVo3ymv6R","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338170,"choices":[{"index":0,"delta":{"role":"assistant","content":"Download"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337052-ukmOPu82M3vZjAu1m5mk","provider":"GMICloud","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759337052,"choices":[{"index":0,"delta":{"role":"assistant","content":" robots"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338169-VQuyzuINOaDHVo3ymv6R","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338170,"choices":[{"index":0,"delta":{"role":"assistant","content":" robots"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337052-ukmOPu82M3vZjAu1m5mk","provider":"GMICloud","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759337052,"choices":[{"index":0,"delta":{"role":"assistant","content":".txt from httpbin"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338169-VQuyzuINOaDHVo3ymv6R","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338170,"choices":[{"index":0,"delta":{"role":"assistant","content":".txt from httpbin"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337052-ukmOPu82M3vZjAu1m5mk","provider":"GMICloud","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759337052,"choices":[{"index":0,"delta":{"role":"assistant","content":".org"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338169-VQuyzuINOaDHVo3ymv6R","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338170,"choices":[{"index":0,"delta":{"role":"assistant","content":".org"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337052-ukmOPu82M3vZjAu1m5mk","provider":"GMICloud","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759337052,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]} + data: {"id":"gen-1759338169-VQuyzuINOaDHVo3ymv6R","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338170,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]} - data: {"id":"gen-1759337052-ukmOPu82M3vZjAu1m5mk","provider":"GMICloud","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759337052,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":130,"completion_tokens":8,"total_tokens":138,"cost":0.0000315,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0000195,"upstream_inference_completions_cost":0.000012},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} + data: {"id":"gen-1759338169-VQuyzuINOaDHVo3ymv6R","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338170,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":130,"completion_tokens":8,"total_tokens":138,"cost":0.0000291,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0000195,"upstream_inference_completions_cost":0.0000096},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} data: [DONE] @@ -45,15 +45,15 @@ interactions: - text/event-stream status: 200 OK code: 200 - duration: 1.326235334s + duration: 941.629583ms - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 30636 + content_length: 30709 host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/download_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"download the file from https://httpbin.org/robots.txt and save it as robots.txt\",\"role\":\"user\"}],\"model\":\"moonshotai/kimi-k2-0905\",\"max_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"usage\":{\"include\":true},\"stream\":true}" + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/download_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"download the file from https://httpbin.org/robots.txt and save it as robots.txt\",\"role\":\"user\"}],\"model\":\"moonshotai/kimi-k2-0905\",\"max_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"usage\":{\"include\":true},\"stream\":true}" headers: Accept: - application/json @@ -69,57 +69,57 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"gen-1759337052-pATUbGfjwIvQofxPlXL2","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337052,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338169-ErCUUjfqLbSCRPRZH3Kk","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338169,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337052-pATUbGfjwIvQofxPlXL2","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337052,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":"functions.download:0","index":0,"type":"function","function":{"name":"download","arguments":""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338169-ErCUUjfqLbSCRPRZH3Kk","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338169,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":"functions.download:0","index":0,"type":"function","function":{"name":"download","arguments":""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337052-pATUbGfjwIvQofxPlXL2","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337052,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"{\"url"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338169-ErCUUjfqLbSCRPRZH3Kk","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338169,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"{\"url"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337052-pATUbGfjwIvQofxPlXL2","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337052,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338169-ErCUUjfqLbSCRPRZH3Kk","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338169,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337052-pATUbGfjwIvQofxPlXL2","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337052,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":" \""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338169-ErCUUjfqLbSCRPRZH3Kk","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338169,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":" \""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337052-pATUbGfjwIvQofxPlXL2","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337052,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"https"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338169-ErCUUjfqLbSCRPRZH3Kk","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338169,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"https"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337052-pATUbGfjwIvQofxPlXL2","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337052,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"://"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338169-ErCUUjfqLbSCRPRZH3Kk","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338169,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"://"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337052-pATUbGfjwIvQofxPlXL2","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337052,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"http"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338169-ErCUUjfqLbSCRPRZH3Kk","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338169,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"http"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337052-pATUbGfjwIvQofxPlXL2","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337052,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"bin"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338169-ErCUUjfqLbSCRPRZH3Kk","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338169,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"bin"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337052-pATUbGfjwIvQofxPlXL2","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337052,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":".org"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338169-ErCUUjfqLbSCRPRZH3Kk","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338169,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":".org"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337052-pATUbGfjwIvQofxPlXL2","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337052,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"/"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338169-ErCUUjfqLbSCRPRZH3Kk","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338169,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"/"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337052-pATUbGfjwIvQofxPlXL2","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337052,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"rob"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338169-ErCUUjfqLbSCRPRZH3Kk","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338169,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"rob"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337052-pATUbGfjwIvQofxPlXL2","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337052,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"ots"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338169-ErCUUjfqLbSCRPRZH3Kk","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338169,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"ots"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337052-pATUbGfjwIvQofxPlXL2","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337052,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":".txt"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338169-ErCUUjfqLbSCRPRZH3Kk","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338169,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":".txt"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337052-pATUbGfjwIvQofxPlXL2","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337052,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"\","}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338169-ErCUUjfqLbSCRPRZH3Kk","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338169,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"\","}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337052-pATUbGfjwIvQofxPlXL2","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337052,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":" \""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338169-ErCUUjfqLbSCRPRZH3Kk","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338169,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":" \""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337052-pATUbGfjwIvQofxPlXL2","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337052,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"file"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338169-ErCUUjfqLbSCRPRZH3Kk","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338169,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"file"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337052-pATUbGfjwIvQofxPlXL2","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337052,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"_path"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338169-ErCUUjfqLbSCRPRZH3Kk","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338169,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"_path"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337052-pATUbGfjwIvQofxPlXL2","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337052,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338169-ErCUUjfqLbSCRPRZH3Kk","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338169,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337052-pATUbGfjwIvQofxPlXL2","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337052,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":" \""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338169-ErCUUjfqLbSCRPRZH3Kk","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338169,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":" \""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337052-pATUbGfjwIvQofxPlXL2","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337052,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"rob"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338169-ErCUUjfqLbSCRPRZH3Kk","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338169,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"rob"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337052-pATUbGfjwIvQofxPlXL2","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337052,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"ots"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338169-ErCUUjfqLbSCRPRZH3Kk","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338169,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"ots"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337052-pATUbGfjwIvQofxPlXL2","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337052,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":".txt"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338169-ErCUUjfqLbSCRPRZH3Kk","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338169,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":".txt"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337052-pATUbGfjwIvQofxPlXL2","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337052,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"\"}"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338169-ErCUUjfqLbSCRPRZH3Kk","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338169,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"\"}"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337052-pATUbGfjwIvQofxPlXL2","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337052,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"tool_calls","native_finish_reason":"tool_calls","logprobs":null}]} + data: {"id":"gen-1759338169-ErCUUjfqLbSCRPRZH3Kk","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338169,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"tool_calls","native_finish_reason":"tool_calls","logprobs":null}]} - data: {"id":"gen-1759337052-pATUbGfjwIvQofxPlXL2","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337052,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":7199,"completion_tokens":33,"total_tokens":7232,"cost":0.00295385,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0028796,"upstream_inference_completions_cost":0.00007425},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} + data: {"id":"gen-1759338169-ErCUUjfqLbSCRPRZH3Kk","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338169,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":7218,"completion_tokens":33,"total_tokens":7251,"cost":0.00296145,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0028872,"upstream_inference_completions_cost":0.00007425},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} data: [DONE] @@ -128,7 +128,7 @@ interactions: - text/event-stream status: 200 OK code: 200 - duration: 1.338463334s + duration: 1.108767458s - id: 2 request: proto: HTTP/1.1 @@ -154,15 +154,15 @@ interactions: - text/plain status: 200 OK code: 200 - duration: 650.848167ms + duration: 4.695190084s - id: 3 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 31104 + content_length: 31177 host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/download_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"download the file from https://httpbin.org/robots.txt and save it as robots.txt\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"TestCoderAgent/openrouter-kimi-k2/download_tool-1\",\"function\":{\"arguments\":\"{\\\"url\\\": \\\"https://httpbin.org/robots.txt\\\", \\\"file_path\\\": \\\"robots.txt\\\"}\",\"name\":\"download\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"Successfully downloaded 30 bytes to /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/download_tool/robots.txt (Content-Type: text/plain)\",\"tool_call_id\":\"TestCoderAgent/openrouter-kimi-k2/download_tool-1\",\"role\":\"tool\"}],\"model\":\"moonshotai/kimi-k2-0905\",\"max_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"usage\":{\"include\":true},\"stream\":true}" + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/download_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"download the file from https://httpbin.org/robots.txt and save it as robots.txt\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"TestCoderAgent/openrouter-kimi-k2/download_tool-1\",\"function\":{\"arguments\":\"{\\\"url\\\": \\\"https://httpbin.org/robots.txt\\\", \\\"file_path\\\": \\\"robots.txt\\\"}\",\"name\":\"download\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"Successfully downloaded 30 bytes to /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/download_tool/robots.txt (Content-Type: text/plain)\",\"tool_call_id\":\"TestCoderAgent/openrouter-kimi-k2/download_tool-1\",\"role\":\"tool\"}],\"model\":\"moonshotai/kimi-k2-0905\",\"max_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"usage\":{\"include\":true},\"stream\":true}" headers: Accept: - application/json @@ -178,65 +178,15 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"gen-1759337054-La0J0lJj9JX6HozZA0mV","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337054,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338176-KeV1VEL9wrAM86N7IQYM","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338176,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337054-La0J0lJj9JX6HozZA0mV","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337054,"choices":[{"index":0,"delta":{"role":"assistant","content":"Download"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338176-KeV1VEL9wrAM86N7IQYM","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338176,"choices":[{"index":0,"delta":{"role":"assistant","content":"Done"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337054-La0J0lJj9JX6HozZA0mV","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337054,"choices":[{"index":0,"delta":{"role":"assistant","content":"ed"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338176-KeV1VEL9wrAM86N7IQYM","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338176,"choices":[{"index":0,"delta":{"role":"assistant","content":"."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337054-La0J0lJj9JX6HozZA0mV","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337054,"choices":[{"index":0,"delta":{"role":"assistant","content":" successfully"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338176-KeV1VEL9wrAM86N7IQYM","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338176,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]} - data: {"id":"gen-1759337054-La0J0lJj9JX6HozZA0mV","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337054,"choices":[{"index":0,"delta":{"role":"assistant","content":"."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759337054-La0J0lJj9JX6HozZA0mV","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337054,"choices":[{"index":0,"delta":{"role":"assistant","content":" The"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759337054-La0J0lJj9JX6HozZA0mV","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337054,"choices":[{"index":0,"delta":{"role":"assistant","content":" file"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759337054-La0J0lJj9JX6HozZA0mV","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337054,"choices":[{"index":0,"delta":{"role":"assistant","content":" contains"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759337054-La0J0lJj9JX6HozZA0mV","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337054,"choices":[{"index":0,"delta":{"role":"assistant","content":" "},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759337054-La0J0lJj9JX6HozZA0mV","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337054,"choices":[{"index":0,"delta":{"role":"assistant","content":"30"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759337054-La0J0lJj9JX6HozZA0mV","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337054,"choices":[{"index":0,"delta":{"role":"assistant","content":" bytes"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759337054-La0J0lJj9JX6HozZA0mV","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337054,"choices":[{"index":0,"delta":{"role":"assistant","content":" of"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759337054-La0J0lJj9JX6HozZA0mV","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337054,"choices":[{"index":0,"delta":{"role":"assistant","content":" text"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759337054-La0J0lJj9JX6HozZA0mV","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337054,"choices":[{"index":0,"delta":{"role":"assistant","content":" and"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759337054-La0J0lJj9JX6HozZA0mV","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337054,"choices":[{"index":0,"delta":{"role":"assistant","content":" has"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759337054-La0J0lJj9JX6HozZA0mV","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337054,"choices":[{"index":0,"delta":{"role":"assistant","content":" been"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759337054-La0J0lJj9JX6HozZA0mV","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337054,"choices":[{"index":0,"delta":{"role":"assistant","content":" saved"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759337054-La0J0lJj9JX6HozZA0mV","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337054,"choices":[{"index":0,"delta":{"role":"assistant","content":" as"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759337054-La0J0lJj9JX6HozZA0mV","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337054,"choices":[{"index":0,"delta":{"role":"assistant","content":" `"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759337054-La0J0lJj9JX6HozZA0mV","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337054,"choices":[{"index":0,"delta":{"role":"assistant","content":"rob"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759337054-La0J0lJj9JX6HozZA0mV","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337054,"choices":[{"index":0,"delta":{"role":"assistant","content":"ots"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759337054-La0J0lJj9JX6HozZA0mV","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337054,"choices":[{"index":0,"delta":{"role":"assistant","content":".txt"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759337054-La0J0lJj9JX6HozZA0mV","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337054,"choices":[{"index":0,"delta":{"role":"assistant","content":"`"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759337054-La0J0lJj9JX6HozZA0mV","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337054,"choices":[{"index":0,"delta":{"role":"assistant","content":" in"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759337054-La0J0lJj9JX6HozZA0mV","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337054,"choices":[{"index":0,"delta":{"role":"assistant","content":" the"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759337054-La0J0lJj9JX6HozZA0mV","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337054,"choices":[{"index":0,"delta":{"role":"assistant","content":" current"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759337054-La0J0lJj9JX6HozZA0mV","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337054,"choices":[{"index":0,"delta":{"role":"assistant","content":" directory"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759337054-La0J0lJj9JX6HozZA0mV","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337054,"choices":[{"index":0,"delta":{"role":"assistant","content":"."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759337054-La0J0lJj9JX6HozZA0mV","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337054,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759337054-La0J0lJj9JX6HozZA0mV","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337054,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":7650,"completion_tokens":28,"total_tokens":7678,"cost":0.00466,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.00459,"upstream_inference_completions_cost":0.00007},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} + data: {"id":"gen-1759338176-KeV1VEL9wrAM86N7IQYM","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338176,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":7319,"completion_tokens":30,"total_tokens":7349,"cost":0.0044664,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0043914,"upstream_inference_completions_cost":0.000075},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} data: [DONE] @@ -245,4 +195,4 @@ interactions: - text/event-stream status: 200 OK code: 200 - duration: 2.563418375s + duration: 1.059036875s diff --git a/internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/fetch_tool.yaml b/internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/fetch_tool.yaml index 5902c1715a23fca5b11799ea7960bd95399fea60..0367c1b9efc3f74e9a5c7096d1c015962a2a69ef 100644 --- a/internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/fetch_tool.yaml +++ b/internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/fetch_tool.yaml @@ -2,75 +2,6 @@ version: 2 interactions: - id: 0 - request: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - content_length: 30646 - host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/fetch_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"fetch the content from https://httpbin.org/html and tell me if it contains the word 'Herman'\",\"role\":\"user\"}],\"model\":\"moonshotai/kimi-k2-0905\",\"max_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"usage\":{\"include\":true},\"stream\":true}" - headers: - Accept: - - application/json - Content-Type: - - application/json - User-Agent: - - OpenAI/Go 2.3.0 - url: https://openrouter.ai/api/v1/chat/completions - method: POST - response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - content_length: -1 - body: |+ - data: {"id":"gen-1759336964-T9LKdLVfXef2RGH8JwC5","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336964,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"functions.fetch:0","type":"function","function":{"name":"fetch","arguments":""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null} - - data: {"id":"gen-1759336964-T9LKdLVfXef2RGH8JwC5","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336964,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"functions.fetch:0","type":"function","function":{"name":"","arguments":"{\"url"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null} - - data: {"id":"gen-1759336964-T9LKdLVfXef2RGH8JwC5","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336964,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"functions.fetch:0","type":"function","function":{"name":"","arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null} - - data: {"id":"gen-1759336964-T9LKdLVfXef2RGH8JwC5","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336964,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"functions.fetch:0","type":"function","function":{"name":"","arguments":" \""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null} - - data: {"id":"gen-1759336964-T9LKdLVfXef2RGH8JwC5","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336964,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"functions.fetch:0","type":"function","function":{"name":"","arguments":"https"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null} - - data: {"id":"gen-1759336964-T9LKdLVfXef2RGH8JwC5","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336964,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"functions.fetch:0","type":"function","function":{"name":"","arguments":"://"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null} - - data: {"id":"gen-1759336964-T9LKdLVfXef2RGH8JwC5","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336964,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"functions.fetch:0","type":"function","function":{"name":"","arguments":"http"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null} - - data: {"id":"gen-1759336964-T9LKdLVfXef2RGH8JwC5","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336964,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"functions.fetch:0","type":"function","function":{"name":"","arguments":"bin"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null} - - data: {"id":"gen-1759336964-T9LKdLVfXef2RGH8JwC5","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336964,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"functions.fetch:0","type":"function","function":{"name":"","arguments":".org"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null} - - data: {"id":"gen-1759336964-T9LKdLVfXef2RGH8JwC5","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336964,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"functions.fetch:0","type":"function","function":{"name":"","arguments":"/html"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null} - - data: {"id":"gen-1759336964-T9LKdLVfXef2RGH8JwC5","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336964,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"functions.fetch:0","type":"function","function":{"name":"","arguments":"\","}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null} - - data: {"id":"gen-1759336964-T9LKdLVfXef2RGH8JwC5","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336964,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"functions.fetch:0","type":"function","function":{"name":"","arguments":" \""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null} - - data: {"id":"gen-1759336964-T9LKdLVfXef2RGH8JwC5","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336964,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"functions.fetch:0","type":"function","function":{"name":"","arguments":"format"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null} - - data: {"id":"gen-1759336964-T9LKdLVfXef2RGH8JwC5","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336964,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"functions.fetch:0","type":"function","function":{"name":"","arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null} - - data: {"id":"gen-1759336964-T9LKdLVfXef2RGH8JwC5","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336964,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"functions.fetch:0","type":"function","function":{"name":"","arguments":" \""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null} - - data: {"id":"gen-1759336964-T9LKdLVfXef2RGH8JwC5","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336964,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"functions.fetch:0","type":"function","function":{"name":"","arguments":"text"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null} - - data: {"id":"gen-1759336964-T9LKdLVfXef2RGH8JwC5","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336964,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"functions.fetch:0","type":"function","function":{"name":"","arguments":"\"}"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null} - - data: {"id":"gen-1759336964-T9LKdLVfXef2RGH8JwC5","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336964,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"tool_calls","native_finish_reason":"tool_calls","logprobs":null}],"system_fingerprint":null} - - data: {"id":"gen-1759336964-T9LKdLVfXef2RGH8JwC5","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336964,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":7303,"completion_tokens":27,"total_tokens":7330,"cost":0.0044493,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0043818,"upstream_inference_completions_cost":0.0000675},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} - - data: [DONE] - - headers: - Content-Type: - - text/event-stream - status: 200 OK - code: 200 - duration: 937.124958ms -- id: 1 request: proto: HTTP/1.1 proto_major: 1 @@ -93,21 +24,21 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"gen-1759336964-Y8OOD7coWXxnjoPRw2t3","provider":"Alibaba","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336964,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null} + data: {"id":"gen-1759338178-uuvKjRZnuSX9gTRQC5zo","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338178,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336964-Y8OOD7coWXxnjoPRw2t3","provider":"Alibaba","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336964,"choices":[{"index":0,"delta":{"role":"assistant","content":"Check"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null} + data: {"id":"gen-1759338178-uuvKjRZnuSX9gTRQC5zo","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338178,"choices":[{"index":0,"delta":{"role":"assistant","content":"Check"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336964-Y8OOD7coWXxnjoPRw2t3","provider":"Alibaba","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336964,"choices":[{"index":0,"delta":{"role":"assistant","content":" if https"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null} + data: {"id":"gen-1759338178-uuvKjRZnuSX9gTRQC5zo","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338178,"choices":[{"index":0,"delta":{"role":"assistant","content":" if https"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336964-Y8OOD7coWXxnjoPRw2t3","provider":"Alibaba","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336964,"choices":[{"index":0,"delta":{"role":"assistant","content":"://httpbin.org"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null} + data: {"id":"gen-1759338178-uuvKjRZnuSX9gTRQC5zo","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338178,"choices":[{"index":0,"delta":{"role":"assistant","content":"://httpbin.org"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336964-Y8OOD7coWXxnjoPRw2t3","provider":"Alibaba","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336964,"choices":[{"index":0,"delta":{"role":"assistant","content":"/html contains the word"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null} + data: {"id":"gen-1759338178-uuvKjRZnuSX9gTRQC5zo","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338178,"choices":[{"index":0,"delta":{"role":"assistant","content":"/html contains the word"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336964-Y8OOD7coWXxnjoPRw2t3","provider":"Alibaba","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336964,"choices":[{"index":0,"delta":{"role":"assistant","content":" Herman"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null} + data: {"id":"gen-1759338178-uuvKjRZnuSX9gTRQC5zo","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338178,"choices":[{"index":0,"delta":{"role":"assistant","content":" Herman"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336964-Y8OOD7coWXxnjoPRw2t3","provider":"Alibaba","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336964,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}],"system_fingerprint":null} + data: {"id":"gen-1759338178-uuvKjRZnuSX9gTRQC5zo","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338178,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]} - data: {"id":"gen-1759336964-Y8OOD7coWXxnjoPRw2t3","provider":"Alibaba","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336964,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":134,"completion_tokens":12,"total_tokens":146,"cost":0.000091,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.000067,"upstream_inference_completions_cost":0.000024},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} + data: {"id":"gen-1759338178-uuvKjRZnuSX9gTRQC5zo","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338178,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":134,"completion_tokens":13,"total_tokens":147,"cost":0.0000357,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0000201,"upstream_inference_completions_cost":0.0000156},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} data: [DONE] @@ -116,78 +47,15 @@ interactions: - text/event-stream status: 200 OK code: 200 - duration: 1.144155167s -- id: 2 - request: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - content_length: 0 - host: httpbin.org - headers: - User-Agent: - - crush/1.0 - url: https://httpbin.org/html - method: GET - response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - content_length: 162 - body: "\r\n503 Service Temporarily Unavailable\r\n\r\n

503 Service Temporarily Unavailable

\r\n\r\n\r\n" - headers: - Content-Type: - - text/html - status: 503 Service Unavailable - code: 503 - duration: 139.928292ms -- id: 3 - request: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - content_length: 30989 - host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/fetch_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"fetch the content from https://httpbin.org/html and tell me if it contains the word 'Herman'\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"TestCoderAgent/openrouter-kimi-k2/fetch_tool-1\",\"function\":{\"arguments\":\"{\\\"url\\\": \\\"https://httpbin.org/html\\\", \\\"format\\\": \\\"text\\\"}\",\"name\":\"fetch\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"Request failed with status code: 503\",\"tool_call_id\":\"TestCoderAgent/openrouter-kimi-k2/fetch_tool-1\",\"role\":\"tool\"}],\"model\":\"moonshotai/kimi-k2-0905\",\"max_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"usage\":{\"include\":true},\"stream\":true}" - headers: - Accept: - - application/json - Content-Type: - - application/json - User-Agent: - - OpenAI/Go 2.3.0 - url: https://openrouter.ai/api/v1/chat/completions - method: POST - response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - content_length: -1 - body: |+ - data: {"id":"gen-1759336965-cegznrf5ck0kJaa77VAH","provider":"DeepInfra","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336965,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - - data: {"id":"gen-1759336965-cegznrf5ck0kJaa77VAH","provider":"DeepInfra","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336965,"choices":[{"index":0,"delta":{"role":"assistant","content":"The fetch failed with a 503 error. Let me try with a different approach:"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - - data: {"id":"gen-1759336965-cegznrf5ck0kJaa77VAH","provider":"DeepInfra","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336965,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"TestCoderAgent/openrouter-kimi-k2/fetch_tool-2","function":{"arguments":"{\"format\": \"html\", \"url\": \"https://httpbin.org/html\"}","name":"TestCoderAgent/openrouter-kimi-k2/fetch_tool-2"},"type":"function"}]},"finish_reason":"tool_calls","native_finish_reason":"tool_calls","logprobs":null}]} - - data: {"id":"gen-1759336965-cegznrf5ck0kJaa77VAH","provider":"DeepInfra","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336965,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":7661,"completion_tokens":44,"total_tokens":7705,"cost":0.0039185,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0038305,"upstream_inference_completions_cost":0.000088},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} - - data: [DONE] - - headers: - Content-Type: - - text/event-stream - status: 200 OK - code: 200 - duration: 650.741833ms -- id: 4 + duration: 795.606292ms +- id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 31484 + content_length: 30719 host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/fetch_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"fetch the content from https://httpbin.org/html and tell me if it contains the word 'Herman'\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"TestCoderAgent/openrouter-kimi-k2/fetch_tool-1\",\"function\":{\"arguments\":\"{\\\"url\\\": \\\"https://httpbin.org/html\\\", \\\"format\\\": \\\"text\\\"}\",\"name\":\"fetch\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"Request failed with status code: 503\",\"tool_call_id\":\"TestCoderAgent/openrouter-kimi-k2/fetch_tool-1\",\"role\":\"tool\"},{\"content\":\"The fetch failed with a 503 error. Let me try with a different approach:\",\"tool_calls\":[{\"id\":\"TestCoderAgent/openrouter-kimi-k2/fetch_tool-2\",\"function\":{\"arguments\":\"{\\\"format\\\": \\\"html\\\", \\\"url\\\": \\\"https://httpbin.org/html\\\"}\",\"name\":\"TestCoderAgent/openrouter-kimi-k2/fetch_tool-2\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"tool not found: TestCoderAgent/openrouter-kimi-k2/fetch_tool-2\",\"tool_call_id\":\"TestCoderAgent/openrouter-kimi-k2/fetch_tool-2\",\"role\":\"tool\"}],\"model\":\"moonshotai/kimi-k2-0905\",\"max_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"usage\":{\"include\":true},\"stream\":true}" + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/fetch_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"fetch the content from https://httpbin.org/html and tell me if it contains the word 'Herman'\",\"role\":\"user\"}],\"model\":\"moonshotai/kimi-k2-0905\",\"max_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"usage\":{\"include\":true},\"stream\":true}" headers: Accept: - application/json @@ -203,81 +71,47 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"gen-1759336967-TippP6EcygsJRSfPz8Lg","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336967,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - - data: {"id":"gen-1759336967-TippP6EcygsJRSfPz8Lg","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336967,"choices":[{"index":0,"delta":{"role":"assistant","content":"Let me"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - - data: {"id":"gen-1759336967-TippP6EcygsJRSfPz8Lg","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336967,"choices":[{"index":0,"delta":{"role":"assistant","content":" try"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - - data: {"id":"gen-1759336967-TippP6EcygsJRSfPz8Lg","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336967,"choices":[{"index":0,"delta":{"role":"assistant","content":" the"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - - data: {"id":"gen-1759336967-TippP6EcygsJRSfPz8Lg","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336967,"choices":[{"index":0,"delta":{"role":"assistant","content":" fetch"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - - data: {"id":"gen-1759336967-TippP6EcygsJRSfPz8Lg","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336967,"choices":[{"index":0,"delta":{"role":"assistant","content":" tool"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - - data: {"id":"gen-1759336967-TippP6EcygsJRSfPz8Lg","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336967,"choices":[{"index":0,"delta":{"role":"assistant","content":" again"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - - data: {"id":"gen-1759336967-TippP6EcygsJRSfPz8Lg","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336967,"choices":[{"index":0,"delta":{"role":"assistant","content":" with"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338177-l0FpdoKOuHCJOnAUMvgo","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338177,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336967-TippP6EcygsJRSfPz8Lg","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336967,"choices":[{"index":0,"delta":{"role":"assistant","content":" a"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338177-l0FpdoKOuHCJOnAUMvgo","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338177,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"fetch:0","type":"function","function":{"name":"fetch"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336967-TippP6EcygsJRSfPz8Lg","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336967,"choices":[{"index":0,"delta":{"role":"assistant","content":" timeout"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338177-l0FpdoKOuHCJOnAUMvgo","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338177,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"{\""},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336967-TippP6EcygsJRSfPz8Lg","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336967,"choices":[{"index":0,"delta":{"role":"assistant","content":":"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338177-l0FpdoKOuHCJOnAUMvgo","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338177,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"url"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336967-TippP6EcygsJRSfPz8Lg","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336967,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"functions.fetch:3","type":"function","function":{"name":"fetch"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338177-l0FpdoKOuHCJOnAUMvgo","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338177,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"\":"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336967-TippP6EcygsJRSfPz8Lg","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336967,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"{\""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338177-l0FpdoKOuHCJOnAUMvgo","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338177,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":" \""},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336967-TippP6EcygsJRSfPz8Lg","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336967,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"format"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338177-l0FpdoKOuHCJOnAUMvgo","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338177,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"https"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336967-TippP6EcygsJRSfPz8Lg","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336967,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338177-l0FpdoKOuHCJOnAUMvgo","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338177,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"://"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336967-TippP6EcygsJRSfPz8Lg","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336967,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":" \""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338177-l0FpdoKOuHCJOnAUMvgo","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338177,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"http"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336967-TippP6EcygsJRSfPz8Lg","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336967,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"text"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338177-l0FpdoKOuHCJOnAUMvgo","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338177,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"bin"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336967-TippP6EcygsJRSfPz8Lg","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336967,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"\","}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338177-l0FpdoKOuHCJOnAUMvgo","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338177,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":".org"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336967-TippP6EcygsJRSfPz8Lg","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336967,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":" \""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338177-l0FpdoKOuHCJOnAUMvgo","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338177,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"/html"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336967-TippP6EcygsJRSfPz8Lg","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336967,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"timeout"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338177-l0FpdoKOuHCJOnAUMvgo","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338177,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"\","},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336967-TippP6EcygsJRSfPz8Lg","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336967,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338177-l0FpdoKOuHCJOnAUMvgo","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338177,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":" \""},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336967-TippP6EcygsJRSfPz8Lg","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336967,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":" "}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338177-l0FpdoKOuHCJOnAUMvgo","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338177,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"format"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336967-TippP6EcygsJRSfPz8Lg","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336967,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"30"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338177-l0FpdoKOuHCJOnAUMvgo","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338177,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"\":"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336967-TippP6EcygsJRSfPz8Lg","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336967,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":","}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338177-l0FpdoKOuHCJOnAUMvgo","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338177,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":" \""},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336967-TippP6EcygsJRSfPz8Lg","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336967,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":" \""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338177-l0FpdoKOuHCJOnAUMvgo","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338177,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"text"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336967-TippP6EcygsJRSfPz8Lg","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336967,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"url"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338177-l0FpdoKOuHCJOnAUMvgo","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338177,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"\"}"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336967-TippP6EcygsJRSfPz8Lg","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336967,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338177-l0FpdoKOuHCJOnAUMvgo","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338177,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"tool_calls","native_finish_reason":"tool_calls","logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336967-TippP6EcygsJRSfPz8Lg","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336967,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":" \""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - - data: {"id":"gen-1759336967-TippP6EcygsJRSfPz8Lg","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336967,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"https"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - - data: {"id":"gen-1759336967-TippP6EcygsJRSfPz8Lg","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336967,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"://"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - - data: {"id":"gen-1759336967-TippP6EcygsJRSfPz8Lg","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336967,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"http"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - - data: {"id":"gen-1759336967-TippP6EcygsJRSfPz8Lg","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336967,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"bin"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - - data: {"id":"gen-1759336967-TippP6EcygsJRSfPz8Lg","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336967,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":".org"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - - data: {"id":"gen-1759336967-TippP6EcygsJRSfPz8Lg","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336967,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"/html"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - - data: {"id":"gen-1759336967-TippP6EcygsJRSfPz8Lg","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336967,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"\"}"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - - data: {"id":"gen-1759336967-TippP6EcygsJRSfPz8Lg","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336967,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - - data: {"id":"gen-1759336967-TippP6EcygsJRSfPz8Lg","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336967,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"tool_calls","native_finish_reason":"tool_calls","logprobs":null}]} - - data: {"id":"gen-1759336967-TippP6EcygsJRSfPz8Lg","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336967,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":7467,"completion_tokens":44,"total_tokens":7511,"cost":0.0045902,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0044802,"upstream_inference_completions_cost":0.00011},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} + data: {"id":"gen-1759338177-l0FpdoKOuHCJOnAUMvgo","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338177,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":7587,"completion_tokens":26,"total_tokens":7613,"cost":0.0046172,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0045522,"upstream_inference_completions_cost":0.000065},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} data: [DONE] @@ -286,8 +120,8 @@ interactions: - text/event-stream status: 200 OK code: 200 - duration: 1.070324625s -- id: 5 + duration: 2.684300166s +- id: 2 request: proto: HTTP/1.1 proto_major: 1 @@ -303,22 +137,36 @@ interactions: proto: HTTP/2.0 proto_major: 2 proto_minor: 0 - content_length: 162 - body: "\r\n503 Service Temporarily Unavailable\r\n\r\n

503 Service Temporarily Unavailable

\r\n\r\n\r\n" + content_length: 3741 + body: |- + + + + + +

Herman Melville - Moby-Dick

+ +
+

+ Availing himself of the mild, summer-cool weather that now reigned in these latitudes, and in preparation for the peculiarly active pursuits shortly to be anticipated, Perth, the begrimed, blistered old blacksmith, had not removed his portable forge to the hold again, after concluding his contributory work for Ahab's leg, but still retained it on deck, fast lashed to ringbolts by the foremast; being now almost incessantly invoked by the headsmen, and harpooneers, and bowsmen to do some little job for them; altering, or repairing, or new shaping their various weapons and boat furniture. Often he would be surrounded by an eager circle, all waiting to be served; holding boat-spades, pike-heads, harpoons, and lances, and jealously watching his every sooty movement, as he toiled. Nevertheless, this old man's was a patient hammer wielded by a patient arm. No murmur, no impatience, no petulance did come from him. Silent, slow, and solemn; bowing over still further his chronically broken back, he toiled away, as if toil were life itself, and the heavy beating of his hammer the heavy beating of his heart. And so it was.—Most miserable! A peculiar walk in this old man, a certain slight but painful appearing yawing in his gait, had at an early period of the voyage excited the curiosity of the mariners. And to the importunity of their persisted questionings he had finally given in; and so it came to pass that every one now knew the shameful story of his wretched fate. Belated, and not innocently, one bitter winter's midnight, on the road running between two country towns, the blacksmith half-stupidly felt the deadly numbness stealing over him, and sought refuge in a leaning, dilapidated barn. The issue was, the loss of the extremities of both feet. Out of this revelation, part by part, at last came out the four acts of the gladness, and the one long, and as yet uncatastrophied fifth act of the grief of his life's drama. He was an old man, who, at the age of nearly sixty, had postponedly encountered that thing in sorrow's technicals called ruin. He had been an artisan of famed excellence, and with plenty to do; owned a house and garden; embraced a youthful, daughter-like, loving wife, and three blithe, ruddy children; every Sunday went to a cheerful-looking church, planted in a grove. But one night, under cover of darkness, and further concealed in a most cunning disguisement, a desperate burglar slid into his happy home, and robbed them all of everything. And darker yet to tell, the blacksmith himself did ignorantly conduct this burglar into his family's heart. It was the Bottle Conjuror! Upon the opening of that fatal cork, forth flew the fiend, and shrivelled up his home. Now, for prudent, most wise, and economic reasons, the blacksmith's shop was in the basement of his dwelling, but with a separate entrance to it; so that always had the young and loving healthy wife listened with no unhappy nervousness, but with vigorous pleasure, to the stout ringing of her young-armed old husband's hammer; whose reverberations, muffled by passing through the floors and walls, came up to her, not unsweetly, in her nursery; and so, to stout Labor's iron lullaby, the blacksmith's infants were rocked to slumber. Oh, woe on woe! Oh, Death, why canst thou not sometimes be timely? Hadst thou taken this old blacksmith to thyself ere his full ruin came upon him, then had the young widow had a delicious grief, and her orphans a truly venerable, legendary sire to dream of in their after years; and all of them a care-killing competency. +

+
+ + headers: Content-Type: - - text/html - status: 503 Service Unavailable - code: 503 - duration: 148.903708ms -- id: 6 + - text/html; charset=utf-8 + status: 200 OK + code: 200 + duration: 1.704807167s +- id: 3 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 31904 + content_length: 34622 host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/fetch_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"fetch the content from https://httpbin.org/html and tell me if it contains the word 'Herman'\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"TestCoderAgent/openrouter-kimi-k2/fetch_tool-1\",\"function\":{\"arguments\":\"{\\\"url\\\": \\\"https://httpbin.org/html\\\", \\\"format\\\": \\\"text\\\"}\",\"name\":\"fetch\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"Request failed with status code: 503\",\"tool_call_id\":\"TestCoderAgent/openrouter-kimi-k2/fetch_tool-1\",\"role\":\"tool\"},{\"content\":\"The fetch failed with a 503 error. Let me try with a different approach:\",\"tool_calls\":[{\"id\":\"TestCoderAgent/openrouter-kimi-k2/fetch_tool-2\",\"function\":{\"arguments\":\"{\\\"format\\\": \\\"html\\\", \\\"url\\\": \\\"https://httpbin.org/html\\\"}\",\"name\":\"TestCoderAgent/openrouter-kimi-k2/fetch_tool-2\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"tool not found: TestCoderAgent/openrouter-kimi-k2/fetch_tool-2\",\"tool_call_id\":\"TestCoderAgent/openrouter-kimi-k2/fetch_tool-2\",\"role\":\"tool\"},{\"content\":\"Let me try the fetch tool again with a timeout:\",\"tool_calls\":[{\"id\":\"TestCoderAgent/openrouter-kimi-k2/fetch_tool-3\",\"function\":{\"arguments\":\"{\\\"format\\\": \\\"text\\\", \\\"timeout\\\": 30, \\\"url\\\": \\\"https://httpbin.org/html\\\"}\",\"name\":\"fetch\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"Request failed with status code: 503\",\"tool_call_id\":\"TestCoderAgent/openrouter-kimi-k2/fetch_tool-3\",\"role\":\"tool\"}],\"model\":\"moonshotai/kimi-k2-0905\",\"max_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"usage\":{\"include\":true},\"stream\":true}" + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/fetch_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"fetch the content from https://httpbin.org/html and tell me if it contains the word 'Herman'\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"TestCoderAgent/openrouter-kimi-k2/fetch_tool-1\",\"function\":{\"arguments\":\"{\\\"url\\\": \\\"https://httpbin.org/html\\\", \\\"format\\\": \\\"text\\\"}\",\"name\":\"fetch\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"Herman Melville - Moby-Dick Availing himself of the mild, summer-cool weather that now reigned in these latitudes, and in preparation for the peculiarly active pursuits shortly to be anticipated, Perth, the begrimed, blistered old blacksmith, had not removed his portable forge to the hold again, after concluding his contributory work for Ahab's leg, but still retained it on deck, fast lashed to ringbolts by the foremast; being now almost incessantly invoked by the headsmen, and harpooneers, and bowsmen to do some little job for them; altering, or repairing, or new shaping their various weapons and boat furniture. Often he would be surrounded by an eager circle, all waiting to be served; holding boat-spades, pike-heads, harpoons, and lances, and jealously watching his every sooty movement, as he toiled. Nevertheless, this old man's was a patient hammer wielded by a patient arm. No murmur, no impatience, no petulance did come from him. Silent, slow, and solemn; bowing over still further his chronically broken back, he toiled away, as if toil were life itself, and the heavy beating of his hammer the heavy beating of his heart. And so it was.—Most miserable! A peculiar walk in this old man, a certain slight but painful appearing yawing in his gait, had at an early period of the voyage excited the curiosity of the mariners. And to the importunity of their persisted questionings he had finally given in; and so it came to pass that every one now knew the shameful story of his wretched fate. Belated, and not innocently, one bitter winter's midnight, on the road running between two country towns, the blacksmith half-stupidly felt the deadly numbness stealing over him, and sought refuge in a leaning, dilapidated barn. The issue was, the loss of the extremities of both feet. Out of this revelation, part by part, at last came out the four acts of the gladness, and the one long, and as yet uncatastrophied fifth act of the grief of his life's drama. He was an old man, who, at the age of nearly sixty, had postponedly encountered that thing in sorrow's technicals called ruin. He had been an artisan of famed excellence, and with plenty to do; owned a house and garden; embraced a youthful, daughter-like, loving wife, and three blithe, ruddy children; every Sunday went to a cheerful-looking church, planted in a grove. But one night, under cover of darkness, and further concealed in a most cunning disguisement, a desperate burglar slid into his happy home, and robbed them all of everything. And darker yet to tell, the blacksmith himself did ignorantly conduct this burglar into his family's heart. It was the Bottle Conjuror! Upon the opening of that fatal cork, forth flew the fiend, and shrivelled up his home. Now, for prudent, most wise, and economic reasons, the blacksmith's shop was in the basement of his dwelling, but with a separate entrance to it; so that always had the young and loving healthy wife listened with no unhappy nervousness, but with vigorous pleasure, to the stout ringing of her young-armed old husband's hammer; whose reverberations, muffled by passing through the floors and walls, came up to her, not unsweetly, in her nursery; and so, to stout Labor's iron lullaby, the blacksmith's infants were rocked to slumber. Oh, woe on woe! Oh, Death, why canst thou not sometimes be timely? Hadst thou taken this old blacksmith to thyself ere his full ruin came upon him, then had the young widow had a delicious grief, and her orphans a truly venerable, legendary sire to dream of in their after years; and all of them a care-killing competency.\",\"tool_call_id\":\"TestCoderAgent/openrouter-kimi-k2/fetch_tool-1\",\"role\":\"tool\"}],\"model\":\"moonshotai/kimi-k2-0905\",\"max_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"usage\":{\"include\":true},\"stream\":true}" headers: Accept: - application/json @@ -334,73 +182,33 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"gen-1759336968-vKfCsMbXdSYwNfMiOsOG","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336968,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759336968-vKfCsMbXdSYwNfMiOsOG","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336968,"choices":[{"index":0,"delta":{"role":"assistant","content":"The"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759336968-vKfCsMbXdSYwNfMiOsOG","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336968,"choices":[{"index":0,"delta":{"role":"assistant","content":" http"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759336968-vKfCsMbXdSYwNfMiOsOG","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336968,"choices":[{"index":0,"delta":{"role":"assistant","content":"bin"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759336968-vKfCsMbXdSYwNfMiOsOG","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336968,"choices":[{"index":0,"delta":{"role":"assistant","content":".org"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759336968-vKfCsMbXdSYwNfMiOsOG","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336968,"choices":[{"index":0,"delta":{"role":"assistant","content":" service"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759336968-vKfCsMbXdSYwNfMiOsOG","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336968,"choices":[{"index":0,"delta":{"role":"assistant","content":" appears"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759336968-vKfCsMbXdSYwNfMiOsOG","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336968,"choices":[{"index":0,"delta":{"role":"assistant","content":" to"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759336968-vKfCsMbXdSYwNfMiOsOG","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336968,"choices":[{"index":0,"delta":{"role":"assistant","content":" be"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759336968-vKfCsMbXdSYwNfMiOsOG","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336968,"choices":[{"index":0,"delta":{"role":"assistant","content":" unavailable"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759336968-vKfCsMbXdSYwNfMiOsOG","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336968,"choices":[{"index":0,"delta":{"role":"assistant","content":" ("},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759336968-vKfCsMbXdSYwNfMiOsOG","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336968,"choices":[{"index":0,"delta":{"role":"assistant","content":"503"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759336968-vKfCsMbXdSYwNfMiOsOG","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336968,"choices":[{"index":0,"delta":{"role":"assistant","content":" error"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759336968-vKfCsMbXdSYwNfMiOsOG","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336968,"choices":[{"index":0,"delta":{"role":"assistant","content":")."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759336968-vKfCsMbXdSYwNfMiOsOG","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336968,"choices":[{"index":0,"delta":{"role":"assistant","content":" I"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759336968-vKfCsMbXdSYwNfMiOsOG","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336968,"choices":[{"index":0,"delta":{"role":"assistant","content":" cannot"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759336968-vKfCsMbXdSYwNfMiOsOG","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336968,"choices":[{"index":0,"delta":{"role":"assistant","content":" check"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759336968-vKfCsMbXdSYwNfMiOsOG","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336968,"choices":[{"index":0,"delta":{"role":"assistant","content":" if"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759336968-vKfCsMbXdSYwNfMiOsOG","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336968,"choices":[{"index":0,"delta":{"role":"assistant","content":" the"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759336968-vKfCsMbXdSYwNfMiOsOG","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336968,"choices":[{"index":0,"delta":{"role":"assistant","content":" HTML"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759336968-vKfCsMbXdSYwNfMiOsOG","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336968,"choices":[{"index":0,"delta":{"role":"assistant","content":" contains"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338182-5s9mdg4Ji65EriGgoDqH","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338182,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336968-vKfCsMbXdSYwNfMiOsOG","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336968,"choices":[{"index":0,"delta":{"role":"assistant","content":" '"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338182-5s9mdg4Ji65EriGgoDqH","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338182,"choices":[{"index":0,"delta":{"role":"assistant","content":"Yes"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336968-vKfCsMbXdSYwNfMiOsOG","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336968,"choices":[{"index":0,"delta":{"role":"assistant","content":"H"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338182-5s9mdg4Ji65EriGgoDqH","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338182,"choices":[{"index":0,"delta":{"role":"assistant","content":","},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336968-vKfCsMbXdSYwNfMiOsOG","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336968,"choices":[{"index":0,"delta":{"role":"assistant","content":"erman"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338182-5s9mdg4Ji65EriGgoDqH","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338182,"choices":[{"index":0,"delta":{"role":"assistant","content":" the"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336968-vKfCsMbXdSYwNfMiOsOG","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336968,"choices":[{"index":0,"delta":{"role":"assistant","content":"'"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338182-5s9mdg4Ji65EriGgoDqH","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338182,"choices":[{"index":0,"delta":{"role":"assistant","content":" content"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336968-vKfCsMbXdSYwNfMiOsOG","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336968,"choices":[{"index":0,"delta":{"role":"assistant","content":" since"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338182-5s9mdg4Ji65EriGgoDqH","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338182,"choices":[{"index":0,"delta":{"role":"assistant","content":" contains"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336968-vKfCsMbXdSYwNfMiOsOG","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336968,"choices":[{"index":0,"delta":{"role":"assistant","content":" I"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338182-5s9mdg4Ji65EriGgoDqH","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338182,"choices":[{"index":0,"delta":{"role":"assistant","content":" the"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336968-vKfCsMbXdSYwNfMiOsOG","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336968,"choices":[{"index":0,"delta":{"role":"assistant","content":" cannot"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338182-5s9mdg4Ji65EriGgoDqH","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338182,"choices":[{"index":0,"delta":{"role":"assistant","content":" word"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336968-vKfCsMbXdSYwNfMiOsOG","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336968,"choices":[{"index":0,"delta":{"role":"assistant","content":" access"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338182-5s9mdg4Ji65EriGgoDqH","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338182,"choices":[{"index":0,"delta":{"role":"assistant","content":" '"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336968-vKfCsMbXdSYwNfMiOsOG","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336968,"choices":[{"index":0,"delta":{"role":"assistant","content":" the"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338182-5s9mdg4Ji65EriGgoDqH","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338182,"choices":[{"index":0,"delta":{"role":"assistant","content":"H"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336968-vKfCsMbXdSYwNfMiOsOG","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336968,"choices":[{"index":0,"delta":{"role":"assistant","content":" content"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338182-5s9mdg4Ji65EriGgoDqH","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338182,"choices":[{"index":0,"delta":{"role":"assistant","content":"erman"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336968-vKfCsMbXdSYwNfMiOsOG","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336968,"choices":[{"index":0,"delta":{"role":"assistant","content":"."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338182-5s9mdg4Ji65EriGgoDqH","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338182,"choices":[{"index":0,"delta":{"role":"assistant","content":"'."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336968-vKfCsMbXdSYwNfMiOsOG","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336968,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338182-5s9mdg4Ji65EriGgoDqH","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338182,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]} - data: {"id":"gen-1759336968-vKfCsMbXdSYwNfMiOsOG","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336968,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":7793,"completion_tokens":32,"total_tokens":7825,"cost":0.0047558,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0046758,"upstream_inference_completions_cost":0.00008},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} + data: {"id":"gen-1759338182-5s9mdg4Ji65EriGgoDqH","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338182,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":8122,"completion_tokens":12,"total_tokens":8134,"cost":0.0049032,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0048732,"upstream_inference_completions_cost":0.00003},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} data: [DONE] @@ -409,4 +217,4 @@ interactions: - text/event-stream status: 200 OK code: 200 - duration: 1.657449667s + duration: 1.106382959s diff --git a/internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/glob_tool.yaml b/internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/glob_tool.yaml index f6fff5028db13d890e7af702923201dc55d61be4..1c7d98aeeb3493c6192213f8e150d6d0632804f7 100644 --- a/internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/glob_tool.yaml +++ b/internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/glob_tool.yaml @@ -6,9 +6,9 @@ interactions: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 711 + content_length: 30681 host: "" - body: '{"messages":[{"content":"you will generate a short title based on the first message a user begins a conversation with\n\n- ensure it is not more than 50 characters long\n- the title should be a summary of the user''s message\n- it should be one line long\n- do not use quotes or colons\n- the entire text you return will be used as the title\n- never return anything that is more than one sentence (one line) long\n","role":"system"},{"content":"Generate a concise title for the following content:\n\nuse glob to find all .go files in the current directory","role":"user"}],"model":"qwen/qwen3-next-80b-a3b-instruct","max_tokens":40,"stream_options":{"include_usage":true},"usage":{"include":true},"stream":true}' + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/glob_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use glob to find all .go files in the current directory\",\"role\":\"user\"}],\"model\":\"moonshotai/kimi-k2-0905\",\"max_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"usage\":{\"include\":true},\"stream\":true}" headers: Accept: - application/json @@ -24,31 +24,23 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"gen-1759336971-4jaE8CTxLYnCWmernEYH","provider":"AtlasCloud","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336971,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - - data: {"id":"gen-1759336971-4jaE8CTxLYnCWmernEYH","provider":"AtlasCloud","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336971,"choices":[{"index":0,"delta":{"role":"assistant","content":"Find"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - - data: {"id":"gen-1759336971-4jaE8CTxLYnCWmernEYH","provider":"AtlasCloud","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336971,"choices":[{"index":0,"delta":{"role":"assistant","content":" all"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338184-duiN8Bh09trINpQs0pBP","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338184,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336971-4jaE8CTxLYnCWmernEYH","provider":"AtlasCloud","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336971,"choices":[{"index":0,"delta":{"role":"assistant","content":" ."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338184-duiN8Bh09trINpQs0pBP","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338184,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":"functions.glob:0","index":0,"type":"function","function":{"name":"glob","arguments":""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336971-4jaE8CTxLYnCWmernEYH","provider":"AtlasCloud","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336971,"choices":[{"index":0,"delta":{"role":"assistant","content":"go"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338184-duiN8Bh09trINpQs0pBP","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338184,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"{\"pattern"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336971-4jaE8CTxLYnCWmernEYH","provider":"AtlasCloud","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336971,"choices":[{"index":0,"delta":{"role":"assistant","content":" files"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338184-duiN8Bh09trINpQs0pBP","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338184,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336971-4jaE8CTxLYnCWmernEYH","provider":"AtlasCloud","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336971,"choices":[{"index":0,"delta":{"role":"assistant","content":" in"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338184-duiN8Bh09trINpQs0pBP","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338184,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":" \"*."}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336971-4jaE8CTxLYnCWmernEYH","provider":"AtlasCloud","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336971,"choices":[{"index":0,"delta":{"role":"assistant","content":" current"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338184-duiN8Bh09trINpQs0pBP","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338184,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"go"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336971-4jaE8CTxLYnCWmernEYH","provider":"AtlasCloud","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336971,"choices":[{"index":0,"delta":{"role":"assistant","content":" directory"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338184-duiN8Bh09trINpQs0pBP","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338184,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"\"}"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336971-4jaE8CTxLYnCWmernEYH","provider":"AtlasCloud","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336971,"choices":[{"index":0,"delta":{"role":"assistant","content":" using"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338184-duiN8Bh09trINpQs0pBP","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338184,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"tool_calls","native_finish_reason":"tool_calls","logprobs":null}]} - data: {"id":"gen-1759336971-4jaE8CTxLYnCWmernEYH","provider":"AtlasCloud","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336971,"choices":[{"index":0,"delta":{"role":"assistant","content":" glob"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - - data: {"id":"gen-1759336971-4jaE8CTxLYnCWmernEYH","provider":"AtlasCloud","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336971,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]} - - data: {"id":"gen-1759336971-4jaE8CTxLYnCWmernEYH","provider":"AtlasCloud","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336971,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":124,"completion_tokens":11,"total_tokens":135,"cost":0.0000351,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0000186,"upstream_inference_completions_cost":0.0000165},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} + data: {"id":"gen-1759338184-duiN8Bh09trINpQs0pBP","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338184,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":7212,"completion_tokens":16,"total_tokens":7228,"cost":0.0043672,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0043272,"upstream_inference_completions_cost":0.00004},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} data: [DONE] @@ -57,15 +49,15 @@ interactions: - text/event-stream status: 200 OK code: 200 - duration: 781.990416ms + duration: 845.556625ms - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 30608 + content_length: 711 host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/glob_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use glob to find all .go files in the current directory\",\"role\":\"user\"}],\"model\":\"moonshotai/kimi-k2-0905\",\"max_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"usage\":{\"include\":true},\"stream\":true}" + body: '{"messages":[{"content":"you will generate a short title based on the first message a user begins a conversation with\n\n- ensure it is not more than 50 characters long\n- the title should be a summary of the user''s message\n- it should be one line long\n- do not use quotes or colons\n- the entire text you return will be used as the title\n- never return anything that is more than one sentence (one line) long\n","role":"system"},{"content":"Generate a concise title for the following content:\n\nuse glob to find all .go files in the current directory","role":"user"}],"model":"qwen/qwen3-next-80b-a3b-instruct","max_tokens":40,"stream_options":{"include_usage":true},"usage":{"include":true},"stream":true}' headers: Accept: - application/json @@ -81,25 +73,31 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"gen-1759336971-0Rd0yLMl395CsA58RBNE","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336971,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338184-OAeOudMvRhi95BzbBk02","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338184,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336971-0Rd0yLMl395CsA58RBNE","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336971,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"glob:0","type":"function","function":{"name":"glob","arguments":""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338184-OAeOudMvRhi95BzbBk02","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338184,"choices":[{"index":0,"delta":{"role":"assistant","content":"Find"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336971-0Rd0yLMl395CsA58RBNE","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336971,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"{\""},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338184-OAeOudMvRhi95BzbBk02","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338184,"choices":[{"index":0,"delta":{"role":"assistant","content":" all"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336971-0Rd0yLMl395CsA58RBNE","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336971,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"pattern"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338184-OAeOudMvRhi95BzbBk02","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338184,"choices":[{"index":0,"delta":{"role":"assistant","content":" ."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336971-0Rd0yLMl395CsA58RBNE","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336971,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"\":"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338184-OAeOudMvRhi95BzbBk02","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338184,"choices":[{"index":0,"delta":{"role":"assistant","content":"go"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336971-0Rd0yLMl395CsA58RBNE","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336971,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":" \"*."},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338184-OAeOudMvRhi95BzbBk02","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338184,"choices":[{"index":0,"delta":{"role":"assistant","content":" files"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336971-0Rd0yLMl395CsA58RBNE","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336971,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"go"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338184-OAeOudMvRhi95BzbBk02","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338184,"choices":[{"index":0,"delta":{"role":"assistant","content":" in"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336971-0Rd0yLMl395CsA58RBNE","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336971,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"\"}"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338184-OAeOudMvRhi95BzbBk02","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338184,"choices":[{"index":0,"delta":{"role":"assistant","content":" current"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336971-0Rd0yLMl395CsA58RBNE","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336971,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"tool_calls","native_finish_reason":"tool_calls","logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338184-OAeOudMvRhi95BzbBk02","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338184,"choices":[{"index":0,"delta":{"role":"assistant","content":" directory"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336971-0Rd0yLMl395CsA58RBNE","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336971,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":7563,"completion_tokens":15,"total_tokens":7578,"cost":0.0045753,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0045378,"upstream_inference_completions_cost":0.0000375},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} + data: {"id":"gen-1759338184-OAeOudMvRhi95BzbBk02","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338184,"choices":[{"index":0,"delta":{"role":"assistant","content":" using"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759338184-OAeOudMvRhi95BzbBk02","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338184,"choices":[{"index":0,"delta":{"role":"assistant","content":" glob"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759338184-OAeOudMvRhi95BzbBk02","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338184,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]} + + data: {"id":"gen-1759338184-OAeOudMvRhi95BzbBk02","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338184,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":124,"completion_tokens":11,"total_tokens":135,"cost":0.00002946,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.00001736,"upstream_inference_completions_cost":0.0000121},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} data: [DONE] @@ -108,15 +106,15 @@ interactions: - text/event-stream status: 200 OK code: 200 - duration: 2.334389417s + duration: 1.072229s - id: 2 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 30941 + content_length: 31014 host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/glob_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use glob to find all .go files in the current directory\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"TestCoderAgent/openrouter-kimi-k2/glob_tool-1\",\"function\":{\"arguments\":\"{\\\"pattern\\\": \\\"*.go\\\"}\",\"name\":\"glob\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"/tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/glob_tool/main.go\",\"tool_call_id\":\"TestCoderAgent/openrouter-kimi-k2/glob_tool-1\",\"role\":\"tool\"}],\"model\":\"moonshotai/kimi-k2-0905\",\"max_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"usage\":{\"include\":true},\"stream\":true}" + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/glob_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use glob to find all .go files in the current directory\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"TestCoderAgent/openrouter-kimi-k2/glob_tool-1\",\"function\":{\"arguments\":\"{\\\"pattern\\\": \\\"*.go\\\"}\",\"name\":\"glob\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"/tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/glob_tool/main.go\",\"tool_call_id\":\"TestCoderAgent/openrouter-kimi-k2/glob_tool-1\",\"role\":\"tool\"}],\"model\":\"moonshotai/kimi-k2-0905\",\"max_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"usage\":{\"include\":true},\"stream\":true}" headers: Accept: - application/json @@ -132,29 +130,65 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"gen-1759336973-hpNZIcZ5soweZJTBXJdZ","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336973,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338185-qyjztmseDoESTbu7aHWc","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338185,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759338185-qyjztmseDoESTbu7aHWc","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338185,"choices":[{"index":0,"delta":{"role":"assistant","content":"Found"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759338185-qyjztmseDoESTbu7aHWc","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338185,"choices":[{"index":0,"delta":{"role":"assistant","content":" "},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759338185-qyjztmseDoESTbu7aHWc","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338185,"choices":[{"index":0,"delta":{"role":"assistant","content":"1"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759338185-qyjztmseDoESTbu7aHWc","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338185,"choices":[{"index":0,"delta":{"role":"assistant","content":" ."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759338185-qyjztmseDoESTbu7aHWc","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338185,"choices":[{"index":0,"delta":{"role":"assistant","content":"go"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759338185-qyjztmseDoESTbu7aHWc","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338185,"choices":[{"index":0,"delta":{"role":"assistant","content":" file"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759338185-qyjztmseDoESTbu7aHWc","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338185,"choices":[{"index":0,"delta":{"role":"assistant","content":":"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759338185-qyjztmseDoESTbu7aHWc","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338185,"choices":[{"index":0,"delta":{"role":"assistant","content":" `/"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759338185-qyjztmseDoESTbu7aHWc","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338185,"choices":[{"index":0,"delta":{"role":"assistant","content":"tmp"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759338185-qyjztmseDoESTbu7aHWc","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338185,"choices":[{"index":0,"delta":{"role":"assistant","content":"/c"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759338185-qyjztmseDoESTbu7aHWc","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338185,"choices":[{"index":0,"delta":{"role":"assistant","content":"rush"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759338185-qyjztmseDoESTbu7aHWc","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338185,"choices":[{"index":0,"delta":{"role":"assistant","content":"-test"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759338185-qyjztmseDoESTbu7aHWc","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338185,"choices":[{"index":0,"delta":{"role":"assistant","content":"/Test"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759338185-qyjztmseDoESTbu7aHWc","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338185,"choices":[{"index":0,"delta":{"role":"assistant","content":"Coder"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759338185-qyjztmseDoESTbu7aHWc","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338185,"choices":[{"index":0,"delta":{"role":"assistant","content":"Agent"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759338185-qyjztmseDoESTbu7aHWc","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338185,"choices":[{"index":0,"delta":{"role":"assistant","content":"/open"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759338185-qyjztmseDoESTbu7aHWc","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338185,"choices":[{"index":0,"delta":{"role":"assistant","content":"router"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759338185-qyjztmseDoESTbu7aHWc","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338185,"choices":[{"index":0,"delta":{"role":"assistant","content":"-k"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336973-hpNZIcZ5soweZJTBXJdZ","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336973,"choices":[{"index":0,"delta":{"role":"assistant","content":"Found "},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338185-qyjztmseDoESTbu7aHWc","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338185,"choices":[{"index":0,"delta":{"role":"assistant","content":"imi"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336973-hpNZIcZ5soweZJTBXJdZ","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336973,"choices":[{"index":0,"delta":{"role":"assistant","content":"1"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338185-qyjztmseDoESTbu7aHWc","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338185,"choices":[{"index":0,"delta":{"role":"assistant","content":"-k"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336973-hpNZIcZ5soweZJTBXJdZ","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336973,"choices":[{"index":0,"delta":{"role":"assistant","content":" Go"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338185-qyjztmseDoESTbu7aHWc","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338185,"choices":[{"index":0,"delta":{"role":"assistant","content":"2"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336973-hpNZIcZ5soweZJTBXJdZ","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336973,"choices":[{"index":0,"delta":{"role":"assistant","content":" file"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338185-qyjztmseDoESTbu7aHWc","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338185,"choices":[{"index":0,"delta":{"role":"assistant","content":"/g"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336973-hpNZIcZ5soweZJTBXJdZ","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336973,"choices":[{"index":0,"delta":{"role":"assistant","content":":"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338185-qyjztmseDoESTbu7aHWc","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338185,"choices":[{"index":0,"delta":{"role":"assistant","content":"lob"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336973-hpNZIcZ5soweZJTBXJdZ","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336973,"choices":[{"index":0,"delta":{"role":"assistant","content":" `"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338185-qyjztmseDoESTbu7aHWc","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338185,"choices":[{"index":0,"delta":{"role":"assistant","content":"_tool"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336973-hpNZIcZ5soweZJTBXJdZ","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336973,"choices":[{"index":0,"delta":{"role":"assistant","content":"main"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338185-qyjztmseDoESTbu7aHWc","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338185,"choices":[{"index":0,"delta":{"role":"assistant","content":"/main"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336973-hpNZIcZ5soweZJTBXJdZ","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336973,"choices":[{"index":0,"delta":{"role":"assistant","content":".go"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338185-qyjztmseDoESTbu7aHWc","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338185,"choices":[{"index":0,"delta":{"role":"assistant","content":".go"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336973-hpNZIcZ5soweZJTBXJdZ","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336973,"choices":[{"index":0,"delta":{"role":"assistant","content":"`"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338185-qyjztmseDoESTbu7aHWc","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338185,"choices":[{"index":0,"delta":{"role":"assistant","content":"`"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336973-hpNZIcZ5soweZJTBXJdZ","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336973,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]} + data: {"id":"gen-1759338185-qyjztmseDoESTbu7aHWc","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338185,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336973-hpNZIcZ5soweZJTBXJdZ","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336973,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":7355,"completion_tokens":11,"total_tokens":7366,"cost":0.0044405,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.004413,"upstream_inference_completions_cost":0.0000275},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} + data: {"id":"gen-1759338185-qyjztmseDoESTbu7aHWc","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338185,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":7626,"completion_tokens":28,"total_tokens":7654,"cost":0.0046456,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0045756,"upstream_inference_completions_cost":0.00007},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} data: [DONE] @@ -163,4 +197,4 @@ interactions: - text/event-stream status: 200 OK code: 200 - duration: 1.082968291s + duration: 3.619692875s diff --git a/internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/grep_tool.yaml b/internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/grep_tool.yaml index 60a974b6d43d1092b5467262d23b3ddf1d226477..7825d23318eb5f304d8d67852f8ff182c06faea2 100644 --- a/internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/grep_tool.yaml +++ b/internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/grep_tool.yaml @@ -23,35 +23,21 @@ interactions: proto_major: 2 proto_minor: 0 content_length: -1 - body: |+ - data: {"id":"gen-1759336975-Z1ry5ng9wvlZ2HlctBgU","provider":"GMICloud","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336975,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - - data: {"id":"gen-1759336975-Z1ry5ng9wvlZ2HlctBgU","provider":"GMICloud","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336975,"choices":[{"index":0,"delta":{"role":"assistant","content":"Search"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - - data: {"id":"gen-1759336975-Z1ry5ng9wvlZ2HlctBgU","provider":"GMICloud","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336975,"choices":[{"index":0,"delta":{"role":"assistant","content":" for package in go"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - - data: {"id":"gen-1759336975-Z1ry5ng9wvlZ2HlctBgU","provider":"GMICloud","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336975,"choices":[{"index":0,"delta":{"role":"assistant","content":" files using grep"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - - data: {"id":"gen-1759336975-Z1ry5ng9wvlZ2HlctBgU","provider":"GMICloud","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336975,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]} - - data: {"id":"gen-1759336975-Z1ry5ng9wvlZ2HlctBgU","provider":"GMICloud","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336975,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":125,"completion_tokens":9,"total_tokens":134,"cost":0.00003225,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.00001875,"upstream_inference_completions_cost":0.0000135},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} - - data: [DONE] - + body: '{"error":{"message":"Provider returned error","code":429,"metadata":{"raw":"qwen/qwen3-next-80b-a3b-instruct is temporarily rate-limited upstream. Please retry shortly, or add your own key to accumulate your rate limits: https://openrouter.ai/settings/integrations","provider_name":"GMICloud"}},"user_id":"user_2zMGmKqlf4zmAvL9snVImB1Z1ZQ"}' headers: Content-Type: - - text/event-stream - status: 200 OK - code: 200 - duration: 1.244244584s + - application/json + status: 429 Too Many Requests + code: 429 + duration: 880.966417ms - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 30606 + content_length: 30679 host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/grep_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use grep to search for the word 'package' in go files\",\"role\":\"user\"}],\"model\":\"moonshotai/kimi-k2-0905\",\"max_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"usage\":{\"include\":true},\"stream\":true}" + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/grep_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use grep to search for the word 'package' in go files\",\"role\":\"user\"}],\"model\":\"moonshotai/kimi-k2-0905\",\"max_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"usage\":{\"include\":true},\"stream\":true}" headers: Accept: - application/json @@ -67,47 +53,47 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"gen-1759336975-ddQQusfcf6I4iTTNUB5Z","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336975,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338189-nR4wkUSuMGKnRxR9IbXL","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338189,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336975-ddQQusfcf6I4iTTNUB5Z","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336975,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":"functions.grep:0","index":0,"type":"function","function":{"name":"grep","arguments":""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338189-nR4wkUSuMGKnRxR9IbXL","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338189,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":"functions.grep:0","index":0,"type":"function","function":{"name":"grep","arguments":""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336975-ddQQusfcf6I4iTTNUB5Z","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336975,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"{\"pattern"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338189-nR4wkUSuMGKnRxR9IbXL","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338189,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"{\"pattern"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336975-ddQQusfcf6I4iTTNUB5Z","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336975,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338189-nR4wkUSuMGKnRxR9IbXL","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338189,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336975-ddQQusfcf6I4iTTNUB5Z","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336975,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":" \""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338189-nR4wkUSuMGKnRxR9IbXL","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338189,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":" \""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336975-ddQQusfcf6I4iTTNUB5Z","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336975,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"package"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338189-nR4wkUSuMGKnRxR9IbXL","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338189,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"package"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336975-ddQQusfcf6I4iTTNUB5Z","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336975,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"\","}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338189-nR4wkUSuMGKnRxR9IbXL","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338189,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"\","}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336975-ddQQusfcf6I4iTTNUB5Z","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336975,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":" \""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338189-nR4wkUSuMGKnRxR9IbXL","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338189,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":" \""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336975-ddQQusfcf6I4iTTNUB5Z","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336975,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"include"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338189-nR4wkUSuMGKnRxR9IbXL","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338189,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"include"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336975-ddQQusfcf6I4iTTNUB5Z","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336975,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338189-nR4wkUSuMGKnRxR9IbXL","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338189,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336975-ddQQusfcf6I4iTTNUB5Z","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336975,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":" \"*."}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338189-nR4wkUSuMGKnRxR9IbXL","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338189,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":" \"*."}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336975-ddQQusfcf6I4iTTNUB5Z","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336975,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"go"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338189-nR4wkUSuMGKnRxR9IbXL","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338189,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"go"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336975-ddQQusfcf6I4iTTNUB5Z","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336975,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"\","}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338189-nR4wkUSuMGKnRxR9IbXL","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338189,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"\","}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336975-ddQQusfcf6I4iTTNUB5Z","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336975,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":" \""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338189-nR4wkUSuMGKnRxR9IbXL","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338189,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":" \""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336975-ddQQusfcf6I4iTTNUB5Z","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336975,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"literal"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338189-nR4wkUSuMGKnRxR9IbXL","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338189,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"literal"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336975-ddQQusfcf6I4iTTNUB5Z","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336975,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"_text"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338189-nR4wkUSuMGKnRxR9IbXL","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338189,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"_text"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336975-ddQQusfcf6I4iTTNUB5Z","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336975,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338189-nR4wkUSuMGKnRxR9IbXL","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338189,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336975-ddQQusfcf6I4iTTNUB5Z","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336975,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":" true"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338189-nR4wkUSuMGKnRxR9IbXL","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338189,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":" true"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336975-ddQQusfcf6I4iTTNUB5Z","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336975,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"}"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338189-nR4wkUSuMGKnRxR9IbXL","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338189,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"}"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336975-ddQQusfcf6I4iTTNUB5Z","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336975,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"tool_calls","native_finish_reason":"tool_calls","logprobs":null}]} + data: {"id":"gen-1759338189-nR4wkUSuMGKnRxR9IbXL","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338189,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"tool_calls","native_finish_reason":"tool_calls","logprobs":null}]} - data: {"id":"gen-1759336975-ddQQusfcf6I4iTTNUB5Z","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336975,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":7194,"completion_tokens":29,"total_tokens":7223,"cost":0.00294285,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0028776,"upstream_inference_completions_cost":0.00006525},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} + data: {"id":"gen-1759338189-nR4wkUSuMGKnRxR9IbXL","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338189,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":7213,"completion_tokens":29,"total_tokens":7242,"cost":0.00295045,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0028852,"upstream_inference_completions_cost":0.00006525},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} data: [DONE] @@ -116,15 +102,15 @@ interactions: - text/event-stream status: 200 OK code: 200 - duration: 2.023496584s + duration: 1.996595334s - id: 2 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 31033 + content_length: 31106 host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/grep_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use grep to search for the word 'package' in go files\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"TestCoderAgent/openrouter-kimi-k2/grep_tool-1\",\"function\":{\"arguments\":\"{\\\"pattern\\\": \\\"package\\\", \\\"include\\\": \\\"*.go\\\", \\\"literal_text\\\": true}\",\"name\":\"grep\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"Found 1 matches\\n/tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/grep_tool/main.go:\\n Line 1: package main\\n\",\"tool_call_id\":\"TestCoderAgent/openrouter-kimi-k2/grep_tool-1\",\"role\":\"tool\"}],\"model\":\"moonshotai/kimi-k2-0905\",\"max_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"usage\":{\"include\":true},\"stream\":true}" + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/grep_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use grep to search for the word 'package' in go files\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"TestCoderAgent/openrouter-kimi-k2/grep_tool-1\",\"function\":{\"arguments\":\"{\\\"pattern\\\": \\\"package\\\", \\\"include\\\": \\\"*.go\\\", \\\"literal_text\\\": true}\",\"name\":\"grep\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"Found 1 matches\\n/tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/grep_tool/main.go:\\n Line 1: package main\\n\",\"tool_call_id\":\"TestCoderAgent/openrouter-kimi-k2/grep_tool-1\",\"role\":\"tool\"}],\"model\":\"moonshotai/kimi-k2-0905\",\"max_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"usage\":{\"include\":true},\"stream\":true}" headers: Accept: - application/json @@ -140,47 +126,64 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"gen-1759336977-UnNP0zjdgoyGYvPLpsG2","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336977,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759336977-UnNP0zjdgoyGYvPLpsG2","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336977,"choices":[{"index":0,"delta":{"role":"assistant","content":"Found"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759336977-UnNP0zjdgoyGYvPLpsG2","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336977,"choices":[{"index":0,"delta":{"role":"assistant","content":" "},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759336977-UnNP0zjdgoyGYvPLpsG2","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336977,"choices":[{"index":0,"delta":{"role":"assistant","content":"1"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759336977-UnNP0zjdgoyGYvPLpsG2","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336977,"choices":[{"index":0,"delta":{"role":"assistant","content":" match"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759336977-UnNP0zjdgoyGYvPLpsG2","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336977,"choices":[{"index":0,"delta":{"role":"assistant","content":" in"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338191-bjVVfcyvkYNjaYamDZp4","provider":"DeepInfra","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338191,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336977-UnNP0zjdgoyGYvPLpsG2","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336977,"choices":[{"index":0,"delta":{"role":"assistant","content":" `"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338191-bjVVfcyvkYNjaYamDZp4","provider":"DeepInfra","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338191,"choices":[{"index":0,"delta":{"role":"assistant","content":"Found 1 match: `package main` in `/tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/grep_tool/main.go`"},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]} - data: {"id":"gen-1759336977-UnNP0zjdgoyGYvPLpsG2","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336977,"choices":[{"index":0,"delta":{"role":"assistant","content":"main"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338191-bjVVfcyvkYNjaYamDZp4","provider":"DeepInfra","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338191,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":7391,"completion_tokens":30,"total_tokens":7421,"cost":0.0037555,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0036955,"upstream_inference_completions_cost":0.00006},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} - data: {"id":"gen-1759336977-UnNP0zjdgoyGYvPLpsG2","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336977,"choices":[{"index":0,"delta":{"role":"assistant","content":".go"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759336977-UnNP0zjdgoyGYvPLpsG2","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336977,"choices":[{"index":0,"delta":{"role":"assistant","content":"`"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: [DONE] - data: {"id":"gen-1759336977-UnNP0zjdgoyGYvPLpsG2","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336977,"choices":[{"index":0,"delta":{"role":"assistant","content":" at"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + headers: + Content-Type: + - text/event-stream + status: 200 OK + code: 200 + duration: 605.251791ms +- id: 3 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 709 + host: "" + body: '{"messages":[{"content":"you will generate a short title based on the first message a user begins a conversation with\n\n- ensure it is not more than 50 characters long\n- the title should be a summary of the user''s message\n- it should be one line long\n- do not use quotes or colons\n- the entire text you return will be used as the title\n- never return anything that is more than one sentence (one line) long\n","role":"system"},{"content":"Generate a concise title for the following content:\n\nuse grep to search for the word ''package'' in go files","role":"user"}],"model":"qwen/qwen3-next-80b-a3b-instruct","max_tokens":40,"stream_options":{"include_usage":true},"usage":{"include":true},"stream":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://openrouter.ai/api/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: |+ + data: {"id":"gen-1759338190-WqFD6k81gq8SXz5C2IAW","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338191,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336977-UnNP0zjdgoyGYvPLpsG2","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336977,"choices":[{"index":0,"delta":{"role":"assistant","content":" line"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338190-WqFD6k81gq8SXz5C2IAW","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338191,"choices":[{"index":0,"delta":{"role":"assistant","content":"Search"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336977-UnNP0zjdgoyGYvPLpsG2","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336977,"choices":[{"index":0,"delta":{"role":"assistant","content":" "},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338190-WqFD6k81gq8SXz5C2IAW","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338191,"choices":[{"index":0,"delta":{"role":"assistant","content":" for"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336977-UnNP0zjdgoyGYvPLpsG2","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336977,"choices":[{"index":0,"delta":{"role":"assistant","content":"1"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338190-WqFD6k81gq8SXz5C2IAW","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338191,"choices":[{"index":0,"delta":{"role":"assistant","content":" package"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336977-UnNP0zjdgoyGYvPLpsG2","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336977,"choices":[{"index":0,"delta":{"role":"assistant","content":":"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338190-WqFD6k81gq8SXz5C2IAW","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338191,"choices":[{"index":0,"delta":{"role":"assistant","content":" in"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336977-UnNP0zjdgoyGYvPLpsG2","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336977,"choices":[{"index":0,"delta":{"role":"assistant","content":" `"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338190-WqFD6k81gq8SXz5C2IAW","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338191,"choices":[{"index":0,"delta":{"role":"assistant","content":" Go"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336977-UnNP0zjdgoyGYvPLpsG2","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336977,"choices":[{"index":0,"delta":{"role":"assistant","content":"package"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338190-WqFD6k81gq8SXz5C2IAW","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338191,"choices":[{"index":0,"delta":{"role":"assistant","content":" files"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336977-UnNP0zjdgoyGYvPLpsG2","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336977,"choices":[{"index":0,"delta":{"role":"assistant","content":" main"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338190-WqFD6k81gq8SXz5C2IAW","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338191,"choices":[{"index":0,"delta":{"role":"assistant","content":" using"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336977-UnNP0zjdgoyGYvPLpsG2","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336977,"choices":[{"index":0,"delta":{"role":"assistant","content":"`"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338190-WqFD6k81gq8SXz5C2IAW","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338191,"choices":[{"index":0,"delta":{"role":"assistant","content":" grep"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336977-UnNP0zjdgoyGYvPLpsG2","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336977,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338190-WqFD6k81gq8SXz5C2IAW","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338191,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]} - data: {"id":"gen-1759336977-UnNP0zjdgoyGYvPLpsG2","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336977,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":7641,"completion_tokens":19,"total_tokens":7660,"cost":0.0046321,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0045846,"upstream_inference_completions_cost":0.0000475},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} + data: {"id":"gen-1759338190-WqFD6k81gq8SXz5C2IAW","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338191,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":125,"completion_tokens":9,"total_tokens":134,"cost":0.0000197,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0000125,"upstream_inference_completions_cost":0.0000072},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} data: [DONE] @@ -189,4 +192,4 @@ interactions: - text/event-stream status: 200 OK code: 200 - duration: 1.852091792s + duration: 2.454754083s diff --git a/internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/ls_tool.yaml b/internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/ls_tool.yaml index 81ef269e7e461ecfd62453f318fc4f15e8ec776e..d94af1702acaefeff94b827ac69d7c71ff6dce3d 100644 --- a/internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/ls_tool.yaml +++ b/internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/ls_tool.yaml @@ -23,35 +23,21 @@ interactions: proto_major: 2 proto_minor: 0 content_length: -1 - body: |+ - data: {"id":"gen-1759336979-wU17j8ItMRIXV0KPYwRi","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336979,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - - data: {"id":"gen-1759336979-wU17j8ItMRIXV0KPYwRi","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336979,"choices":[{"index":0,"delta":{"role":"assistant","content":"List"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - - data: {"id":"gen-1759336979-wU17j8ItMRIXV0KPYwRi","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336979,"choices":[{"index":0,"delta":{"role":"assistant","content":" files in current directory"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - - data: {"id":"gen-1759336979-wU17j8ItMRIXV0KPYwRi","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336979,"choices":[{"index":0,"delta":{"role":"assistant","content":" using ls"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - - data: {"id":"gen-1759336979-wU17j8ItMRIXV0KPYwRi","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336979,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]} - - data: {"id":"gen-1759336979-wU17j8ItMRIXV0KPYwRi","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336979,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":122,"completion_tokens":8,"total_tokens":130,"cost":0.0000279,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0000183,"upstream_inference_completions_cost":0.0000096},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} - - data: [DONE] - + body: '{"error":{"message":"Provider returned error","code":429,"metadata":{"raw":"qwen/qwen3-next-80b-a3b-instruct is temporarily rate-limited upstream. Please retry shortly, or add your own key to accumulate your rate limits: https://openrouter.ai/settings/integrations","provider_name":"GMICloud"}},"user_id":"user_2zMGmKqlf4zmAvL9snVImB1Z1ZQ"}' headers: Content-Type: - - text/event-stream - status: 200 OK - code: 200 - duration: 696.278459ms + - application/json + status: 429 Too Many Requests + code: 429 + duration: 1.266272291s - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 30600 + content_length: 30673 host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/ls_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use ls to list the files in the current directory\",\"role\":\"user\"}],\"model\":\"moonshotai/kimi-k2-0905\",\"max_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"usage\":{\"include\":true},\"stream\":true}" + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/ls_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use ls to list the files in the current directory\",\"role\":\"user\"}],\"model\":\"moonshotai/kimi-k2-0905\",\"max_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"usage\":{\"include\":true},\"stream\":true}" headers: Accept: - application/json @@ -67,55 +53,53 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"gen-1759336979-nIMwm5M0lMfxhAYjk0sS","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336979,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759336979-nIMwm5M0lMfxhAYjk0sS","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336979,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"ls:0","type":"function","function":{"name":"ls","arguments":""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338193-xcqm54OyT19CiJn5OmeO","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338193,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336979-nIMwm5M0lMfxhAYjk0sS","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336979,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"{\""},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338193-xcqm54OyT19CiJn5OmeO","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338193,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":"functions.ls:0","index":0,"type":"function","function":{"name":"ls","arguments":""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336979-nIMwm5M0lMfxhAYjk0sS","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336979,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"path"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338193-xcqm54OyT19CiJn5OmeO","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338193,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"{\"path"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336979-nIMwm5M0lMfxhAYjk0sS","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336979,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"\":"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338193-xcqm54OyT19CiJn5OmeO","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338193,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336979-nIMwm5M0lMfxhAYjk0sS","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336979,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":" \"/"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338193-xcqm54OyT19CiJn5OmeO","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338193,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":" \"/"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336979-nIMwm5M0lMfxhAYjk0sS","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336979,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"tmp"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338193-xcqm54OyT19CiJn5OmeO","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338193,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"tmp"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336979-nIMwm5M0lMfxhAYjk0sS","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336979,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"/c"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338193-xcqm54OyT19CiJn5OmeO","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338193,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"/c"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336979-nIMwm5M0lMfxhAYjk0sS","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336979,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"rush"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338193-xcqm54OyT19CiJn5OmeO","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338193,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"rush"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336979-nIMwm5M0lMfxhAYjk0sS","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336979,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"-test"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338193-xcqm54OyT19CiJn5OmeO","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338193,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"-test"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336979-nIMwm5M0lMfxhAYjk0sS","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336979,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"/Test"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338193-xcqm54OyT19CiJn5OmeO","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338193,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"/Test"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336979-nIMwm5M0lMfxhAYjk0sS","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336979,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"Coder"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338193-xcqm54OyT19CiJn5OmeO","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338193,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"Coder"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336979-nIMwm5M0lMfxhAYjk0sS","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336979,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"Agent"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338193-xcqm54OyT19CiJn5OmeO","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338193,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"Agent"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336979-nIMwm5M0lMfxhAYjk0sS","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336979,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"/open"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338193-xcqm54OyT19CiJn5OmeO","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338193,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"/open"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336979-nIMwm5M0lMfxhAYjk0sS","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336979,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"router"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338193-xcqm54OyT19CiJn5OmeO","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338193,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"router"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336979-nIMwm5M0lMfxhAYjk0sS","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336979,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"-k"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338193-xcqm54OyT19CiJn5OmeO","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338193,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"-k"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336979-nIMwm5M0lMfxhAYjk0sS","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336979,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"imi"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338193-xcqm54OyT19CiJn5OmeO","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338193,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"imi"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336979-nIMwm5M0lMfxhAYjk0sS","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336979,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"-k"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338193-xcqm54OyT19CiJn5OmeO","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338193,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"-k"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336979-nIMwm5M0lMfxhAYjk0sS","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336979,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"2"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338193-xcqm54OyT19CiJn5OmeO","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338193,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"2"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336979-nIMwm5M0lMfxhAYjk0sS","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336979,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"/"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338193-xcqm54OyT19CiJn5OmeO","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338193,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"/"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336979-nIMwm5M0lMfxhAYjk0sS","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336979,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"ls"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338193-xcqm54OyT19CiJn5OmeO","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338193,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"ls"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336979-nIMwm5M0lMfxhAYjk0sS","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336979,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"_tool"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338193-xcqm54OyT19CiJn5OmeO","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338193,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"_tool"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336979-nIMwm5M0lMfxhAYjk0sS","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336979,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"\"}"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338193-xcqm54OyT19CiJn5OmeO","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338193,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"\"}"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336979-nIMwm5M0lMfxhAYjk0sS","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336979,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"tool_calls","native_finish_reason":"tool_calls","logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338193-xcqm54OyT19CiJn5OmeO","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338193,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"tool_calls","native_finish_reason":"tool_calls","logprobs":null}]} - data: {"id":"gen-1759336979-nIMwm5M0lMfxhAYjk0sS","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336979,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":7561,"completion_tokens":31,"total_tokens":7592,"cost":0.0046141,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0045366,"upstream_inference_completions_cost":0.0000775},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} + data: {"id":"gen-1759338193-xcqm54OyT19CiJn5OmeO","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338193,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":7210,"completion_tokens":32,"total_tokens":7242,"cost":0.002956,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.002884,"upstream_inference_completions_cost":0.000072},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} data: [DONE] @@ -124,15 +108,15 @@ interactions: - text/event-stream status: 200 OK code: 200 - duration: 2.330768167s + duration: 2.39305425s - id: 2 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 30997 + content_length: 31072 host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/ls_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use ls to list the files in the current directory\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"TestCoderAgent/openrouter-kimi-k2/ls_tool-1\",\"function\":{\"arguments\":\"{\\\"path\\\": \\\"/tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/ls_tool\\\"}\",\"name\":\"ls\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"- /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/ls_tool/\\n - go.mod\\n - main.go\\n\",\"tool_call_id\":\"TestCoderAgent/openrouter-kimi-k2/ls_tool-1\",\"role\":\"tool\"}],\"model\":\"moonshotai/kimi-k2-0905\",\"max_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"usage\":{\"include\":true},\"stream\":true}" + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/ls_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use ls to list the files in the current directory\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"TestCoderAgent/openrouter-kimi-k2/ls_tool-1\",\"function\":{\"arguments\":\"{\\\"path\\\": \\\"/tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/ls_tool\\\"}\",\"name\":\"ls\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"\\n- /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/ls_tool/\\n - go.mod\\n - main.go\\n\",\"tool_call_id\":\"TestCoderAgent/openrouter-kimi-k2/ls_tool-1\",\"role\":\"tool\"}],\"model\":\"moonshotai/kimi-k2-0905\",\"max_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"usage\":{\"include\":true},\"stream\":true}" headers: Accept: - application/json @@ -148,11 +132,74 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"gen-1759336983-lIugGA68PrnHP9FQY6ag","provider":"DeepInfra","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336983,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338195-4VpFbR5oGn7VzLnBAKtA","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338195,"choices":[{"index":0,"delta":{"role":"assistant","content":"-"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null} + + data: {"id":"gen-1759338195-4VpFbR5oGn7VzLnBAKtA","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338195,"choices":[{"index":0,"delta":{"role":"assistant","content":" go"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null} + + data: {"id":"gen-1759338195-4VpFbR5oGn7VzLnBAKtA","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338195,"choices":[{"index":0,"delta":{"role":"assistant","content":".mod"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null} + + data: {"id":"gen-1759338195-4VpFbR5oGn7VzLnBAKtA","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338195,"choices":[{"index":0,"delta":{"role":"assistant","content":"\n"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null} + + data: {"id":"gen-1759338195-4VpFbR5oGn7VzLnBAKtA","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338195,"choices":[{"index":0,"delta":{"role":"assistant","content":"-"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null} + + data: {"id":"gen-1759338195-4VpFbR5oGn7VzLnBAKtA","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338195,"choices":[{"index":0,"delta":{"role":"assistant","content":" main"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null} + + data: {"id":"gen-1759338195-4VpFbR5oGn7VzLnBAKtA","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338195,"choices":[{"index":0,"delta":{"role":"assistant","content":".go"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null} + + data: {"id":"gen-1759338195-4VpFbR5oGn7VzLnBAKtA","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338195,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}],"system_fingerprint":null} + + data: {"id":"gen-1759338195-4VpFbR5oGn7VzLnBAKtA","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338195,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":7405,"completion_tokens":8,"total_tokens":7413,"cost":0.004463,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.004443,"upstream_inference_completions_cost":0.00002},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} + + data: [DONE] + + headers: + Content-Type: + - text/event-stream + status: 200 OK + code: 200 + duration: 1.673998125s +- id: 3 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 705 + host: "" + body: '{"messages":[{"content":"you will generate a short title based on the first message a user begins a conversation with\n\n- ensure it is not more than 50 characters long\n- the title should be a summary of the user''s message\n- it should be one line long\n- do not use quotes or colons\n- the entire text you return will be used as the title\n- never return anything that is more than one sentence (one line) long\n","role":"system"},{"content":"Generate a concise title for the following content:\n\nuse ls to list the files in the current directory","role":"user"}],"model":"qwen/qwen3-next-80b-a3b-instruct","max_tokens":40,"stream_options":{"include_usage":true},"usage":{"include":true},"stream":true}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://openrouter.ai/api/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: |+ + data: {"id":"gen-1759338194-YB7YJ0ZGtJPDH3D0OEuk","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338197,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759338194-YB7YJ0ZGtJPDH3D0OEuk","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338197,"choices":[{"index":0,"delta":{"role":"assistant","content":"List"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759338194-YB7YJ0ZGtJPDH3D0OEuk","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338197,"choices":[{"index":0,"delta":{"role":"assistant","content":" files"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759338194-YB7YJ0ZGtJPDH3D0OEuk","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338197,"choices":[{"index":0,"delta":{"role":"assistant","content":" in"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759338194-YB7YJ0ZGtJPDH3D0OEuk","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338197,"choices":[{"index":0,"delta":{"role":"assistant","content":" current"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759338194-YB7YJ0ZGtJPDH3D0OEuk","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338197,"choices":[{"index":0,"delta":{"role":"assistant","content":" directory"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759338194-YB7YJ0ZGtJPDH3D0OEuk","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338197,"choices":[{"index":0,"delta":{"role":"assistant","content":" using"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759338194-YB7YJ0ZGtJPDH3D0OEuk","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338197,"choices":[{"index":0,"delta":{"role":"assistant","content":" ls"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336983-lIugGA68PrnHP9FQY6ag","provider":"DeepInfra","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336983,"choices":[{"index":0,"delta":{"role":"assistant","content":"2 files:\n- go.mod\n- main.go"},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]} + data: {"id":"gen-1759338194-YB7YJ0ZGtJPDH3D0OEuk","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338197,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]} - data: {"id":"gen-1759336983-lIugGA68PrnHP9FQY6ag","provider":"DeepInfra","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336983,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":7369,"completion_tokens":10,"total_tokens":7379,"cost":0.0037045,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0036845,"upstream_inference_completions_cost":0.00002},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} + data: {"id":"gen-1759338194-YB7YJ0ZGtJPDH3D0OEuk","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338197,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":122,"completion_tokens":8,"total_tokens":130,"cost":0.0000186,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0000122,"upstream_inference_completions_cost":0.0000064},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} data: [DONE] @@ -161,4 +208,4 @@ interactions: - text/event-stream status: 200 OK code: 200 - duration: 423.118ms + duration: 6.972533625s diff --git a/internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/multiedit_tool.yaml b/internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/multiedit_tool.yaml index 5425ae18efd667a36ed5117670cf9dd3bf43e2ad..275aea1da30a1ef1d0f03794f2162f99267c1240 100644 --- a/internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/multiedit_tool.yaml +++ b/internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/multiedit_tool.yaml @@ -24,37 +24,37 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"gen-1759336983-e8PSIDUhmBZXLOJ5tJFC","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336984,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378400-0QortBKI7SIAJtFnqJF4","provider":"AtlasCloud","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336983-e8PSIDUhmBZXLOJ5tJFC","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336984,"choices":[{"index":0,"delta":{"role":"assistant","content":"Use"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378400-0QortBKI7SIAJtFnqJF4","provider":"AtlasCloud","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":"Use"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336983-e8PSIDUhmBZXLOJ5tJFC","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336984,"choices":[{"index":0,"delta":{"role":"assistant","content":" mult"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378400-0QortBKI7SIAJtFnqJF4","provider":"AtlasCloud","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":" mult"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336983-e8PSIDUhmBZXLOJ5tJFC","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336984,"choices":[{"index":0,"delta":{"role":"assistant","content":"ied"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378400-0QortBKI7SIAJtFnqJF4","provider":"AtlasCloud","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":"ied"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336983-e8PSIDUhmBZXLOJ5tJFC","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336984,"choices":[{"index":0,"delta":{"role":"assistant","content":"it"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378400-0QortBKI7SIAJtFnqJF4","provider":"AtlasCloud","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":"it"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336983-e8PSIDUhmBZXLOJ5tJFC","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336984,"choices":[{"index":0,"delta":{"role":"assistant","content":" to"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378400-0QortBKI7SIAJtFnqJF4","provider":"AtlasCloud","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":" to"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336983-e8PSIDUhmBZXLOJ5tJFC","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336984,"choices":[{"index":0,"delta":{"role":"assistant","content":" update"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378400-0QortBKI7SIAJtFnqJF4","provider":"AtlasCloud","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":" update"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336983-e8PSIDUhmBZXLOJ5tJFC","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336984,"choices":[{"index":0,"delta":{"role":"assistant","content":" greeting"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378400-0QortBKI7SIAJtFnqJF4","provider":"AtlasCloud","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":" greeting"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336983-e8PSIDUhmBZXLOJ5tJFC","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336984,"choices":[{"index":0,"delta":{"role":"assistant","content":" and"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378400-0QortBKI7SIAJtFnqJF4","provider":"AtlasCloud","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":" and"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336983-e8PSIDUhmBZXLOJ5tJFC","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336984,"choices":[{"index":0,"delta":{"role":"assistant","content":" add"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378400-0QortBKI7SIAJtFnqJF4","provider":"AtlasCloud","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":" add"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336983-e8PSIDUhmBZXLOJ5tJFC","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336984,"choices":[{"index":0,"delta":{"role":"assistant","content":" comment"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378400-0QortBKI7SIAJtFnqJF4","provider":"AtlasCloud","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":" comment"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336983-e8PSIDUhmBZXLOJ5tJFC","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336984,"choices":[{"index":0,"delta":{"role":"assistant","content":" in"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378400-0QortBKI7SIAJtFnqJF4","provider":"AtlasCloud","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":" in"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336983-e8PSIDUhmBZXLOJ5tJFC","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336984,"choices":[{"index":0,"delta":{"role":"assistant","content":" main"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378400-0QortBKI7SIAJtFnqJF4","provider":"AtlasCloud","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":" main"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336983-e8PSIDUhmBZXLOJ5tJFC","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336984,"choices":[{"index":0,"delta":{"role":"assistant","content":".go"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378400-0QortBKI7SIAJtFnqJF4","provider":"AtlasCloud","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":".go"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336983-e8PSIDUhmBZXLOJ5tJFC","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336984,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]} + data: {"id":"gen-1759378400-0QortBKI7SIAJtFnqJF4","provider":"AtlasCloud","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]} - data: {"id":"gen-1759336983-e8PSIDUhmBZXLOJ5tJFC","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336984,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":145,"completion_tokens":14,"total_tokens":159,"cost":0.0000257,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0000145,"upstream_inference_completions_cost":0.0000112},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} + data: {"id":"gen-1759378400-0QortBKI7SIAJtFnqJF4","provider":"AtlasCloud","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":145,"completion_tokens":14,"total_tokens":159,"cost":0.00004275,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.00002175,"upstream_inference_completions_cost":0.000021},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} data: [DONE] @@ -63,15 +63,15 @@ interactions: - text/event-stream status: 200 OK code: 200 - duration: 991.084666ms + duration: 1.548603375s - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 30686 + content_length: 30759 host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/multiedit_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use multiedit to change 'Hello, World!' to 'Hello, Crush!' and add a comment '// Greeting' above the fmt.Println line in main.go\",\"role\":\"user\"}],\"model\":\"moonshotai/kimi-k2-0905\",\"max_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"usage\":{\"include\":true},\"stream\":true}" + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/multiedit_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use multiedit to change 'Hello, World!' to 'Hello, Crush!' and add a comment '// Greeting' above the fmt.Println line in main.go\",\"role\":\"user\"}],\"model\":\"moonshotai/kimi-k2-0905\",\"max_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"usage\":{\"include\":true},\"stream\":true}" headers: Accept: - application/json @@ -87,61 +87,113 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"gen-1759336984-xn30ogpHa4WakHJag94K","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336984,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378400-mhFHJkV6bkaKgLWD3AAW","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336984-xn30ogpHa4WakHJag94K","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336984,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":"functions.view:0","index":0,"type":"function","function":{"name":"view","arguments":""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378400-mhFHJkV6bkaKgLWD3AAW","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":"I'll"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336984-xn30ogpHa4WakHJag94K","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336984,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"{\"file"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378400-mhFHJkV6bkaKgLWD3AAW","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":" help"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336984-xn30ogpHa4WakHJag94K","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336984,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"_path"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378400-mhFHJkV6bkaKgLWD3AAW","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":" you"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336984-xn30ogpHa4WakHJag94K","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336984,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378400-mhFHJkV6bkaKgLWD3AAW","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":" use"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336984-xn30ogpHa4WakHJag94K","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336984,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":" \"/"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378400-mhFHJkV6bkaKgLWD3AAW","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":" mult"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336984-xn30ogpHa4WakHJag94K","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336984,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"tmp"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378400-mhFHJkV6bkaKgLWD3AAW","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":"ied"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336984-xn30ogpHa4WakHJag94K","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336984,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"/c"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378400-mhFHJkV6bkaKgLWD3AAW","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":"it"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336984-xn30ogpHa4WakHJag94K","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336984,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"rush"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378400-mhFHJkV6bkaKgLWD3AAW","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":" to"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336984-xn30ogpHa4WakHJag94K","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336984,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"-test"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378400-mhFHJkV6bkaKgLWD3AAW","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":" make"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336984-xn30ogpHa4WakHJag94K","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336984,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"/Test"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378400-mhFHJkV6bkaKgLWD3AAW","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":" those"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336984-xn30ogpHa4WakHJag94K","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336984,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"Coder"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378400-mhFHJkV6bkaKgLWD3AAW","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":" changes"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336984-xn30ogpHa4WakHJag94K","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336984,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"Agent"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378400-mhFHJkV6bkaKgLWD3AAW","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":" to"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336984-xn30ogpHa4WakHJag94K","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336984,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"/open"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378400-mhFHJkV6bkaKgLWD3AAW","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":" main"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336984-xn30ogpHa4WakHJag94K","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336984,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"router"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378400-mhFHJkV6bkaKgLWD3AAW","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":".go"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336984-xn30ogpHa4WakHJag94K","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336984,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"-k"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378400-mhFHJkV6bkaKgLWD3AAW","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":"."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336984-xn30ogpHa4WakHJag94K","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336984,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"imi"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378400-mhFHJkV6bkaKgLWD3AAW","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":" Let"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336984-xn30ogpHa4WakHJag94K","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336984,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"-k"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378400-mhFHJkV6bkaKgLWD3AAW","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":" me"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336984-xn30ogpHa4WakHJag94K","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336984,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"2"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378400-mhFHJkV6bkaKgLWD3AAW","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":" first"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336984-xn30ogpHa4WakHJag94K","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336984,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"/mult"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378400-mhFHJkV6bkaKgLWD3AAW","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":" check"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336984-xn30ogpHa4WakHJag94K","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336984,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"ied"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378400-mhFHJkV6bkaKgLWD3AAW","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":" the"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336984-xn30ogpHa4WakHJag94K","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336984,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"it"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378400-mhFHJkV6bkaKgLWD3AAW","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":" current"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336984-xn30ogpHa4WakHJag94K","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336984,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"_tool"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378400-mhFHJkV6bkaKgLWD3AAW","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":" content"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336984-xn30ogpHa4WakHJag94K","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336984,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"/main"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378400-mhFHJkV6bkaKgLWD3AAW","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":" of"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336984-xn30ogpHa4WakHJag94K","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336984,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":".go"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378400-mhFHJkV6bkaKgLWD3AAW","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":" the"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336984-xn30ogpHa4WakHJag94K","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336984,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"\"}"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378400-mhFHJkV6bkaKgLWD3AAW","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":" file"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336984-xn30ogpHa4WakHJag94K","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336984,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"tool_calls","native_finish_reason":"tool_calls","logprobs":null}]} + data: {"id":"gen-1759378400-mhFHJkV6bkaKgLWD3AAW","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":"."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336984-xn30ogpHa4WakHJag94K","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336984,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":7215,"completion_tokens":35,"total_tokens":7250,"cost":0.0044165,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.004329,"upstream_inference_completions_cost":0.0000875},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} + data: {"id":"gen-1759378400-mhFHJkV6bkaKgLWD3AAW","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":"functions.view:0","index":0,"type":"function","function":{"name":"view","arguments":""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759378400-mhFHJkV6bkaKgLWD3AAW","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"{\"file"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759378400-mhFHJkV6bkaKgLWD3AAW","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"_path"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759378400-mhFHJkV6bkaKgLWD3AAW","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759378400-mhFHJkV6bkaKgLWD3AAW","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":" \"/"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759378400-mhFHJkV6bkaKgLWD3AAW","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"tmp"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759378400-mhFHJkV6bkaKgLWD3AAW","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"/c"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759378400-mhFHJkV6bkaKgLWD3AAW","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"rush"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759378400-mhFHJkV6bkaKgLWD3AAW","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"-test"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759378400-mhFHJkV6bkaKgLWD3AAW","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"/Test"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759378400-mhFHJkV6bkaKgLWD3AAW","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"Coder"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759378400-mhFHJkV6bkaKgLWD3AAW","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"Agent"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759378400-mhFHJkV6bkaKgLWD3AAW","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"/open"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759378400-mhFHJkV6bkaKgLWD3AAW","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"router"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759378400-mhFHJkV6bkaKgLWD3AAW","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"-k"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759378400-mhFHJkV6bkaKgLWD3AAW","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"imi"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759378400-mhFHJkV6bkaKgLWD3AAW","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"-k"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759378400-mhFHJkV6bkaKgLWD3AAW","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"2"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759378400-mhFHJkV6bkaKgLWD3AAW","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"/mult"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759378400-mhFHJkV6bkaKgLWD3AAW","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"ied"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759378400-mhFHJkV6bkaKgLWD3AAW","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"it"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759378400-mhFHJkV6bkaKgLWD3AAW","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"_tool"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759378400-mhFHJkV6bkaKgLWD3AAW","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"/main"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759378400-mhFHJkV6bkaKgLWD3AAW","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":".go"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759378400-mhFHJkV6bkaKgLWD3AAW","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"\"}"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759378400-mhFHJkV6bkaKgLWD3AAW","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"tool_calls","native_finish_reason":"tool_calls","logprobs":null}]} + + data: {"id":"gen-1759378400-mhFHJkV6bkaKgLWD3AAW","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378400,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":7234,"completion_tokens":61,"total_tokens":7295,"cost":0.0044929,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0043404,"upstream_inference_completions_cost":0.0001525},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} data: [DONE] @@ -150,15 +202,15 @@ interactions: - text/event-stream status: 200 OK code: 200 - duration: 1.115799458s + duration: 1.727401792s - id: 2 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 31184 + content_length: 31383 host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/multiedit_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use multiedit to change 'Hello, World!' to 'Hello, Crush!' and add a comment '// Greeting' above the fmt.Println line in main.go\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"TestCoderAgent/openrouter-kimi-k2/multiedit_tool-1\",\"function\":{\"arguments\":\"{\\\"file_path\\\": \\\"/tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/multiedit_tool/main.go\\\"}\",\"name\":\"view\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"\\n 1|package main\\n 2|\\n 3|import \\\"fmt\\\"\\n 4|\\n 5|func main() {\\n 6|\\tfmt.Println(\\\"Hello, World!\\\")\\n 7|}\\n\\n\",\"tool_call_id\":\"TestCoderAgent/openrouter-kimi-k2/multiedit_tool-1\",\"role\":\"tool\"}],\"model\":\"moonshotai/kimi-k2-0905\",\"max_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"usage\":{\"include\":true},\"stream\":true}" + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/multiedit_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use multiedit to change 'Hello, World!' to 'Hello, Crush!' and add a comment '// Greeting' above the fmt.Println line in main.go\",\"role\":\"user\"},{\"content\":\"I'll help you use multiedit to make those changes to main.go. Let me first check the current content of the file.\",\"tool_calls\":[{\"id\":\"TestCoderAgent/openrouter-kimi-k2/multiedit_tool-1\",\"function\":{\"arguments\":\"{\\\"file_path\\\": \\\"/tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/multiedit_tool/main.go\\\"}\",\"name\":\"view\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"\\n 1|package main\\n 2|\\n 3|import \\\"fmt\\\"\\n 4|\\n 5|func main() {\\n 6|\\tfmt.Println(\\\"Hello, World!\\\")\\n 7|}\\n\\n\",\"tool_call_id\":\"TestCoderAgent/openrouter-kimi-k2/multiedit_tool-1\",\"role\":\"tool\"}],\"model\":\"moonshotai/kimi-k2-0905\",\"max_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"usage\":{\"include\":true},\"stream\":true}" headers: Accept: - application/json @@ -174,174 +226,203 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"gen-1759336985-0Wkt4yboQuRMH6T81dyq","provider":"DeepInfra","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336985,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336985-0Wkt4yboQuRMH6T81dyq","provider":"DeepInfra","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336985,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"TestCoderAgent/openrouter-kimi-k2/multiedit_tool-2","function":{"arguments":"{\"file_path\": \"/tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/multiedit_tool/main.go\", \"edits\": [{\"old_string\": \"\\tfmt.Println(\\\"Hello, World!\\\")\", \"new_string\": \"\\t// Greeting\\n\\tfmt.Println(\\\"Hello, Crush!\\\")\"}]}","name":"TestCoderAgent/openrouter-kimi-k2/multiedit_tool-2"},"type":"function"}]},"finish_reason":"tool_calls","native_finish_reason":"tool_calls","logprobs":null}]} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":"Now I'll"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336985-0Wkt4yboQuRMH6T81dyq","provider":"DeepInfra","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336985,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":7712,"completion_tokens":68,"total_tokens":7780,"cost":0.003992,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.003856,"upstream_inference_completions_cost":0.000136},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":" use"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: [DONE] + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":" mult"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - headers: - Content-Type: - - text/event-stream - status: 200 OK - code: 200 - duration: 788.834375ms -- id: 3 - request: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - content_length: 31792 - host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/multiedit_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use multiedit to change 'Hello, World!' to 'Hello, Crush!' and add a comment '// Greeting' above the fmt.Println line in main.go\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"TestCoderAgent/openrouter-kimi-k2/multiedit_tool-1\",\"function\":{\"arguments\":\"{\\\"file_path\\\": \\\"/tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/multiedit_tool/main.go\\\"}\",\"name\":\"view\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"\\n 1|package main\\n 2|\\n 3|import \\\"fmt\\\"\\n 4|\\n 5|func main() {\\n 6|\\tfmt.Println(\\\"Hello, World!\\\")\\n 7|}\\n\\n\",\"tool_call_id\":\"TestCoderAgent/openrouter-kimi-k2/multiedit_tool-1\",\"role\":\"tool\"},{\"tool_calls\":[{\"id\":\"TestCoderAgent/openrouter-kimi-k2/multiedit_tool-2\",\"function\":{\"arguments\":\"{\\\"file_path\\\": \\\"/tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/multiedit_tool/main.go\\\", \\\"edits\\\": [{\\\"old_string\\\": \\\"\\\\tfmt.Println(\\\\\\\"Hello, World!\\\\\\\")\\\", \\\"new_string\\\": \\\"\\\\t// Greeting\\\\n\\\\tfmt.Println(\\\\\\\"Hello, Crush!\\\\\\\")\\\"}]}\",\"name\":\"TestCoderAgent/openrouter-kimi-k2/multiedit_tool-2\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"tool not found: TestCoderAgent/openrouter-kimi-k2/multiedit_tool-2\",\"tool_call_id\":\"TestCoderAgent/openrouter-kimi-k2/multiedit_tool-2\",\"role\":\"tool\"}],\"model\":\"moonshotai/kimi-k2-0905\",\"max_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"usage\":{\"include\":true},\"stream\":true}" - headers: - Accept: - - application/json - Content-Type: - - application/json - User-Agent: - - OpenAI/Go 2.3.0 - url: https://openrouter.ai/api/v1/chat/completions - method: POST - response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - content_length: -1 - body: |+ - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":"ied"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":"it"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":" to"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":" make"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"functions.multiedit:3","type":"function","function":{"name":"multiedit","arguments":""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":" both"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"{\""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":" changes"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"file"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":" -"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"_path"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":" adding"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":" the"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":" \"/"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":" comment"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"tmp"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":" and"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"/c"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":" changing"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"rush"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":" the"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"-test"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":" greeting"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"/Test"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":" text"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"Coder"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":":"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"Agent"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"functions.multiedit:1","type":"function","function":{"name":"multiedit"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"/open"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"{\""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"router"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"file"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"-k"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"_path"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"imi"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"-k"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":" \"/"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"2"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"tmp"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"/mult"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"/c"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"ied"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"rush"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"it"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"-test"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"_tool"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"/Test"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"/main"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"Coder"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":".go"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"Agent"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"\","}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"/open"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":" \""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"router"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"ed"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"-k"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"its"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"imi"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"-k"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":" [{\""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"2"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"old"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"/mult"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"_string"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"ied"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"it"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":" \""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"_tool"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"fmt"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"/main"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":".Println"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":".go"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"(\\\""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"\","}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"Hello"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":" \""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":","}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"ed"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":" World"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"its"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"!\\"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"\")"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":" [{\""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"\","}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"old"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":" \""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"_string"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"new"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"_string"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":" \""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"func"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":" \"//"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":" main"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":" G"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"()"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"reeting"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":" {\\"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"\\n"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"n"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"\\t"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"\\t"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"fmt"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"fmt"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":".Println"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":".Println"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"(\\\""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"(\\\""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"Hello"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"Hello"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":","}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":","}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":" Crush"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":" World"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"!\\"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"!\\"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"\")"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"\")"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"\"}"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"\","}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"]}"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":" \""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"tool_calls","native_finish_reason":"tool_calls","logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"new"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336988-llVaiGefO5qaa8E3rXel","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336988,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":7567,"completion_tokens":73,"total_tokens":7640,"cost":0.0031728,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0030268,"upstream_inference_completions_cost":0.000146},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"_string"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":" \""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"func"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":" main"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"()"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":" {\\"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"n"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"\\t"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"//"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":" G"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"reeting"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"\\n"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"\\t"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"fmt"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":".Println"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"(\\\""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"Hello"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":","}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":" Crush"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"!\\"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"\")"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"\"}"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"]}"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"tool_calls","native_finish_reason":"tool_calls","logprobs":null}]} + + data: {"id":"gen-1759378403-JYrS2RHcHMrcohrmuU6W","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378403,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":7462,"completion_tokens":107,"total_tokens":7569,"cost":0.0047447,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0044772,"upstream_inference_completions_cost":0.0002675},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} data: [DONE] @@ -350,15 +431,15 @@ interactions: - text/event-stream status: 200 OK code: 200 - duration: 2.713975958s -- id: 4 + duration: 1.92614125s +- id: 3 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 32407 + content_length: 32145 host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/multiedit_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use multiedit to change 'Hello, World!' to 'Hello, Crush!' and add a comment '// Greeting' above the fmt.Println line in main.go\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"TestCoderAgent/openrouter-kimi-k2/multiedit_tool-1\",\"function\":{\"arguments\":\"{\\\"file_path\\\": \\\"/tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/multiedit_tool/main.go\\\"}\",\"name\":\"view\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"\\n 1|package main\\n 2|\\n 3|import \\\"fmt\\\"\\n 4|\\n 5|func main() {\\n 6|\\tfmt.Println(\\\"Hello, World!\\\")\\n 7|}\\n\\n\",\"tool_call_id\":\"TestCoderAgent/openrouter-kimi-k2/multiedit_tool-1\",\"role\":\"tool\"},{\"tool_calls\":[{\"id\":\"TestCoderAgent/openrouter-kimi-k2/multiedit_tool-2\",\"function\":{\"arguments\":\"{\\\"file_path\\\": \\\"/tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/multiedit_tool/main.go\\\", \\\"edits\\\": [{\\\"old_string\\\": \\\"\\\\tfmt.Println(\\\\\\\"Hello, World!\\\\\\\")\\\", \\\"new_string\\\": \\\"\\\\t// Greeting\\\\n\\\\tfmt.Println(\\\\\\\"Hello, Crush!\\\\\\\")\\\"}]}\",\"name\":\"TestCoderAgent/openrouter-kimi-k2/multiedit_tool-2\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"tool not found: TestCoderAgent/openrouter-kimi-k2/multiedit_tool-2\",\"tool_call_id\":\"TestCoderAgent/openrouter-kimi-k2/multiedit_tool-2\",\"role\":\"tool\"},{\"tool_calls\":[{\"id\":\"TestCoderAgent/openrouter-kimi-k2/multiedit_tool-3\",\"function\":{\"arguments\":\"{\\\"file_path\\\": \\\"/tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/multiedit_tool/main.go\\\", \\\"edits\\\": [{\\\"old_string\\\": \\\"fmt.Println(\\\\\\\"Hello, World!\\\\\\\")\\\", \\\"new_string\\\": \\\"// Greeting\\\\n\\\\tfmt.Println(\\\\\\\"Hello, Crush!\\\\\\\")\\\"}]}\",\"name\":\"multiedit\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"\\nApplied 1 edits to file: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/multiedit_tool/main.go\\n\\n\",\"tool_call_id\":\"TestCoderAgent/openrouter-kimi-k2/multiedit_tool-3\",\"role\":\"tool\"}],\"model\":\"moonshotai/kimi-k2-0905\",\"max_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"usage\":{\"include\":true},\"stream\":true}" + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/multiedit_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use multiedit to change 'Hello, World!' to 'Hello, Crush!' and add a comment '// Greeting' above the fmt.Println line in main.go\",\"role\":\"user\"},{\"content\":\"I'll help you use multiedit to make those changes to main.go. Let me first check the current content of the file.\",\"tool_calls\":[{\"id\":\"TestCoderAgent/openrouter-kimi-k2/multiedit_tool-1\",\"function\":{\"arguments\":\"{\\\"file_path\\\": \\\"/tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/multiedit_tool/main.go\\\"}\",\"name\":\"view\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"\\n 1|package main\\n 2|\\n 3|import \\\"fmt\\\"\\n 4|\\n 5|func main() {\\n 6|\\tfmt.Println(\\\"Hello, World!\\\")\\n 7|}\\n\\n\",\"tool_call_id\":\"TestCoderAgent/openrouter-kimi-k2/multiedit_tool-1\",\"role\":\"tool\"},{\"content\":\"Now I'll use multiedit to make both changes - adding the comment and changing the greeting text:\",\"tool_calls\":[{\"id\":\"TestCoderAgent/openrouter-kimi-k2/multiedit_tool-2\",\"function\":{\"arguments\":\"{\\\"file_path\\\": \\\"/tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/multiedit_tool/main.go\\\", \\\"edits\\\": [{\\\"old_string\\\": \\\"func main() {\\\\n\\\\tfmt.Println(\\\\\\\"Hello, World!\\\\\\\")\\\", \\\"new_string\\\": \\\"func main() {\\\\n\\\\t// Greeting\\\\n\\\\tfmt.Println(\\\\\\\"Hello, Crush!\\\\\\\")\\\"}]}\",\"name\":\"multiedit\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"\\nApplied 1 edits to file: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/multiedit_tool/main.go\\n\\n\",\"tool_call_id\":\"TestCoderAgent/openrouter-kimi-k2/multiedit_tool-2\",\"role\":\"tool\"}],\"model\":\"moonshotai/kimi-k2-0905\",\"max_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"usage\":{\"include\":true},\"stream\":true}" headers: Accept: - application/json @@ -374,59 +455,117 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"gen-1759336995-bOaZpYyCbQD94DMxbbNT","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336995,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378406-rfPo1bGpv5x6tUTmMScs","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378406,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759378406-rfPo1bGpv5x6tUTmMScs","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378406,"choices":[{"index":0,"delta":{"role":"assistant","content":"Done"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759378406-rfPo1bGpv5x6tUTmMScs","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378406,"choices":[{"index":0,"delta":{"role":"assistant","content":"!"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759378406-rfPo1bGpv5x6tUTmMScs","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378406,"choices":[{"index":0,"delta":{"role":"assistant","content":" I've"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759378406-rfPo1bGpv5x6tUTmMScs","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378406,"choices":[{"index":0,"delta":{"role":"assistant","content":" used"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759378406-rfPo1bGpv5x6tUTmMScs","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378406,"choices":[{"index":0,"delta":{"role":"assistant","content":" mult"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759378406-rfPo1bGpv5x6tUTmMScs","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378406,"choices":[{"index":0,"delta":{"role":"assistant","content":"ied"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759378406-rfPo1bGpv5x6tUTmMScs","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378406,"choices":[{"index":0,"delta":{"role":"assistant","content":"it"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759378406-rfPo1bGpv5x6tUTmMScs","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378406,"choices":[{"index":0,"delta":{"role":"assistant","content":" to"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759378406-rfPo1bGpv5x6tUTmMScs","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378406,"choices":[{"index":0,"delta":{"role":"assistant","content":":\n"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759378406-rfPo1bGpv5x6tUTmMScs","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378406,"choices":[{"index":0,"delta":{"role":"assistant","content":"1"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759378406-rfPo1bGpv5x6tUTmMScs","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378406,"choices":[{"index":0,"delta":{"role":"assistant","content":"."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759378406-rfPo1bGpv5x6tUTmMScs","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378406,"choices":[{"index":0,"delta":{"role":"assistant","content":" Add"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759378406-rfPo1bGpv5x6tUTmMScs","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378406,"choices":[{"index":0,"delta":{"role":"assistant","content":" the"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759378406-rfPo1bGpv5x6tUTmMScs","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378406,"choices":[{"index":0,"delta":{"role":"assistant","content":" comment"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759378406-rfPo1bGpv5x6tUTmMScs","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378406,"choices":[{"index":0,"delta":{"role":"assistant","content":" `"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759378406-rfPo1bGpv5x6tUTmMScs","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378406,"choices":[{"index":0,"delta":{"role":"assistant","content":"//"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759378406-rfPo1bGpv5x6tUTmMScs","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378406,"choices":[{"index":0,"delta":{"role":"assistant","content":" G"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759378406-rfPo1bGpv5x6tUTmMScs","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378406,"choices":[{"index":0,"delta":{"role":"assistant","content":"reeting"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759378406-rfPo1bGpv5x6tUTmMScs","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378406,"choices":[{"index":0,"delta":{"role":"assistant","content":"`"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759378406-rfPo1bGpv5x6tUTmMScs","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378406,"choices":[{"index":0,"delta":{"role":"assistant","content":" above"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759378406-rfPo1bGpv5x6tUTmMScs","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378406,"choices":[{"index":0,"delta":{"role":"assistant","content":" the"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759378406-rfPo1bGpv5x6tUTmMScs","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378406,"choices":[{"index":0,"delta":{"role":"assistant","content":" fmt"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759378406-rfPo1bGpv5x6tUTmMScs","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378406,"choices":[{"index":0,"delta":{"role":"assistant","content":".Println"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759378406-rfPo1bGpv5x6tUTmMScs","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378406,"choices":[{"index":0,"delta":{"role":"assistant","content":" line"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759378406-rfPo1bGpv5x6tUTmMScs","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378406,"choices":[{"index":0,"delta":{"role":"assistant","content":"\n"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759378406-rfPo1bGpv5x6tUTmMScs","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378406,"choices":[{"index":0,"delta":{"role":"assistant","content":"2"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759378406-rfPo1bGpv5x6tUTmMScs","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378406,"choices":[{"index":0,"delta":{"role":"assistant","content":"."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759378406-rfPo1bGpv5x6tUTmMScs","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378406,"choices":[{"index":0,"delta":{"role":"assistant","content":" Change"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + + data: {"id":"gen-1759378406-rfPo1bGpv5x6tUTmMScs","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378406,"choices":[{"index":0,"delta":{"role":"assistant","content":" '"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336995-bOaZpYyCbQD94DMxbbNT","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336995,"choices":[{"index":0,"delta":{"role":"assistant","content":"Done"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378406-rfPo1bGpv5x6tUTmMScs","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378406,"choices":[{"index":0,"delta":{"role":"assistant","content":"Hello"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336995-bOaZpYyCbQD94DMxbbNT","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336995,"choices":[{"index":0,"delta":{"role":"assistant","content":"."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378406-rfPo1bGpv5x6tUTmMScs","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378406,"choices":[{"index":0,"delta":{"role":"assistant","content":","},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336995-bOaZpYyCbQD94DMxbbNT","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336995,"choices":[{"index":0,"delta":{"role":"assistant","content":" Changed"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378406-rfPo1bGpv5x6tUTmMScs","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378406,"choices":[{"index":0,"delta":{"role":"assistant","content":" World"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336995-bOaZpYyCbQD94DMxbbNT","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336995,"choices":[{"index":0,"delta":{"role":"assistant","content":" \""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378406-rfPo1bGpv5x6tUTmMScs","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378406,"choices":[{"index":0,"delta":{"role":"assistant","content":"!'"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336995-bOaZpYyCbQD94DMxbbNT","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336995,"choices":[{"index":0,"delta":{"role":"assistant","content":"Hello"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378406-rfPo1bGpv5x6tUTmMScs","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378406,"choices":[{"index":0,"delta":{"role":"assistant","content":" to"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336995-bOaZpYyCbQD94DMxbbNT","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336995,"choices":[{"index":0,"delta":{"role":"assistant","content":","},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378406-rfPo1bGpv5x6tUTmMScs","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378406,"choices":[{"index":0,"delta":{"role":"assistant","content":" '"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336995-bOaZpYyCbQD94DMxbbNT","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336995,"choices":[{"index":0,"delta":{"role":"assistant","content":" World"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378406-rfPo1bGpv5x6tUTmMScs","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378406,"choices":[{"index":0,"delta":{"role":"assistant","content":"Hello"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336995-bOaZpYyCbQD94DMxbbNT","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336995,"choices":[{"index":0,"delta":{"role":"assistant","content":"!\""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378406-rfPo1bGpv5x6tUTmMScs","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378406,"choices":[{"index":0,"delta":{"role":"assistant","content":","},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336995-bOaZpYyCbQD94DMxbbNT","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336995,"choices":[{"index":0,"delta":{"role":"assistant","content":" to"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378406-rfPo1bGpv5x6tUTmMScs","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378406,"choices":[{"index":0,"delta":{"role":"assistant","content":" Crush"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336995-bOaZpYyCbQD94DMxbbNT","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336995,"choices":[{"index":0,"delta":{"role":"assistant","content":" \""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378406-rfPo1bGpv5x6tUTmMScs","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378406,"choices":[{"index":0,"delta":{"role":"assistant","content":"!'"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336995-bOaZpYyCbQD94DMxbbNT","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336995,"choices":[{"index":0,"delta":{"role":"assistant","content":"Hello"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378406-rfPo1bGpv5x6tUTmMScs","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378406,"choices":[{"index":0,"delta":{"role":"assistant","content":" in"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336995-bOaZpYyCbQD94DMxbbNT","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336995,"choices":[{"index":0,"delta":{"role":"assistant","content":","},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378406-rfPo1bGpv5x6tUTmMScs","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378406,"choices":[{"index":0,"delta":{"role":"assistant","content":" the"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336995-bOaZpYyCbQD94DMxbbNT","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336995,"choices":[{"index":0,"delta":{"role":"assistant","content":" Crush"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378406-rfPo1bGpv5x6tUTmMScs","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378406,"choices":[{"index":0,"delta":{"role":"assistant","content":" same"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336995-bOaZpYyCbQD94DMxbbNT","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336995,"choices":[{"index":0,"delta":{"role":"assistant","content":"!\""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378406-rfPo1bGpv5x6tUTmMScs","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378406,"choices":[{"index":0,"delta":{"role":"assistant","content":" operation"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336995-bOaZpYyCbQD94DMxbbNT","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336995,"choices":[{"index":0,"delta":{"role":"assistant","content":" and"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378406-rfPo1bGpv5x6tUTmMScs","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378406,"choices":[{"index":0,"delta":{"role":"assistant","content":"\n\n"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336995-bOaZpYyCbQD94DMxbbNT","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336995,"choices":[{"index":0,"delta":{"role":"assistant","content":" added"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378406-rfPo1bGpv5x6tUTmMScs","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378406,"choices":[{"index":0,"delta":{"role":"assistant","content":"The"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336995-bOaZpYyCbQD94DMxbbNT","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336995,"choices":[{"index":0,"delta":{"role":"assistant","content":" the"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378406-rfPo1bGpv5x6tUTmMScs","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378406,"choices":[{"index":0,"delta":{"role":"assistant","content":" changes"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336995-bOaZpYyCbQD94DMxbbNT","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336995,"choices":[{"index":0,"delta":{"role":"assistant","content":" comment"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378406-rfPo1bGpv5x6tUTmMScs","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378406,"choices":[{"index":0,"delta":{"role":"assistant","content":" have"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336995-bOaZpYyCbQD94DMxbbNT","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336995,"choices":[{"index":0,"delta":{"role":"assistant","content":" above"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378406-rfPo1bGpv5x6tUTmMScs","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378406,"choices":[{"index":0,"delta":{"role":"assistant","content":" been"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336995-bOaZpYyCbQD94DMxbbNT","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336995,"choices":[{"index":0,"delta":{"role":"assistant","content":" the"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378406-rfPo1bGpv5x6tUTmMScs","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378406,"choices":[{"index":0,"delta":{"role":"assistant","content":" applied"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336995-bOaZpYyCbQD94DMxbbNT","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336995,"choices":[{"index":0,"delta":{"role":"assistant","content":" fmt"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378406-rfPo1bGpv5x6tUTmMScs","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378406,"choices":[{"index":0,"delta":{"role":"assistant","content":" to"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336995-bOaZpYyCbQD94DMxbbNT","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336995,"choices":[{"index":0,"delta":{"role":"assistant","content":".Println"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378406-rfPo1bGpv5x6tUTmMScs","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378406,"choices":[{"index":0,"delta":{"role":"assistant","content":" main"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336995-bOaZpYyCbQD94DMxbbNT","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336995,"choices":[{"index":0,"delta":{"role":"assistant","content":" line"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378406-rfPo1bGpv5x6tUTmMScs","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378406,"choices":[{"index":0,"delta":{"role":"assistant","content":".go"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336995-bOaZpYyCbQD94DMxbbNT","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336995,"choices":[{"index":0,"delta":{"role":"assistant","content":"."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759378406-rfPo1bGpv5x6tUTmMScs","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378406,"choices":[{"index":0,"delta":{"role":"assistant","content":"."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336995-bOaZpYyCbQD94DMxbbNT","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336995,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]} + data: {"id":"gen-1759378406-rfPo1bGpv5x6tUTmMScs","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378406,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336995-bOaZpYyCbQD94DMxbbNT","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336995,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":7620,"completion_tokens":25,"total_tokens":7645,"cost":0.00310425,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.003048,"upstream_inference_completions_cost":0.00005625},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} + data: {"id":"gen-1759378406-rfPo1bGpv5x6tUTmMScs","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759378406,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":7885,"completion_tokens":54,"total_tokens":7939,"cost":0.004866,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.004731,"upstream_inference_completions_cost":0.000135},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} data: [DONE] @@ -435,4 +574,4 @@ interactions: - text/event-stream status: 200 OK code: 200 - duration: 1.4652825s + duration: 3.31633475s diff --git a/internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/parallel_tool_calls.yaml b/internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/parallel_tool_calls.yaml index bec11168cebd3446d9eb4654f7eb481a804fe97d..743004d7b2715b9d877a87bc5efb813fd040c49f 100644 --- a/internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/parallel_tool_calls.yaml +++ b/internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/parallel_tool_calls.yaml @@ -6,9 +6,9 @@ interactions: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 790 + content_length: 30770 host: "" - body: '{"messages":[{"content":"you will generate a short title based on the first message a user begins a conversation with\n\n- ensure it is not more than 50 characters long\n- the title should be a summary of the user''s message\n- it should be one line long\n- do not use quotes or colons\n- the entire text you return will be used as the title\n- never return anything that is more than one sentence (one line) long\n","role":"system"},{"content":"Generate a concise title for the following content:\n\nuse glob to find all .go files and use ls to list the current directory, it is very important that you run both tool calls in parallel","role":"user"}],"model":"qwen/qwen3-next-80b-a3b-instruct","max_tokens":40,"stream_options":{"include_usage":true},"usage":{"include":true},"stream":true}' + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/parallel_tool_calls\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use glob to find all .go files and use ls to list the current directory, it is very important that you run both tool calls in parallel\",\"role\":\"user\"}],\"model\":\"moonshotai/kimi-k2-0905\",\"max_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"usage\":{\"include\":true},\"stream\":true}" headers: Accept: - application/json @@ -24,39 +24,15 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"gen-1759337012-N2X1W1eACPWaKQXaSXIs","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759337012,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - - data: {"id":"gen-1759337012-N2X1W1eACPWaKQXaSXIs","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759337012,"choices":[{"index":0,"delta":{"role":"assistant","content":"Run"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - - data: {"id":"gen-1759337012-N2X1W1eACPWaKQXaSXIs","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759337012,"choices":[{"index":0,"delta":{"role":"assistant","content":" glob"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - - data: {"id":"gen-1759337012-N2X1W1eACPWaKQXaSXIs","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759337012,"choices":[{"index":0,"delta":{"role":"assistant","content":" and"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - - data: {"id":"gen-1759337012-N2X1W1eACPWaKQXaSXIs","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759337012,"choices":[{"index":0,"delta":{"role":"assistant","content":" ls"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - - data: {"id":"gen-1759337012-N2X1W1eACPWaKQXaSXIs","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759337012,"choices":[{"index":0,"delta":{"role":"assistant","content":" in"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - - data: {"id":"gen-1759337012-N2X1W1eACPWaKQXaSXIs","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759337012,"choices":[{"index":0,"delta":{"role":"assistant","content":" parallel"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - - data: {"id":"gen-1759337012-N2X1W1eACPWaKQXaSXIs","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759337012,"choices":[{"index":0,"delta":{"role":"assistant","content":" to"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338229-nKlOdraU1QA8tsIpaVK5","provider":"Groq","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338229,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fp_6e6ff3688b"} - data: {"id":"gen-1759337012-N2X1W1eACPWaKQXaSXIs","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759337012,"choices":[{"index":0,"delta":{"role":"assistant","content":" find"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338229-nKlOdraU1QA8tsIpaVK5","provider":"Groq","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338229,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":"functions.glob:0","type":"function","function":{"name":"glob","arguments":"{\"pattern\":\"*.go\"}"},"index":0}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fp_6e6ff3688b"} - data: {"id":"gen-1759337012-N2X1W1eACPWaKQXaSXIs","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759337012,"choices":[{"index":0,"delta":{"role":"assistant","content":" ."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338229-nKlOdraU1QA8tsIpaVK5","provider":"Groq","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338229,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":"functions.ls:1","type":"function","function":{"name":"ls","arguments":"{\"path\":\".\"}"},"index":1}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fp_6e6ff3688b"} - data: {"id":"gen-1759337012-N2X1W1eACPWaKQXaSXIs","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759337012,"choices":[{"index":0,"delta":{"role":"assistant","content":"go"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338229-nKlOdraU1QA8tsIpaVK5","provider":"Groq","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338229,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"tool_calls","native_finish_reason":"tool_calls","logprobs":null}],"system_fingerprint":"fp_6e6ff3688b"} - data: {"id":"gen-1759337012-N2X1W1eACPWaKQXaSXIs","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759337012,"choices":[{"index":0,"delta":{"role":"assistant","content":" files"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - - data: {"id":"gen-1759337012-N2X1W1eACPWaKQXaSXIs","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759337012,"choices":[{"index":0,"delta":{"role":"assistant","content":" and"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - - data: {"id":"gen-1759337012-N2X1W1eACPWaKQXaSXIs","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759337012,"choices":[{"index":0,"delta":{"role":"assistant","content":" list"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - - data: {"id":"gen-1759337012-N2X1W1eACPWaKQXaSXIs","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759337012,"choices":[{"index":0,"delta":{"role":"assistant","content":" directory"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - - data: {"id":"gen-1759337012-N2X1W1eACPWaKQXaSXIs","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759337012,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]} - - data: {"id":"gen-1759337012-N2X1W1eACPWaKQXaSXIs","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759337012,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":141,"completion_tokens":15,"total_tokens":156,"cost":0.0000261,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0000141,"upstream_inference_completions_cost":0.000012},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} + data: {"id":"gen-1759338229-nKlOdraU1QA8tsIpaVK5","provider":"Groq","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338229,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":8161,"completion_tokens":29,"total_tokens":8190,"cost":0.00428,"is_byok":false,"prompt_tokens_details":{"cached_tokens":7936,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.004193,"upstream_inference_completions_cost":0.000087},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} data: [DONE] @@ -65,15 +41,15 @@ interactions: - text/event-stream status: 200 OK code: 200 - duration: 1.710983958s + duration: 626.311583ms - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 30697 + content_length: 31474 host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/parallel_tool_calls\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use glob to find all .go files and use ls to list the current directory, it is very important that you run both tool calls in parallel\",\"role\":\"user\"}],\"model\":\"moonshotai/kimi-k2-0905\",\"max_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"usage\":{\"include\":true},\"stream\":true}" + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/parallel_tool_calls\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use glob to find all .go files and use ls to list the current directory, it is very important that you run both tool calls in parallel\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"TestCoderAgent/openrouter-kimi-k2/parallel_tool_calls-1\",\"function\":{\"arguments\":\"{\\\"pattern\\\":\\\"*.go\\\"}\",\"name\":\"glob\"},\"type\":\"function\"},{\"id\":\"TestCoderAgent/openrouter-kimi-k2/parallel_tool_calls-2\",\"function\":{\"arguments\":\"{\\\"path\\\":\\\".\\\"}\",\"name\":\"ls\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"/tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/parallel_tool_calls/main.go\",\"tool_call_id\":\"TestCoderAgent/openrouter-kimi-k2/parallel_tool_calls-1\",\"role\":\"tool\"},{\"content\":\"\\n- /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/parallel_tool_calls/\\n - go.mod\\n - main.go\\n\",\"tool_call_id\":\"TestCoderAgent/openrouter-kimi-k2/parallel_tool_calls-2\",\"role\":\"tool\"}],\"model\":\"moonshotai/kimi-k2-0905\",\"max_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"usage\":{\"include\":true},\"stream\":true}" headers: Accept: - application/json @@ -89,39 +65,45 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"gen-1759337012-WQRoSZgnOo5WppkmNen1","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337012,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338230-du8jCPo53ToFID4Q3S9p","provider":"Groq","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338230,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fp_6e6ff3688b"} - data: {"id":"gen-1759337012-WQRoSZgnOo5WppkmNen1","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337012,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"functions.glob:0","type":"function","function":{"name":"glob","arguments":""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338230-du8jCPo53ToFID4Q3S9p","provider":"Groq","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338230,"choices":[{"index":0,"delta":{"role":"assistant","content":"**"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fp_6e6ff3688b"} - data: {"id":"gen-1759337012-WQRoSZgnOo5WppkmNen1","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337012,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"{\""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338230-du8jCPo53ToFID4Q3S9p","provider":"Groq","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338230,"choices":[{"index":0,"delta":{"role":"assistant","content":"Current"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fp_6e6ff3688b"} - data: {"id":"gen-1759337012-WQRoSZgnOo5WppkmNen1","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337012,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"pattern"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338230-du8jCPo53ToFID4Q3S9p","provider":"Groq","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338230,"choices":[{"index":0,"delta":{"role":"assistant","content":" Directory"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fp_6e6ff3688b"} - data: {"id":"gen-1759337012-WQRoSZgnOo5WppkmNen1","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337012,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338230-du8jCPo53ToFID4Q3S9p","provider":"Groq","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338230,"choices":[{"index":0,"delta":{"role":"assistant","content":" Contents"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fp_6e6ff3688b"} - data: {"id":"gen-1759337012-WQRoSZgnOo5WppkmNen1","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337012,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":" \"**"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338230-du8jCPo53ToFID4Q3S9p","provider":"Groq","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338230,"choices":[{"index":0,"delta":{"role":"assistant","content":":**\n"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fp_6e6ff3688b"} - data: {"id":"gen-1759337012-WQRoSZgnOo5WppkmNen1","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337012,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"/*."}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338230-du8jCPo53ToFID4Q3S9p","provider":"Groq","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338230,"choices":[{"index":0,"delta":{"role":"assistant","content":"-"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fp_6e6ff3688b"} - data: {"id":"gen-1759337012-WQRoSZgnOo5WppkmNen1","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337012,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"go"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338230-du8jCPo53ToFID4Q3S9p","provider":"Groq","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338230,"choices":[{"index":0,"delta":{"role":"assistant","content":" main"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fp_6e6ff3688b"} - data: {"id":"gen-1759337012-WQRoSZgnOo5WppkmNen1","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337012,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"\"}"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338230-du8jCPo53ToFID4Q3S9p","provider":"Groq","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338230,"choices":[{"index":0,"delta":{"role":"assistant","content":".go"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fp_6e6ff3688b"} - data: {"id":"gen-1759337012-WQRoSZgnOo5WppkmNen1","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337012,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"id":"functions.ls:1","type":"function","function":{"name":"ls","arguments":""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338230-du8jCPo53ToFID4Q3S9p","provider":"Groq","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338230,"choices":[{"index":0,"delta":{"role":"assistant","content":" ("},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fp_6e6ff3688b"} - data: {"id":"gen-1759337012-WQRoSZgnOo5WppkmNen1","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337012,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"id":null,"type":"function","function":{"arguments":"{\""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338230-du8jCPo53ToFID4Q3S9p","provider":"Groq","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338230,"choices":[{"index":0,"delta":{"role":"assistant","content":"the"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fp_6e6ff3688b"} - data: {"id":"gen-1759337012-WQRoSZgnOo5WppkmNen1","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337012,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"id":null,"type":"function","function":{"arguments":"path"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338230-du8jCPo53ToFID4Q3S9p","provider":"Groq","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338230,"choices":[{"index":0,"delta":{"role":"assistant","content":" only"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fp_6e6ff3688b"} - data: {"id":"gen-1759337012-WQRoSZgnOo5WppkmNen1","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337012,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"id":null,"type":"function","function":{"arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338230-du8jCPo53ToFID4Q3S9p","provider":"Groq","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338230,"choices":[{"index":0,"delta":{"role":"assistant","content":" ."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fp_6e6ff3688b"} - data: {"id":"gen-1759337012-WQRoSZgnOo5WppkmNen1","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337012,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"id":null,"type":"function","function":{"arguments":" \".\""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338230-du8jCPo53ToFID4Q3S9p","provider":"Groq","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338230,"choices":[{"index":0,"delta":{"role":"assistant","content":"go"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fp_6e6ff3688b"} - data: {"id":"gen-1759337012-WQRoSZgnOo5WppkmNen1","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337012,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":1,"id":null,"type":"function","function":{"arguments":"}"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338230-du8jCPo53ToFID4Q3S9p","provider":"Groq","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338230,"choices":[{"index":0,"delta":{"role":"assistant","content":" file"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fp_6e6ff3688b"} - data: {"id":"gen-1759337012-WQRoSZgnOo5WppkmNen1","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337012,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"tool_calls","native_finish_reason":"tool_calls","logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338230-du8jCPo53ToFID4Q3S9p","provider":"Groq","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338230,"choices":[{"index":0,"delta":{"role":"assistant","content":")\n"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fp_6e6ff3688b"} - data: {"id":"gen-1759337012-WQRoSZgnOo5WppkmNen1","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337012,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":7311,"completion_tokens":29,"total_tokens":7340,"cost":0.0029824,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0029244,"upstream_inference_completions_cost":0.000058},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} + data: {"id":"gen-1759338230-du8jCPo53ToFID4Q3S9p","provider":"Groq","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338230,"choices":[{"index":0,"delta":{"role":"assistant","content":"-"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fp_6e6ff3688b"} + + data: {"id":"gen-1759338230-du8jCPo53ToFID4Q3S9p","provider":"Groq","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338230,"choices":[{"index":0,"delta":{"role":"assistant","content":" go"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fp_6e6ff3688b"} + + data: {"id":"gen-1759338230-du8jCPo53ToFID4Q3S9p","provider":"Groq","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338230,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}],"system_fingerprint":"fp_6e6ff3688b"} + + data: {"id":"gen-1759338230-du8jCPo53ToFID4Q3S9p","provider":"Groq","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338230,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":8269,"completion_tokens":18,"total_tokens":8287,"cost":0.004355,"is_byok":false,"prompt_tokens_details":{"cached_tokens":7936,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.004301,"upstream_inference_completions_cost":0.000054},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} data: [DONE] @@ -130,15 +112,15 @@ interactions: - text/event-stream status: 200 OK code: 200 - duration: 2.95196875s + duration: 570.674875ms - id: 2 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 31404 + content_length: 790 host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/parallel_tool_calls\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use glob to find all .go files and use ls to list the current directory, it is very important that you run both tool calls in parallel\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"TestCoderAgent/openrouter-kimi-k2/parallel_tool_calls-1\",\"function\":{\"arguments\":\"{\\\"pattern\\\": \\\"**/*.go\\\"}\",\"name\":\"glob\"},\"type\":\"function\"},{\"id\":\"TestCoderAgent/openrouter-kimi-k2/parallel_tool_calls-2\",\"function\":{\"arguments\":\"{\\\"path\\\": \\\".\\\"}\",\"name\":\"ls\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"/tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/parallel_tool_calls/main.go\",\"tool_call_id\":\"TestCoderAgent/openrouter-kimi-k2/parallel_tool_calls-1\",\"role\":\"tool\"},{\"content\":\"- /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/parallel_tool_calls/\\n - go.mod\\n - main.go\\n\",\"tool_call_id\":\"TestCoderAgent/openrouter-kimi-k2/parallel_tool_calls-2\",\"role\":\"tool\"}],\"model\":\"moonshotai/kimi-k2-0905\",\"max_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"usage\":{\"include\":true},\"stream\":true}" + body: '{"messages":[{"content":"you will generate a short title based on the first message a user begins a conversation with\n\n- ensure it is not more than 50 characters long\n- the title should be a summary of the user''s message\n- it should be one line long\n- do not use quotes or colons\n- the entire text you return will be used as the title\n- never return anything that is more than one sentence (one line) long\n","role":"system"},{"content":"Generate a concise title for the following content:\n\nuse glob to find all .go files and use ls to list the current directory, it is very important that you run both tool calls in parallel","role":"user"}],"model":"qwen/qwen3-next-80b-a3b-instruct","max_tokens":40,"stream_options":{"include_usage":true},"usage":{"include":true},"stream":true}' headers: Accept: - application/json @@ -154,55 +136,23 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"gen-1759337017-4SZUDt2eapXArWBtJuJi","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337017,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - - data: {"id":"gen-1759337017-4SZUDt2eapXArWBtJuJi","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337017,"choices":[{"index":0,"delta":{"role":"assistant","content":"Found"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - - data: {"id":"gen-1759337017-4SZUDt2eapXArWBtJuJi","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337017,"choices":[{"index":0,"delta":{"role":"assistant","content":" "},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - - data: {"id":"gen-1759337017-4SZUDt2eapXArWBtJuJi","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337017,"choices":[{"index":0,"delta":{"role":"assistant","content":"1"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - - data: {"id":"gen-1759337017-4SZUDt2eapXArWBtJuJi","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337017,"choices":[{"index":0,"delta":{"role":"assistant","content":" Go"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - - data: {"id":"gen-1759337017-4SZUDt2eapXArWBtJuJi","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337017,"choices":[{"index":0,"delta":{"role":"assistant","content":" file"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - - data: {"id":"gen-1759337017-4SZUDt2eapXArWBtJuJi","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337017,"choices":[{"index":0,"delta":{"role":"assistant","content":":"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - - data: {"id":"gen-1759337017-4SZUDt2eapXArWBtJuJi","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337017,"choices":[{"index":0,"delta":{"role":"assistant","content":" `"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - - data: {"id":"gen-1759337017-4SZUDt2eapXArWBtJuJi","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337017,"choices":[{"index":0,"delta":{"role":"assistant","content":"main"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - - data: {"id":"gen-1759337017-4SZUDt2eapXArWBtJuJi","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337017,"choices":[{"index":0,"delta":{"role":"assistant","content":".go"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - - data: {"id":"gen-1759337017-4SZUDt2eapXArWBtJuJi","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337017,"choices":[{"index":0,"delta":{"role":"assistant","content":"`."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - - data: {"id":"gen-1759337017-4SZUDt2eapXArWBtJuJi","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337017,"choices":[{"index":0,"delta":{"role":"assistant","content":" Current"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - - data: {"id":"gen-1759337017-4SZUDt2eapXArWBtJuJi","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337017,"choices":[{"index":0,"delta":{"role":"assistant","content":" directory"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - - data: {"id":"gen-1759337017-4SZUDt2eapXArWBtJuJi","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337017,"choices":[{"index":0,"delta":{"role":"assistant","content":" contains"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - - data: {"id":"gen-1759337017-4SZUDt2eapXArWBtJuJi","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337017,"choices":[{"index":0,"delta":{"role":"assistant","content":" `"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - - data: {"id":"gen-1759337017-4SZUDt2eapXArWBtJuJi","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337017,"choices":[{"index":0,"delta":{"role":"assistant","content":"go"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - - data: {"id":"gen-1759337017-4SZUDt2eapXArWBtJuJi","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337017,"choices":[{"index":0,"delta":{"role":"assistant","content":".mod"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338229-9YEqOvDKGzEnpFmxh78C","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338234,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337017-4SZUDt2eapXArWBtJuJi","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337017,"choices":[{"index":0,"delta":{"role":"assistant","content":"`"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338229-9YEqOvDKGzEnpFmxh78C","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338234,"choices":[{"index":0,"delta":{"role":"assistant","content":"Run"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337017-4SZUDt2eapXArWBtJuJi","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337017,"choices":[{"index":0,"delta":{"role":"assistant","content":" and"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338229-9YEqOvDKGzEnpFmxh78C","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338234,"choices":[{"index":0,"delta":{"role":"assistant","content":" glob"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337017-4SZUDt2eapXArWBtJuJi","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337017,"choices":[{"index":0,"delta":{"role":"assistant","content":" `"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338229-9YEqOvDKGzEnpFmxh78C","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338234,"choices":[{"index":0,"delta":{"role":"assistant","content":" and ls in"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337017-4SZUDt2eapXArWBtJuJi","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337017,"choices":[{"index":0,"delta":{"role":"assistant","content":"main"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338229-9YEqOvDKGzEnpFmxh78C","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338234,"choices":[{"index":0,"delta":{"role":"assistant","content":" parallel to"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337017-4SZUDt2eapXArWBtJuJi","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337017,"choices":[{"index":0,"delta":{"role":"assistant","content":".go"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338229-9YEqOvDKGzEnpFmxh78C","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338234,"choices":[{"index":0,"delta":{"role":"assistant","content":" find .go files"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337017-4SZUDt2eapXArWBtJuJi","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337017,"choices":[{"index":0,"delta":{"role":"assistant","content":"`."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338229-9YEqOvDKGzEnpFmxh78C","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338234,"choices":[{"index":0,"delta":{"role":"assistant","content":" and list directory"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337017-4SZUDt2eapXArWBtJuJi","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337017,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]} + data: {"id":"gen-1759338229-9YEqOvDKGzEnpFmxh78C","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338234,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]} - data: {"id":"gen-1759337017-4SZUDt2eapXArWBtJuJi","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337017,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":7365,"completion_tokens":23,"total_tokens":7388,"cost":0.00299775,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.002946,"upstream_inference_completions_cost":0.00005175},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} + data: {"id":"gen-1759338229-9YEqOvDKGzEnpFmxh78C","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338234,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":141,"completion_tokens":15,"total_tokens":156,"cost":0.00003915,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.00002115,"upstream_inference_completions_cost":0.000018},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} data: [DONE] @@ -211,4 +161,4 @@ interactions: - text/event-stream status: 200 OK code: 200 - duration: 1.592948875s + duration: 5.772867125s diff --git a/internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/read_a_file.yaml b/internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/read_a_file.yaml index 32ed51e55936cde237db8639e64c2bba0f64ccf4..212f6cd02d29640020646020198970637ffe915a 100644 --- a/internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/read_a_file.yaml +++ b/internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/read_a_file.yaml @@ -6,9 +6,9 @@ interactions: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 671 + content_length: 30643 host: "" - body: '{"messages":[{"content":"you will generate a short title based on the first message a user begins a conversation with\n\n- ensure it is not more than 50 characters long\n- the title should be a summary of the user''s message\n- it should be one line long\n- do not use quotes or colons\n- the entire text you return will be used as the title\n- never return anything that is more than one sentence (one line) long\n","role":"system"},{"content":"Generate a concise title for the following content:\n\nRead the go mod","role":"user"}],"model":"qwen/qwen3-next-80b-a3b-instruct","max_tokens":40,"stream_options":{"include_usage":true},"usage":{"include":true},"stream":true}' + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/read_a_file\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"Read the go mod\",\"role\":\"user\"}],\"model\":\"moonshotai/kimi-k2-0905\",\"max_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"usage\":{\"include\":true},\"stream\":true}" headers: Accept: - application/json @@ -24,15 +24,27 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"gen-1759336934-3bxQpm90QtxySI3kHEfs","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336934,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338145-aqtdrYcdFiy1rQ7pjvAr","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338145,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759338145-aqtdrYcdFiy1rQ7pjvAr","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338145,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":"functions.view:0","index":0,"type":"function","function":{"name":"view","arguments":""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759338145-aqtdrYcdFiy1rQ7pjvAr","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338145,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"{\"file"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759338145-aqtdrYcdFiy1rQ7pjvAr","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338145,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"_path"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336934-3bxQpm90QtxySI3kHEfs","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336934,"choices":[{"index":0,"delta":{"role":"assistant","content":"Read"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338145-aqtdrYcdFiy1rQ7pjvAr","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338145,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336934-3bxQpm90QtxySI3kHEfs","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336934,"choices":[{"index":0,"delta":{"role":"assistant","content":" the go mod"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338145-aqtdrYcdFiy1rQ7pjvAr","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338145,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":" \""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336934-3bxQpm90QtxySI3kHEfs","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336934,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]} + data: {"id":"gen-1759338145-aqtdrYcdFiy1rQ7pjvAr","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338145,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"go"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336934-3bxQpm90QtxySI3kHEfs","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336934,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":116,"completion_tokens":5,"total_tokens":121,"cost":0.0000234,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0000174,"upstream_inference_completions_cost":0.000006},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} + data: {"id":"gen-1759338145-aqtdrYcdFiy1rQ7pjvAr","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338145,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":".mod"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759338145-aqtdrYcdFiy1rQ7pjvAr","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338145,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"\"}"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759338145-aqtdrYcdFiy1rQ7pjvAr","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338145,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"tool_calls","native_finish_reason":"tool_calls","logprobs":null}]} + + data: {"id":"gen-1759338145-aqtdrYcdFiy1rQ7pjvAr","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338145,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":7204,"completion_tokens":18,"total_tokens":7222,"cost":0.007258,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.007204,"upstream_inference_completions_cost":0.000054},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} data: [DONE] @@ -41,15 +53,15 @@ interactions: - text/event-stream status: 200 OK code: 200 - duration: 652.212166ms + duration: 1.487321625s - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 30570 + content_length: 671 host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/read_a_file\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"Read the go mod\",\"role\":\"user\"}],\"model\":\"moonshotai/kimi-k2-0905\",\"max_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"usage\":{\"include\":true},\"stream\":true}" + body: '{"messages":[{"content":"you will generate a short title based on the first message a user begins a conversation with\n\n- ensure it is not more than 50 characters long\n- the title should be a summary of the user''s message\n- it should be one line long\n- do not use quotes or colons\n- the entire text you return will be used as the title\n- never return anything that is more than one sentence (one line) long\n","role":"system"},{"content":"Generate a concise title for the following content:\n\nRead the go mod","role":"user"}],"model":"qwen/qwen3-next-80b-a3b-instruct","max_tokens":40,"stream_options":{"include_usage":true},"usage":{"include":true},"stream":true}' headers: Accept: - application/json @@ -65,61 +77,19 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"gen-1759336934-ic786FUBH0bDztbpCu60","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336934,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759336934-ic786FUBH0bDztbpCu60","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336934,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"view:0","type":"function","function":{"name":"view"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759336934-ic786FUBH0bDztbpCu60","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336934,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"{\""},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759336934-ic786FUBH0bDztbpCu60","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336934,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"file"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759336934-ic786FUBH0bDztbpCu60","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336934,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"_path"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759336934-ic786FUBH0bDztbpCu60","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336934,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"\":"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759336934-ic786FUBH0bDztbpCu60","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336934,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":" \"/"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759336934-ic786FUBH0bDztbpCu60","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336934,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"tmp"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338145-prQp7F4x2pTz4cfwadL2","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338145,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336934-ic786FUBH0bDztbpCu60","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336934,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"/c"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338145-prQp7F4x2pTz4cfwadL2","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338145,"choices":[{"index":0,"delta":{"role":"assistant","content":"Read"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336934-ic786FUBH0bDztbpCu60","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336934,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"rush"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338145-prQp7F4x2pTz4cfwadL2","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338145,"choices":[{"index":0,"delta":{"role":"assistant","content":" the"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336934-ic786FUBH0bDztbpCu60","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336934,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"-test"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338145-prQp7F4x2pTz4cfwadL2","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338145,"choices":[{"index":0,"delta":{"role":"assistant","content":" go"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336934-ic786FUBH0bDztbpCu60","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336934,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"/Test"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338145-prQp7F4x2pTz4cfwadL2","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338145,"choices":[{"index":0,"delta":{"role":"assistant","content":" mod"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336934-ic786FUBH0bDztbpCu60","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336934,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"Coder"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} + data: {"id":"gen-1759338145-prQp7F4x2pTz4cfwadL2","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338145,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]} - data: {"id":"gen-1759336934-ic786FUBH0bDztbpCu60","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336934,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"Agent"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759336934-ic786FUBH0bDztbpCu60","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336934,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"/open"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759336934-ic786FUBH0bDztbpCu60","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336934,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"router"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759336934-ic786FUBH0bDztbpCu60","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336934,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"-k"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759336934-ic786FUBH0bDztbpCu60","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336934,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"imi"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759336934-ic786FUBH0bDztbpCu60","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336934,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"-k"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759336934-ic786FUBH0bDztbpCu60","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336934,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"2"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759336934-ic786FUBH0bDztbpCu60","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336934,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"/read"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759336934-ic786FUBH0bDztbpCu60","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336934,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"_a"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759336934-ic786FUBH0bDztbpCu60","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336934,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"_file"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759336934-ic786FUBH0bDztbpCu60","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336934,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"/go"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759336934-ic786FUBH0bDztbpCu60","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336934,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":".mod"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759336934-ic786FUBH0bDztbpCu60","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336934,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"\"}"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759336934-ic786FUBH0bDztbpCu60","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336934,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"tool_calls","native_finish_reason":"tool_calls","logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - - data: {"id":"gen-1759336934-ic786FUBH0bDztbpCu60","provider":"Novita","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336934,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":7555,"completion_tokens":33,"total_tokens":7588,"cost":0.0046155,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.004533,"upstream_inference_completions_cost":0.0000825},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} + data: {"id":"gen-1759338145-prQp7F4x2pTz4cfwadL2","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338145,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":116,"completion_tokens":5,"total_tokens":121,"cost":0.0000156,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0000116,"upstream_inference_completions_cost":0.000004},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} data: [DONE] @@ -128,15 +98,15 @@ interactions: - text/event-stream status: 200 OK code: 200 - duration: 4.472042084s + duration: 1.806046625s - id: 2 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 30987 + content_length: 30998 host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/read_a_file\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"Read the go mod\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"TestCoderAgent/openrouter-kimi-k2/read_a_file-1\",\"function\":{\"arguments\":\"{\\\"file_path\\\": \\\"/tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/read_a_file/go.mod\\\"}\",\"name\":\"view\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"\\n 1|module example.com/testproject\\n 2|\\n 3|go 1.23\\n\\n\",\"tool_call_id\":\"TestCoderAgent/openrouter-kimi-k2/read_a_file-1\",\"role\":\"tool\"}],\"model\":\"moonshotai/kimi-k2-0905\",\"max_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"usage\":{\"include\":true},\"stream\":true}" + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/read_a_file\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"Read the go mod\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"TestCoderAgent/openrouter-kimi-k2/read_a_file-1\",\"function\":{\"arguments\":\"{\\\"file_path\\\": \\\"go.mod\\\"}\",\"name\":\"view\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"\\n 1|module example.com/testproject\\n 2|\\n 3|go 1.23\\n\\n\",\"tool_call_id\":\"TestCoderAgent/openrouter-kimi-k2/read_a_file-1\",\"role\":\"tool\"}],\"model\":\"moonshotai/kimi-k2-0905\",\"max_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"usage\":{\"include\":true},\"stream\":true}" headers: Accept: - application/json @@ -152,37 +122,43 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"gen-1759336940-yd2xgB5WwGamhDXQcwxx","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336940,"choices":[{"index":0,"delta":{"role":"assistant","content":"```\n"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null} + data: {"id":"gen-1759338147-UGmrx0BnXcgPwfSXZf9h","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338147,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759338147-UGmrx0BnXcgPwfSXZf9h","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338147,"choices":[{"index":0,"delta":{"role":"assistant","content":"Module"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759338147-UGmrx0BnXcgPwfSXZf9h","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338147,"choices":[{"index":0,"delta":{"role":"assistant","content":":"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759338147-UGmrx0BnXcgPwfSXZf9h","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338147,"choices":[{"index":0,"delta":{"role":"assistant","content":" `"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336940-yd2xgB5WwGamhDXQcwxx","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336940,"choices":[{"index":0,"delta":{"role":"assistant","content":"module"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null} + data: {"id":"gen-1759338147-UGmrx0BnXcgPwfSXZf9h","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338147,"choices":[{"index":0,"delta":{"role":"assistant","content":"example"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336940-yd2xgB5WwGamhDXQcwxx","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336940,"choices":[{"index":0,"delta":{"role":"assistant","content":" example"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null} + data: {"id":"gen-1759338147-UGmrx0BnXcgPwfSXZf9h","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338147,"choices":[{"index":0,"delta":{"role":"assistant","content":".com"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336940-yd2xgB5WwGamhDXQcwxx","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336940,"choices":[{"index":0,"delta":{"role":"assistant","content":".com"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null} + data: {"id":"gen-1759338147-UGmrx0BnXcgPwfSXZf9h","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338147,"choices":[{"index":0,"delta":{"role":"assistant","content":"/test"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336940-yd2xgB5WwGamhDXQcwxx","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336940,"choices":[{"index":0,"delta":{"role":"assistant","content":"/test"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null} + data: {"id":"gen-1759338147-UGmrx0BnXcgPwfSXZf9h","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338147,"choices":[{"index":0,"delta":{"role":"assistant","content":"project"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336940-yd2xgB5WwGamhDXQcwxx","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336940,"choices":[{"index":0,"delta":{"role":"assistant","content":"project"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null} + data: {"id":"gen-1759338147-UGmrx0BnXcgPwfSXZf9h","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338147,"choices":[{"index":0,"delta":{"role":"assistant","content":"`\n\n"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336940-yd2xgB5WwGamhDXQcwxx","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336940,"choices":[{"index":0,"delta":{"role":"assistant","content":"\n\n"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null} + data: {"id":"gen-1759338147-UGmrx0BnXcgPwfSXZf9h","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338147,"choices":[{"index":0,"delta":{"role":"assistant","content":"Go"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336940-yd2xgB5WwGamhDXQcwxx","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336940,"choices":[{"index":0,"delta":{"role":"assistant","content":"go"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null} + data: {"id":"gen-1759338147-UGmrx0BnXcgPwfSXZf9h","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338147,"choices":[{"index":0,"delta":{"role":"assistant","content":" version"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336940-yd2xgB5WwGamhDXQcwxx","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336940,"choices":[{"index":0,"delta":{"role":"assistant","content":" "},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null} + data: {"id":"gen-1759338147-UGmrx0BnXcgPwfSXZf9h","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338147,"choices":[{"index":0,"delta":{"role":"assistant","content":":"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336940-yd2xgB5WwGamhDXQcwxx","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336940,"choices":[{"index":0,"delta":{"role":"assistant","content":"1"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null} + data: {"id":"gen-1759338147-UGmrx0BnXcgPwfSXZf9h","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338147,"choices":[{"index":0,"delta":{"role":"assistant","content":" `"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336940-yd2xgB5WwGamhDXQcwxx","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336940,"choices":[{"index":0,"delta":{"role":"assistant","content":"."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null} + data: {"id":"gen-1759338147-UGmrx0BnXcgPwfSXZf9h","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338147,"choices":[{"index":0,"delta":{"role":"assistant","content":"1"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336940-yd2xgB5WwGamhDXQcwxx","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336940,"choices":[{"index":0,"delta":{"role":"assistant","content":"23"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null} + data: {"id":"gen-1759338147-UGmrx0BnXcgPwfSXZf9h","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338147,"choices":[{"index":0,"delta":{"role":"assistant","content":"."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336940-yd2xgB5WwGamhDXQcwxx","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336940,"choices":[{"index":0,"delta":{"role":"assistant","content":"\n"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null} + data: {"id":"gen-1759338147-UGmrx0BnXcgPwfSXZf9h","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338147,"choices":[{"index":0,"delta":{"role":"assistant","content":"23"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336940-yd2xgB5WwGamhDXQcwxx","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336940,"choices":[{"index":0,"delta":{"role":"assistant","content":"```"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null} + data: {"id":"gen-1759338147-UGmrx0BnXcgPwfSXZf9h","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338147,"choices":[{"index":0,"delta":{"role":"assistant","content":"`"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336940-yd2xgB5WwGamhDXQcwxx","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336940,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}],"system_fingerprint":null} + data: {"id":"gen-1759338147-UGmrx0BnXcgPwfSXZf9h","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338147,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]} - data: {"id":"gen-1759336940-yd2xgB5WwGamhDXQcwxx","provider":"BaseTen","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336940,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":7385,"completion_tokens":15,"total_tokens":7400,"cost":0.0044685,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.004431,"upstream_inference_completions_cost":0.0000375},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} + data: {"id":"gen-1759338147-UGmrx0BnXcgPwfSXZf9h","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338147,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":7289,"completion_tokens":17,"total_tokens":7306,"cost":0.00295385,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0029156,"upstream_inference_completions_cost":0.00003825},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} data: [DONE] @@ -191,4 +167,4 @@ interactions: - text/event-stream status: 200 OK code: 200 - duration: 1.333794s + duration: 1.546958417s diff --git a/internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/simple_test.yaml b/internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/simple_test.yaml index 466fc8ad9267c92ef44a6730c5cfc7b8c8b03088..3542f822e652a522f4d6fdb732a77c38053a4a5f 100644 --- a/internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/simple_test.yaml +++ b/internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/simple_test.yaml @@ -6,9 +6,9 @@ interactions: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 661 + content_length: 30633 host: "" - body: '{"messages":[{"content":"you will generate a short title based on the first message a user begins a conversation with\n\n- ensure it is not more than 50 characters long\n- the title should be a summary of the user''s message\n- it should be one line long\n- do not use quotes or colons\n- the entire text you return will be used as the title\n- never return anything that is more than one sentence (one line) long\n","role":"system"},{"content":"Generate a concise title for the following content:\n\nHello","role":"user"}],"model":"qwen/qwen3-next-80b-a3b-instruct","max_tokens":40,"stream_options":{"include_usage":true},"usage":{"include":true},"stream":true}' + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/simple_test\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"Hello\",\"role\":\"user\"}],\"model\":\"moonshotai/kimi-k2-0905\",\"max_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"usage\":{\"include\":true},\"stream\":true}" headers: Accept: - application/json @@ -24,13 +24,15 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"gen-1759336932-dIqfRGQmzqpG1nhKbwg6","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336932,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338138-3jIFXxBlVBuBwxWZBObE","provider":"Groq","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338138,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fp_6e6ff3688b"} + + data: {"id":"gen-1759338138-3jIFXxBlVBuBwxWZBObE","provider":"Groq","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338138,"choices":[{"index":0,"delta":{"role":"assistant","content":"Hey"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fp_6e6ff3688b"} - data: {"id":"gen-1759336932-dIqfRGQmzqpG1nhKbwg6","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336932,"choices":[{"index":0,"delta":{"role":"assistant","content":"Hello"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338138-3jIFXxBlVBuBwxWZBObE","provider":"Groq","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338138,"choices":[{"index":0,"delta":{"role":"assistant","content":"!"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fp_6e6ff3688b"} - data: {"id":"gen-1759336932-dIqfRGQmzqpG1nhKbwg6","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336932,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]} + data: {"id":"gen-1759338138-3jIFXxBlVBuBwxWZBObE","provider":"Groq","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338138,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}],"system_fingerprint":"fp_6e6ff3688b"} - data: {"id":"gen-1759336932-dIqfRGQmzqpG1nhKbwg6","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336932,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":113,"completion_tokens":2,"total_tokens":115,"cost":0.00001802,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.00001582,"upstream_inference_completions_cost":0.0000022},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} + data: {"id":"gen-1759338138-3jIFXxBlVBuBwxWZBObE","provider":"Groq","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338138,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":8131,"completion_tokens":3,"total_tokens":8134,"cost":0.00814,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.008131,"upstream_inference_completions_cost":0.000009},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} data: [DONE] @@ -39,15 +41,15 @@ interactions: - text/event-stream status: 200 OK code: 200 - duration: 1.426041458s + duration: 1.810772041s - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 30560 + content_length: 661 host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/simple_test\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"Hello\",\"role\":\"user\"}],\"model\":\"moonshotai/kimi-k2-0905\",\"max_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"usage\":{\"include\":true},\"stream\":true}" + body: '{"messages":[{"content":"you will generate a short title based on the first message a user begins a conversation with\n\n- ensure it is not more than 50 characters long\n- the title should be a summary of the user''s message\n- it should be one line long\n- do not use quotes or colons\n- the entire text you return will be used as the title\n- never return anything that is more than one sentence (one line) long\n","role":"system"},{"content":"Generate a concise title for the following content:\n\nHello","role":"user"}],"model":"qwen/qwen3-next-80b-a3b-instruct","max_tokens":40,"stream_options":{"include_usage":true},"usage":{"include":true},"stream":true}' headers: Accept: - application/json @@ -63,13 +65,13 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"gen-1759336932-n0Sa3LY1MI3TOUHas2yG","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336932,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338138-OiyBm3GlX8Q8HSw1AjAt","provider":"GMICloud","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338143,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336932-n0Sa3LY1MI3TOUHas2yG","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336932,"choices":[{"index":0,"delta":{"role":"assistant","content":"Hey!"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338138-OiyBm3GlX8Q8HSw1AjAt","provider":"GMICloud","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338143,"choices":[{"index":0,"delta":{"role":"assistant","content":"Hello"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336932-n0Sa3LY1MI3TOUHas2yG","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336932,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]} + data: {"id":"gen-1759338138-OiyBm3GlX8Q8HSw1AjAt","provider":"GMICloud","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338143,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]} - data: {"id":"gen-1759336932-n0Sa3LY1MI3TOUHas2yG","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336932,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":7284,"completion_tokens":3,"total_tokens":7287,"cost":0.0043779,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0043704,"upstream_inference_completions_cost":0.0000075},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} + data: {"id":"gen-1759338138-OiyBm3GlX8Q8HSw1AjAt","provider":"GMICloud","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338143,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":113,"completion_tokens":2,"total_tokens":115,"cost":0.00001995,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.00001695,"upstream_inference_completions_cost":0.000003},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} data: [DONE] @@ -78,4 +80,4 @@ interactions: - text/event-stream status: 200 OK code: 200 - duration: 2.273147375s + duration: 7.026044583s diff --git a/internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/sourcegraph_tool.yaml b/internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/sourcegraph_tool.yaml index daef24309d99d6cb97e07e561457c60d48075122..8f47c7e9fb3322e8297f74422aff04df1b66fa61 100644 --- a/internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/sourcegraph_tool.yaml +++ b/internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/sourcegraph_tool.yaml @@ -24,31 +24,31 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"gen-1759336997-uww1aUTfxfOdHoq0R1KN","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336997,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338211-LicY2wSfLozNiTvKbilm","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338211,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336997-uww1aUTfxfOdHoq0R1KN","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336997,"choices":[{"index":0,"delta":{"role":"assistant","content":"Search"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338211-LicY2wSfLozNiTvKbilm","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338211,"choices":[{"index":0,"delta":{"role":"assistant","content":"Search"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336997-uww1aUTfxfOdHoq0R1KN","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336997,"choices":[{"index":0,"delta":{"role":"assistant","content":" for"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338211-LicY2wSfLozNiTvKbilm","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338211,"choices":[{"index":0,"delta":{"role":"assistant","content":" for"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336997-uww1aUTfxfOdHoq0R1KN","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336997,"choices":[{"index":0,"delta":{"role":"assistant","content":" func"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338211-LicY2wSfLozNiTvKbilm","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338211,"choices":[{"index":0,"delta":{"role":"assistant","content":" func"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336997-uww1aUTfxfOdHoq0R1KN","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336997,"choices":[{"index":0,"delta":{"role":"assistant","content":" main"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338211-LicY2wSfLozNiTvKbilm","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338211,"choices":[{"index":0,"delta":{"role":"assistant","content":" main"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336997-uww1aUTfxfOdHoq0R1KN","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336997,"choices":[{"index":0,"delta":{"role":"assistant","content":" in"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338211-LicY2wSfLozNiTvKbilm","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338211,"choices":[{"index":0,"delta":{"role":"assistant","content":" in"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336997-uww1aUTfxfOdHoq0R1KN","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336997,"choices":[{"index":0,"delta":{"role":"assistant","content":" Go"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338211-LicY2wSfLozNiTvKbilm","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338211,"choices":[{"index":0,"delta":{"role":"assistant","content":" Go"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336997-uww1aUTfxfOdHoq0R1KN","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336997,"choices":[{"index":0,"delta":{"role":"assistant","content":" repositories"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338211-LicY2wSfLozNiTvKbilm","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338211,"choices":[{"index":0,"delta":{"role":"assistant","content":" repositories"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336997-uww1aUTfxfOdHoq0R1KN","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336997,"choices":[{"index":0,"delta":{"role":"assistant","content":" using"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338211-LicY2wSfLozNiTvKbilm","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338211,"choices":[{"index":0,"delta":{"role":"assistant","content":" using"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336997-uww1aUTfxfOdHoq0R1KN","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336997,"choices":[{"index":0,"delta":{"role":"assistant","content":" Source"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338211-LicY2wSfLozNiTvKbilm","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338211,"choices":[{"index":0,"delta":{"role":"assistant","content":" Source"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336997-uww1aUTfxfOdHoq0R1KN","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336997,"choices":[{"index":0,"delta":{"role":"assistant","content":"graph"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338211-LicY2wSfLozNiTvKbilm","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338211,"choices":[{"index":0,"delta":{"role":"assistant","content":"graph"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759336997-uww1aUTfxfOdHoq0R1KN","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336997,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]} + data: {"id":"gen-1759338211-LicY2wSfLozNiTvKbilm","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338211,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]} - data: {"id":"gen-1759336997-uww1aUTfxfOdHoq0R1KN","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336997,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":125,"completion_tokens":11,"total_tokens":136,"cost":0.0000213,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0000125,"upstream_inference_completions_cost":0.0000088},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} + data: {"id":"gen-1759338211-LicY2wSfLozNiTvKbilm","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338211,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":125,"completion_tokens":11,"total_tokens":136,"cost":0.0000213,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0000125,"upstream_inference_completions_cost":0.0000088},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} data: [DONE] @@ -57,15 +57,15 @@ interactions: - text/event-stream status: 200 OK code: 200 - duration: 1.22929525s + duration: 1.445218375s - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 30620 + content_length: 30693 host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/sourcegraph_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use sourcegraph to search for 'func main' in Go repositories\",\"role\":\"user\"}],\"model\":\"moonshotai/kimi-k2-0905\",\"max_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"usage\":{\"include\":true},\"stream\":true}" + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/sourcegraph_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use sourcegraph to search for 'func main' in Go repositories\",\"role\":\"user\"}],\"model\":\"moonshotai/kimi-k2-0905\",\"max_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"usage\":{\"include\":true},\"stream\":true}" headers: Accept: - application/json @@ -81,43 +81,106 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"gen-1759336997-CJkXw0BRKZIotWevqxWG","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336997,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338211-Wl3UoEVNhozAIjL2YXi0","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338211,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - data: {"id":"gen-1759336997-CJkXw0BRKZIotWevqxWG","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336997,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":"functions.sourcegraph:0","index":0,"type":"function","function":{"name":"sourcegraph","arguments":""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338211-Wl3UoEVNhozAIjL2YXi0","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338211,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"functions.sourcegraph:0","type":"function","function":{"name":"sourcegraph","arguments":""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - data: {"id":"gen-1759336997-CJkXw0BRKZIotWevqxWG","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336997,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"{\"query"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338211-Wl3UoEVNhozAIjL2YXi0","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338211,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"{\""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - data: {"id":"gen-1759336997-CJkXw0BRKZIotWevqxWG","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336997,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338211-Wl3UoEVNhozAIjL2YXi0","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338211,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"query"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - data: {"id":"gen-1759336997-CJkXw0BRKZIotWevqxWG","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336997,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":" \""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338211-Wl3UoEVNhozAIjL2YXi0","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338211,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - data: {"id":"gen-1759336997-CJkXw0BRKZIotWevqxWG","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336997,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"func"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338211-Wl3UoEVNhozAIjL2YXi0","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338211,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":" \""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - data: {"id":"gen-1759336997-CJkXw0BRKZIotWevqxWG","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336997,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":" main"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338211-Wl3UoEVNhozAIjL2YXi0","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338211,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"func"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - data: {"id":"gen-1759336997-CJkXw0BRKZIotWevqxWG","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336997,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":" lang"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338211-Wl3UoEVNhozAIjL2YXi0","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338211,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":" main"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - data: {"id":"gen-1759336997-CJkXw0BRKZIotWevqxWG","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336997,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338211-Wl3UoEVNhozAIjL2YXi0","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338211,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"\","}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - data: {"id":"gen-1759336997-CJkXw0BRKZIotWevqxWG","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336997,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"go"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338211-Wl3UoEVNhozAIjL2YXi0","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338211,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":" \""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - data: {"id":"gen-1759336997-CJkXw0BRKZIotWevqxWG","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336997,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"\","}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338211-Wl3UoEVNhozAIjL2YXi0","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338211,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"count"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - data: {"id":"gen-1759336997-CJkXw0BRKZIotWevqxWG","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336997,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":" \""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338211-Wl3UoEVNhozAIjL2YXi0","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338211,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - data: {"id":"gen-1759336997-CJkXw0BRKZIotWevqxWG","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336997,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"count"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338211-Wl3UoEVNhozAIjL2YXi0","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338211,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":" "}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - data: {"id":"gen-1759336997-CJkXw0BRKZIotWevqxWG","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336997,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338211-Wl3UoEVNhozAIjL2YXi0","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338211,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"10"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - data: {"id":"gen-1759336997-CJkXw0BRKZIotWevqxWG","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336997,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":" "}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338211-Wl3UoEVNhozAIjL2YXi0","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338211,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"}"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - data: {"id":"gen-1759336997-CJkXw0BRKZIotWevqxWG","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336997,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"10"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338211-Wl3UoEVNhozAIjL2YXi0","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338211,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"tool_calls","native_finish_reason":"tool_calls","logprobs":null}],"system_fingerprint":""} - data: {"id":"gen-1759336997-CJkXw0BRKZIotWevqxWG","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336997,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"}"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338211-Wl3UoEVNhozAIjL2YXi0","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338211,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":7313,"completion_tokens":23,"total_tokens":7336,"cost":0.0029712,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0029252,"upstream_inference_completions_cost":0.000046},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} - data: {"id":"gen-1759336997-CJkXw0BRKZIotWevqxWG","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336997,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"tool_calls","native_finish_reason":"tool_calls","logprobs":null}]} + data: [DONE] - data: {"id":"gen-1759336997-CJkXw0BRKZIotWevqxWG","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336997,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":7194,"completion_tokens":27,"total_tokens":7221,"cost":0.007275,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.007194,"upstream_inference_completions_cost":0.000081},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} + headers: + Content-Type: + - text/event-stream + status: 200 OK + code: 200 + duration: 3.770061s +- id: 2 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 416 + host: sourcegraph.com + body: '{"query":"query Search($query: String!) { search(query: $query, version: V2, patternType: keyword ) { results { matchCount, limitHit, resultCount, approximateResultCount, missing { name }, timedout { name }, indexUnavailable, results { __typename, ... on FileMatch { repository { name }, file { path, url, content }, lineMatches { preview, lineNumber, offsetAndLengths } } } } } }","variables":{"query":"func main"}}' + headers: + Content-Type: + - application/json + User-Agent: + - crush/1.0 + url: https://sourcegraph.com/.api/graphql + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + uncompressed: true + body: '{"data":{"search":{"results":{"matchCount":30,"limitHit":true,"resultCount":30,"approximateResultCount":"30+","missing":[],"timedout":[],"indexUnavailable":false,"results":[{"__typename":"Repository"},{"__typename":"Repository"},{"__typename":"Repository"},{"__typename":"FileMatch","repository":{"name":"github.com/swiftlang/swift"},"file":{"path":"test/Concurrency/attr_discardableResult_async_await.swift","url":"/github.com/swiftlang/swift/-/blob/test/Concurrency/attr_discardableResult_async_await.swift","content":"// RUN: %target-swift-frontend -target %target-swift-5.1-abi-triple %s -emit-sil -o /dev/null -verify\n// RUN: %target-swift-frontend -target %target-swift-5.1-abi-triple %s -emit-sil -o /dev/null -verify -strict-concurrency=targeted\n// RUN: %target-swift-frontend -target %target-swift-5.1-abi-triple %s -emit-sil -o /dev/null -verify -strict-concurrency=complete\n\n// REQUIRES: concurrency\n\n// https://github.com/apple/swift/issues/60276\n\n@discardableResult @MainActor\nfunc mainActorAsyncDiscardable() async -\u003e Int { 0 }\n\nfunc consumesMainActorAsyncDiscardable() async {\n await mainActorAsyncDiscardable() // ok\n}\n\n// https://github.com/swiftlang/swift/issues/83463\n\n@MainActor\n@discardableResult\nfunc returnsDiscardableFunc() -\u003e () -\u003e Void { return {} }\n\n@MainActor\nfunc testDiscardsSyncFuncWithImplicitSendableConversion() {\n returnsDiscardableFunc()\n}\n\n@MainActor\n@discardableResult\nfunc mainActorAsyncReturnsDiscardableFunc() async -\u003e () -\u003e Void { return {} }\n\n@MainActor\nfunc discardsAsyncFuncWithImplicitSendableConversion() async {\n await mainActorAsyncReturnsDiscardableFunc()\n}\n"},"lineMatches":[{"preview":"@MainActor","lineNumber":26,"offsetAndLengths":[[1,4]]},{"preview":"func mainActorAsyncReturnsDiscardableFunc() async -\u003e () -\u003e Void { return {} }","lineNumber":28,"offsetAndLengths":[[0,9],[37,4]]},{"preview":"@MainActor","lineNumber":30,"offsetAndLengths":[[1,4]]},{"preview":"func discardsAsyncFuncWithImplicitSendableConversion() async {","lineNumber":31,"offsetAndLengths":[[0,4],[18,4]]},{"preview":" await mainActorAsyncReturnsDiscardableFunc()","lineNumber":32,"offsetAndLengths":[[8,4],[40,4]]},{"preview":"@discardableResult @MainActor","lineNumber":8,"offsetAndLengths":[[20,4]]},{"preview":"func mainActorAsyncDiscardable() async -\u003e Int { 0 }","lineNumber":9,"offsetAndLengths":[[0,9]]},{"preview":"func consumesMainActorAsyncDiscardable() async {","lineNumber":11,"offsetAndLengths":[[0,4],[13,4]]},{"preview":" await mainActorAsyncDiscardable() // ok","lineNumber":12,"offsetAndLengths":[[8,4]]},{"preview":"@MainActor","lineNumber":17,"offsetAndLengths":[[1,4]]},{"preview":"func returnsDiscardableFunc() -\u003e () -\u003e Void { return {} }","lineNumber":19,"offsetAndLengths":[[0,4],[23,4]]},{"preview":"@MainActor","lineNumber":21,"offsetAndLengths":[[1,4]]},{"preview":"func testDiscardsSyncFuncWithImplicitSendableConversion() {","lineNumber":22,"offsetAndLengths":[[0,4],[21,4]]},{"preview":" returnsDiscardableFunc()","lineNumber":23,"offsetAndLengths":[[22,4]]}]},{"__typename":"FileMatch","repository":{"name":"github.com/swiftlang/swift"},"file":{"path":"test/embedded/linkage-mergeable4.swift","url":"/github.com/swiftlang/swift/-/blob/test/embedded/linkage-mergeable4.swift","content":"// RUN: %empty-directory(%t)\n// RUN: %{python} %utils/split_file.py -o %t %s\n\n// RUN: %target-swift-frontend -num-threads 2 -O -c -emit-module -o %t/MyModule.o %t/MyModule.swift -enable-experimental-feature Embedded -parse-as-library\n// RUN: %target-swift-frontend -num-threads 2 -O -c -o %t/MainA.o -o %t/MainB.o %t/MainA.swift %t/MainB.swift -I %t -enable-experimental-feature Embedded -parse-as-library\n// RUN: %target-embedded-link %target-clang-resource-dir-opt %t/MainA.o %t/MainB.o %t/MyModule.o -o %t/a.out\n// RUN: %target-run %t/a.out | %FileCheck %s\n\n// REQUIRES: swift_in_compiler\n// REQUIRES: executable_test\n// REQUIRES: swift_feature_Embedded\n\n// BEGIN MyModule.swift\n\nvar dict: [Int:Int] = [1: 2, 3: 4]\n\npublic func module_func() {\n print(\"module_func: \\(dict[1]!)\")\n}\n\n// BEGIN MainA.swift\n\nimport MyModule\n\nfileprivate var dict: [Int:Int] = [5: 6, 7: 8]\n\nfunc mainA_func() {\n print(\"main_func: \\(dict[5]!)\")\n}\n\n// BEGIN MainB.swift\n\nimport MyModule\n\nfileprivate var dict: [Int:Int] = [5: 6, 7: 8]\n\nfunc mainB_func() {\n print(\"main_func: \\(dict[5]!)\")\n}\n\n@main\nstruct Main {\n static func main() {\n module_func()\n mainA_func()\n mainB_func()\n }\n}\n\n// CHECK: module_func: 2\n// CHECK: main_func: 6\n"},"lineMatches":[{"preview":"func mainA_func() {","lineNumber":26,"offsetAndLengths":[[0,9],[11,4]]},{"preview":" print(\"main_func: \\(dict[5]!)\")","lineNumber":27,"offsetAndLengths":[[9,4],[14,4]]},{"preview":"func mainB_func() {","lineNumber":36,"offsetAndLengths":[[0,9],[11,4]]},{"preview":" print(\"main_func: \\(dict[5]!)\")","lineNumber":37,"offsetAndLengths":[[9,4]]}]}]}}}}' + headers: + Content-Type: + - application/json + status: 200 OK + code: 200 + duration: 1.494321709s +- id: 3 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 42307 + host: "" + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/sourcegraph_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use sourcegraph to search for 'func main' in Go repositories\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"TestCoderAgent/openrouter-kimi-k2/sourcegraph_tool-1\",\"function\":{\"arguments\":\"{\\\"query\\\": \\\"func main\\\", \\\"count\\\": 10}\",\"name\":\"sourcegraph\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"# Sourcegraph Search Results\\n\\nFound 30 matches across 30 results\\n(Result limit reached, try a more specific query)\\n\\n## Result 4: github.com/swiftlang/swift/test/Concurrency/attr_discardableResult_async_await.swift\\n\\nURL: /github.com/swiftlang/swift/-/blob/test/Concurrency/attr_discardableResult_async_await.swift\\n\\n```\\n16| // https://github.com/swiftlang/swift/issues/83463\\n17| \\n18| @MainActor\\n19| @discardableResult\\n20| func returnsDiscardableFunc() -> () -> Void { return {} }\\n21| \\n22| @MainActor\\n23| func testDiscardsSyncFuncWithImplicitSendableConversion() {\\n24| returnsDiscardableFunc()\\n25| }\\n26| @MainActor\\n27| @MainActor\\n28| @discardableResult\\n29| func mainActorAsyncReturnsDiscardableFunc() async -> () -> Void { return {} }\\n30| \\n31| @MainActor\\n32| func discardsAsyncFuncWithImplicitSendableConversion() async {\\n33| await mainActorAsyncReturnsDiscardableFunc()\\n34| }\\n35| \\n```\\n\\n```\\n18| @MainActor\\n19| @discardableResult\\n20| func returnsDiscardableFunc() -> () -> Void { return {} }\\n21| \\n22| @MainActor\\n23| func testDiscardsSyncFuncWithImplicitSendableConversion() {\\n24| returnsDiscardableFunc()\\n25| }\\n26| \\n27| @MainActor\\n28| func mainActorAsyncReturnsDiscardableFunc() async -> () -> Void { return {} }\\n29| func mainActorAsyncReturnsDiscardableFunc() async -> () -> Void { return {} }\\n30| \\n31| @MainActor\\n32| func discardsAsyncFuncWithImplicitSendableConversion() async {\\n33| await mainActorAsyncReturnsDiscardableFunc()\\n34| }\\n35| \\n```\\n\\n```\\n20| func returnsDiscardableFunc() -> () -> Void { return {} }\\n21| \\n22| @MainActor\\n23| func testDiscardsSyncFuncWithImplicitSendableConversion() {\\n24| returnsDiscardableFunc()\\n25| }\\n26| \\n27| @MainActor\\n28| @discardableResult\\n29| func mainActorAsyncReturnsDiscardableFunc() async -> () -> Void { return {} }\\n30| @MainActor\\n31| @MainActor\\n32| func discardsAsyncFuncWithImplicitSendableConversion() async {\\n33| await mainActorAsyncReturnsDiscardableFunc()\\n34| }\\n35| \\n```\\n\\n```\\n21| \\n22| @MainActor\\n23| func testDiscardsSyncFuncWithImplicitSendableConversion() {\\n24| returnsDiscardableFunc()\\n25| }\\n26| \\n27| @MainActor\\n28| @discardableResult\\n29| func mainActorAsyncReturnsDiscardableFunc() async -> () -> Void { return {} }\\n30| \\n31| func discardsAsyncFuncWithImplicitSendableConversion() async {\\n32| func discardsAsyncFuncWithImplicitSendableConversion() async {\\n33| await mainActorAsyncReturnsDiscardableFunc()\\n34| }\\n35| \\n```\\n\\n```\\n22| @MainActor\\n23| func testDiscardsSyncFuncWithImplicitSendableConversion() {\\n24| returnsDiscardableFunc()\\n25| }\\n26| \\n27| @MainActor\\n28| @discardableResult\\n29| func mainActorAsyncReturnsDiscardableFunc() async -> () -> Void { return {} }\\n30| \\n31| @MainActor\\n32| await mainActorAsyncReturnsDiscardableFunc()\\n33| await mainActorAsyncReturnsDiscardableFunc()\\n34| }\\n35| \\n```\\n\\n```\\n1| // RUN: %target-swift-frontend -target %target-swift-5.1-abi-triple %s -emit-sil -o /dev/null -verify\\n2| // RUN: %target-swift-frontend -target %target-swift-5.1-abi-triple %s -emit-sil -o /dev/null -verify -strict-concurrency=targeted\\n3| // RUN: %target-swift-frontend -target %target-swift-5.1-abi-triple %s -emit-sil -o /dev/null -verify -strict-concurrency=complete\\n4| \\n5| // REQUIRES: concurrency\\n6| \\n7| // https://github.com/apple/swift/issues/60276\\n8| @discardableResult @MainActor\\n9| @discardableResult @MainActor\\n10| func mainActorAsyncDiscardable() async -> Int { 0 }\\n11| \\n12| func consumesMainActorAsyncDiscardable() async {\\n13| await mainActorAsyncDiscardable() // ok\\n14| }\\n15| \\n16| // https://github.com/swiftlang/swift/issues/83463\\n17| \\n18| @MainActor\\n```\\n\\n```\\n1| // RUN: %target-swift-frontend -target %target-swift-5.1-abi-triple %s -emit-sil -o /dev/null -verify\\n2| // RUN: %target-swift-frontend -target %target-swift-5.1-abi-triple %s -emit-sil -o /dev/null -verify -strict-concurrency=targeted\\n3| // RUN: %target-swift-frontend -target %target-swift-5.1-abi-triple %s -emit-sil -o /dev/null -verify -strict-concurrency=complete\\n4| \\n5| // REQUIRES: concurrency\\n6| \\n7| // https://github.com/apple/swift/issues/60276\\n8| \\n9| func mainActorAsyncDiscardable() async -> Int { 0 }\\n10| func mainActorAsyncDiscardable() async -> Int { 0 }\\n11| \\n12| func consumesMainActorAsyncDiscardable() async {\\n13| await mainActorAsyncDiscardable() // ok\\n14| }\\n15| \\n16| // https://github.com/swiftlang/swift/issues/83463\\n17| \\n18| @MainActor\\n19| @discardableResult\\n```\\n\\n```\\n1| // RUN: %target-swift-frontend -target %target-swift-5.1-abi-triple %s -emit-sil -o /dev/null -verify\\n2| // RUN: %target-swift-frontend -target %target-swift-5.1-abi-triple %s -emit-sil -o /dev/null -verify -strict-concurrency=targeted\\n3| // RUN: %target-swift-frontend -target %target-swift-5.1-abi-triple %s -emit-sil -o /dev/null -verify -strict-concurrency=complete\\n4| \\n5| // REQUIRES: concurrency\\n6| \\n7| // https://github.com/apple/swift/issues/60276\\n8| \\n9| @discardableResult @MainActor\\n10| func mainActorAsyncDiscardable() async -> Int { 0 }\\n11| func consumesMainActorAsyncDiscardable() async {\\n12| func consumesMainActorAsyncDiscardable() async {\\n13| await mainActorAsyncDiscardable() // ok\\n14| }\\n15| \\n16| // https://github.com/swiftlang/swift/issues/83463\\n17| \\n18| @MainActor\\n19| @discardableResult\\n20| func returnsDiscardableFunc() -> () -> Void { return {} }\\n21| \\n```\\n\\n```\\n2| // RUN: %target-swift-frontend -target %target-swift-5.1-abi-triple %s -emit-sil -o /dev/null -verify -strict-concurrency=targeted\\n3| // RUN: %target-swift-frontend -target %target-swift-5.1-abi-triple %s -emit-sil -o /dev/null -verify -strict-concurrency=complete\\n4| \\n5| // REQUIRES: concurrency\\n6| \\n7| // https://github.com/apple/swift/issues/60276\\n8| \\n9| @discardableResult @MainActor\\n10| func mainActorAsyncDiscardable() async -> Int { 0 }\\n11| \\n12| await mainActorAsyncDiscardable() // ok\\n13| await mainActorAsyncDiscardable() // ok\\n14| }\\n15| \\n16| // https://github.com/swiftlang/swift/issues/83463\\n17| \\n18| @MainActor\\n19| @discardableResult\\n20| func returnsDiscardableFunc() -> () -> Void { return {} }\\n21| \\n22| @MainActor\\n```\\n\\n```\\n7| // https://github.com/apple/swift/issues/60276\\n8| \\n9| @discardableResult @MainActor\\n10| func mainActorAsyncDiscardable() async -> Int { 0 }\\n11| \\n12| func consumesMainActorAsyncDiscardable() async {\\n13| await mainActorAsyncDiscardable() // ok\\n14| }\\n15| \\n16| // https://github.com/swiftlang/swift/issues/83463\\n17| @MainActor\\n18| @MainActor\\n19| @discardableResult\\n20| func returnsDiscardableFunc() -> () -> Void { return {} }\\n21| \\n22| @MainActor\\n23| func testDiscardsSyncFuncWithImplicitSendableConversion() {\\n24| returnsDiscardableFunc()\\n25| }\\n26| \\n27| @MainActor\\n```\\n\\n```\\n9| @discardableResult @MainActor\\n10| func mainActorAsyncDiscardable() async -> Int { 0 }\\n11| \\n12| func consumesMainActorAsyncDiscardable() async {\\n13| await mainActorAsyncDiscardable() // ok\\n14| }\\n15| \\n16| // https://github.com/swiftlang/swift/issues/83463\\n17| \\n18| @MainActor\\n19| func returnsDiscardableFunc() -> () -> Void { return {} }\\n20| func returnsDiscardableFunc() -> () -> Void { return {} }\\n21| \\n22| @MainActor\\n23| func testDiscardsSyncFuncWithImplicitSendableConversion() {\\n24| returnsDiscardableFunc()\\n25| }\\n26| \\n27| @MainActor\\n28| @discardableResult\\n29| func mainActorAsyncReturnsDiscardableFunc() async -> () -> Void { return {} }\\n```\\n\\n```\\n11| \\n12| func consumesMainActorAsyncDiscardable() async {\\n13| await mainActorAsyncDiscardable() // ok\\n14| }\\n15| \\n16| // https://github.com/swiftlang/swift/issues/83463\\n17| \\n18| @MainActor\\n19| @discardableResult\\n20| func returnsDiscardableFunc() -> () -> Void { return {} }\\n21| @MainActor\\n22| @MainActor\\n23| func testDiscardsSyncFuncWithImplicitSendableConversion() {\\n24| returnsDiscardableFunc()\\n25| }\\n26| \\n27| @MainActor\\n28| @discardableResult\\n29| func mainActorAsyncReturnsDiscardableFunc() async -> () -> Void { return {} }\\n30| \\n31| @MainActor\\n```\\n\\n```\\n12| func consumesMainActorAsyncDiscardable() async {\\n13| await mainActorAsyncDiscardable() // ok\\n14| }\\n15| \\n16| // https://github.com/swiftlang/swift/issues/83463\\n17| \\n18| @MainActor\\n19| @discardableResult\\n20| func returnsDiscardableFunc() -> () -> Void { return {} }\\n21| \\n22| func testDiscardsSyncFuncWithImplicitSendableConversion() {\\n23| func testDiscardsSyncFuncWithImplicitSendableConversion() {\\n24| returnsDiscardableFunc()\\n25| }\\n26| \\n27| @MainActor\\n28| @discardableResult\\n29| func mainActorAsyncReturnsDiscardableFunc() async -> () -> Void { return {} }\\n30| \\n31| @MainActor\\n32| func discardsAsyncFuncWithImplicitSendableConversion() async {\\n```\\n\\n```\\n13| await mainActorAsyncDiscardable() // ok\\n14| }\\n15| \\n16| // https://github.com/swiftlang/swift/issues/83463\\n17| \\n18| @MainActor\\n19| @discardableResult\\n20| func returnsDiscardableFunc() -> () -> Void { return {} }\\n21| \\n22| @MainActor\\n23| returnsDiscardableFunc()\\n24| returnsDiscardableFunc()\\n25| }\\n26| \\n27| @MainActor\\n28| @discardableResult\\n29| func mainActorAsyncReturnsDiscardableFunc() async -> () -> Void { return {} }\\n30| \\n31| @MainActor\\n32| func discardsAsyncFuncWithImplicitSendableConversion() async {\\n33| await mainActorAsyncReturnsDiscardableFunc()\\n```\\n\\n## Result 5: github.com/swiftlang/swift/test/embedded/linkage-mergeable4.swift\\n\\nURL: /github.com/swiftlang/swift/-/blob/test/embedded/linkage-mergeable4.swift\\n\\n```\\n16| \\n17| public func module_func() {\\n18| print(\\\"module_func: \\\\(dict[1]!)\\\")\\n19| }\\n20| \\n21| // BEGIN MainA.swift\\n22| \\n23| import MyModule\\n24| \\n25| fileprivate var dict: [Int:Int] = [5: 6, 7: 8]\\n26| func mainA_func() {\\n27| func mainA_func() {\\n28| print(\\\"main_func: \\\\(dict[5]!)\\\")\\n29| }\\n30| \\n31| // BEGIN MainB.swift\\n32| \\n33| import MyModule\\n34| \\n35| fileprivate var dict: [Int:Int] = [5: 6, 7: 8]\\n36| \\n```\\n\\n```\\n17| public func module_func() {\\n18| print(\\\"module_func: \\\\(dict[1]!)\\\")\\n19| }\\n20| \\n21| // BEGIN MainA.swift\\n22| \\n23| import MyModule\\n24| \\n25| fileprivate var dict: [Int:Int] = [5: 6, 7: 8]\\n26| \\n27| print(\\\"main_func: \\\\(dict[5]!)\\\")\\n28| print(\\\"main_func: \\\\(dict[5]!)\\\")\\n29| }\\n30| \\n31| // BEGIN MainB.swift\\n32| \\n33| import MyModule\\n34| \\n35| fileprivate var dict: [Int:Int] = [5: 6, 7: 8]\\n36| \\n37| func mainB_func() {\\n```\\n\\n```\\n26| \\n27| func mainA_func() {\\n28| print(\\\"main_func: \\\\(dict[5]!)\\\")\\n29| }\\n30| \\n31| // BEGIN MainB.swift\\n32| \\n33| import MyModule\\n34| \\n35| fileprivate var dict: [Int:Int] = [5: 6, 7: 8]\\n36| func mainB_func() {\\n37| func mainB_func() {\\n38| print(\\\"main_func: \\\\(dict[5]!)\\\")\\n39| }\\n40| \\n41| @main\\n42| struct Main {\\n43| static func main() {\\n44| module_func()\\n45| mainA_func()\\n46| mainB_func()\\n```\\n\\n```\\n27| func mainA_func() {\\n28| print(\\\"main_func: \\\\(dict[5]!)\\\")\\n29| }\\n30| \\n31| // BEGIN MainB.swift\\n32| \\n33| import MyModule\\n34| \\n35| fileprivate var dict: [Int:Int] = [5: 6, 7: 8]\\n36| \\n37| print(\\\"main_func: \\\\(dict[5]!)\\\")\\n38| print(\\\"main_func: \\\\(dict[5]!)\\\")\\n39| }\\n40| \\n41| @main\\n42| struct Main {\\n43| static func main() {\\n44| module_func()\\n45| mainA_func()\\n46| mainB_func()\\n47| }\\n```\\n\\n\",\"tool_call_id\":\"TestCoderAgent/openrouter-kimi-k2/sourcegraph_tool-1\",\"role\":\"tool\"}],\"model\":\"moonshotai/kimi-k2-0905\",\"max_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"usage\":{\"include\":true},\"stream\":true}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - OpenAI/Go 2.3.0 + url: https://openrouter.ai/api/v1/chat/completions + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + content_length: -1 + body: |+ + data: {"id":"gen-1759338218-7ovAS9Qb7RSWfXP5kprC","provider":"Groq","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338218,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fp_6e6ff3688b"} + + data: {"id":"gen-1759338218-7ovAS9Qb7RSWfXP5kprC","provider":"Groq","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338218,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":"functions.sourcegraph:1","type":"function","function":{"name":"sourcegraph","arguments":"{\"count\":10,\"query\":\"lang:Go func main\"}"},"index":0}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fp_6e6ff3688b"} + + data: {"id":"gen-1759338218-7ovAS9Qb7RSWfXP5kprC","provider":"Groq","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338218,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"tool_calls","native_finish_reason":"tool_calls","logprobs":null}],"system_fingerprint":"fp_6e6ff3688b"} + + data: {"id":"gen-1759338218-7ovAS9Qb7RSWfXP5kprC","provider":"Groq","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338218,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":11613,"completion_tokens":29,"total_tokens":11642,"cost":0.007732,"is_byok":false,"prompt_tokens_details":{"cached_tokens":7936,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.007645,"upstream_inference_completions_cost":0.000087},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} data: [DONE] @@ -126,15 +189,15 @@ interactions: - text/event-stream status: 200 OK code: 200 - duration: 1.34718275s -- id: 2 + duration: 1.019504666s +- id: 4 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 content_length: 424 host: sourcegraph.com - body: '{"query":"query Search($query: String!) { search(query: $query, version: V2, patternType: keyword ) { results { matchCount, limitHit, resultCount, approximateResultCount, missing { name }, timedout { name }, indexUnavailable, results { __typename, ... on FileMatch { repository { name }, file { path, url, content }, lineMatches { preview, lineNumber, offsetAndLengths } } } } } }","variables":{"query":"func main lang:go"}}' + body: '{"query":"query Search($query: String!) { search(query: $query, version: V2, patternType: keyword ) { results { matchCount, limitHit, resultCount, approximateResultCount, missing { name }, timedout { name }, indexUnavailable, results { __typename, ... on FileMatch { repository { name }, file { path, url, content }, lineMatches { preview, lineNumber, offsetAndLengths } } } } } }","variables":{"query":"lang:Go func main"}}' headers: Content-Type: - application/json @@ -154,15 +217,15 @@ interactions: - application/json status: 200 OK code: 200 - duration: 1.389065791s -- id: 3 + duration: 1.314158458s +- id: 5 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 38421 + content_length: 50105 host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/sourcegraph_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use sourcegraph to search for 'func main' in Go repositories\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"TestCoderAgent/openrouter-kimi-k2/sourcegraph_tool-1\",\"function\":{\"arguments\":\"{\\\"query\\\": \\\"func main lang:go\\\", \\\"count\\\": 10}\",\"name\":\"sourcegraph\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"# Sourcegraph Search Results\\n\\nFound 30 matches across 30 results\\n(Result limit reached, try a more specific query)\\n\\n## Result 1: github.com/yanfeizhang/go-training/8-internal/memory/stackgrow/main.go\\n\\nURL: /github.com/yanfeizhang/go-training/-/blob/8-internal/memory/stackgrow/main.go\\n\\n```\\n0| package main\\n1| package main\\n2| \\n3| func main() {\\n4| \\tn := 1\\n5| \\t_ = func1(n)\\n6| \\t_ = func2(n)\\n7| }\\n8| \\n9| func func1(n int) int {\\n10| \\t_ = make([]byte, 200)\\n```\\n\\n```\\n1| package main\\n2| func main() {\\n3| func main() {\\n4| \\tn := 1\\n5| \\t_ = func1(n)\\n6| \\t_ = func2(n)\\n7| }\\n8| \\n9| func func1(n int) int {\\n10| \\t_ = make([]byte, 200)\\n11| \\treturn n\\n12| }\\n```\\n\\n```\\n1| package main\\n2| \\n3| func main() {\\n4| \\t_ = func1(n)\\n5| \\t_ = func1(n)\\n6| \\t_ = func2(n)\\n7| }\\n8| \\n9| func func1(n int) int {\\n10| \\t_ = make([]byte, 200)\\n11| \\treturn n\\n12| }\\n13| \\n14| func func2(n int) int {\\n```\\n\\n```\\n1| package main\\n2| \\n3| func main() {\\n4| \\tn := 1\\n5| \\t_ = func2(n)\\n6| \\t_ = func2(n)\\n7| }\\n8| \\n9| func func1(n int) int {\\n10| \\t_ = make([]byte, 200)\\n11| \\treturn n\\n12| }\\n13| \\n14| func func2(n int) int {\\n15| \\t_ = make([]byte, 20)\\n```\\n\\n```\\n1| package main\\n2| \\n3| func main() {\\n4| \\tn := 1\\n5| \\t_ = func1(n)\\n6| \\t_ = func2(n)\\n7| }\\n8| func func1(n int) int {\\n9| func func1(n int) int {\\n10| \\t_ = make([]byte, 200)\\n11| \\treturn n\\n12| }\\n13| \\n14| func func2(n int) int {\\n15| \\t_ = make([]byte, 20)\\n16| \\treturn n\\n17| }\\n18| \\n```\\n\\n```\\n3| func main() {\\n4| \\tn := 1\\n5| \\t_ = func1(n)\\n6| \\t_ = func2(n)\\n7| }\\n8| \\n9| func func1(n int) int {\\n10| \\t_ = make([]byte, 200)\\n11| \\treturn n\\n12| }\\n13| func func2(n int) int {\\n14| func func2(n int) int {\\n15| \\t_ = make([]byte, 20)\\n16| \\treturn n\\n17| }\\n18| \\n```\\n\\n## Result 2: github.com/GolangUA/go-training/src/functions/functions3/main.go\\n\\nURL: /github.com/GolangUA/go-training/-/blob/src/functions/functions3/main.go\\n\\n```\\n1| package main\\n2| \\n3| // START OMIT\\n4| func hello(name int) {\\n5| \\tprintln(\\\"Hello \\\" + name)\\n6| }\\n7| func main() {\\n8| func main() {\\n9| \\thello(\\\"David\\\")\\n10| }\\n11| \\n12| // END OMIT\\n13| \\n```\\n\\n```\\n0| package main\\n1| package main\\n2| \\n3| // START OMIT\\n4| func hello(name int) {\\n5| \\tprintln(\\\"Hello \\\" + name)\\n6| }\\n7| \\n8| func main() {\\n9| \\thello(\\\"David\\\")\\n10| }\\n```\\n\\n```\\n1| package main\\n2| \\n3| func hello(name int) {\\n4| func hello(name int) {\\n5| \\tprintln(\\\"Hello \\\" + name)\\n6| }\\n7| \\n8| func main() {\\n9| \\thello(\\\"David\\\")\\n10| }\\n11| \\n12| // END OMIT\\n13| \\n```\\n\\n## Result 3: github.com/pingguoxueyuan/gostudy/listen15/defer/main.go\\n\\nURL: /github.com/pingguoxueyuan/gostudy/-/blob/listen15/defer/main.go\\n\\n```\\n26| \\t}()\\n27| \\treturn x\\n28| }\\n29| \\n30| func funcD() (x int) {\\n31| \\tdefer func(x int) {\\n32| \\t\\tx += 1\\n33| \\t}(x)\\n34| \\treturn 5\\n35| }\\n36| func main() {\\n37| func main() {\\n38| \\t//fmt.Println(funcA())\\n39| \\t//fmt.Println(funcB())\\n40| \\t//fmt.Println(funcC())\\n41| \\tfmt.Println(funcD())\\n42| }\\n43| \\n```\\n\\n```\\n27| \\treturn x\\n28| }\\n29| \\n30| func funcD() (x int) {\\n31| \\tdefer func(x int) {\\n32| \\t\\tx += 1\\n33| \\t}(x)\\n34| \\treturn 5\\n35| }\\n36| \\n37| \\t//fmt.Println(funcA())\\n38| \\t//fmt.Println(funcA())\\n39| \\t//fmt.Println(funcB())\\n40| \\t//fmt.Println(funcC())\\n41| \\tfmt.Println(funcD())\\n42| }\\n43| \\n```\\n\\n```\\n28| }\\n29| \\n30| func funcD() (x int) {\\n31| \\tdefer func(x int) {\\n32| \\t\\tx += 1\\n33| \\t}(x)\\n34| \\treturn 5\\n35| }\\n36| \\n37| func main() {\\n38| \\t//fmt.Println(funcB())\\n39| \\t//fmt.Println(funcB())\\n40| \\t//fmt.Println(funcC())\\n41| \\tfmt.Println(funcD())\\n42| }\\n43| \\n```\\n\\n```\\n29| \\n30| func funcD() (x int) {\\n31| \\tdefer func(x int) {\\n32| \\t\\tx += 1\\n33| \\t}(x)\\n34| \\treturn 5\\n35| }\\n36| \\n37| func main() {\\n38| \\t//fmt.Println(funcA())\\n39| \\t//fmt.Println(funcC())\\n40| \\t//fmt.Println(funcC())\\n41| \\tfmt.Println(funcD())\\n42| }\\n43| \\n```\\n\\n```\\n30| func funcD() (x int) {\\n31| \\tdefer func(x int) {\\n32| \\t\\tx += 1\\n33| \\t}(x)\\n34| \\treturn 5\\n35| }\\n36| \\n37| func main() {\\n38| \\t//fmt.Println(funcA())\\n39| \\t//fmt.Println(funcB())\\n40| \\tfmt.Println(funcD())\\n41| \\tfmt.Println(funcD())\\n42| }\\n43| \\n```\\n\\n```\\n1| package main\\n2| \\n3| import (\\n4| \\t\\\"fmt\\\"\\n5| )\\n6| func funcA() int {\\n7| func funcA() int {\\n8| \\tx := 5\\n9| \\tdefer func() {\\n10| \\t\\tx += 1\\n11| \\t}()\\n12| \\treturn x\\n13| }\\n14| \\n15| func funcB() (x int) {\\n16| \\tdefer func() {\\n```\\n\\n```\\n1| package main\\n2| \\n3| import (\\n4| \\t\\\"fmt\\\"\\n5| )\\n6| \\n7| func funcA() int {\\n8| \\tdefer func() {\\n9| \\tdefer func() {\\n10| \\t\\tx += 1\\n11| \\t}()\\n12| \\treturn x\\n13| }\\n14| \\n15| func funcB() (x int) {\\n16| \\tdefer func() {\\n17| \\t\\tx += 1\\n18| \\t}()\\n```\\n\\n```\\n0| package main\\n1| package main\\n2| \\n3| import (\\n4| \\t\\\"fmt\\\"\\n5| )\\n6| \\n7| func funcA() int {\\n8| \\tx := 5\\n9| \\tdefer func() {\\n10| \\t\\tx += 1\\n```\\n\\n```\\n4| \\t\\\"fmt\\\"\\n5| )\\n6| \\n7| func funcA() int {\\n8| \\tx := 5\\n9| \\tdefer func() {\\n10| \\t\\tx += 1\\n11| \\t}()\\n12| \\treturn x\\n13| }\\n14| func funcB() (x int) {\\n15| func funcB() (x int) {\\n16| \\tdefer func() {\\n17| \\t\\tx += 1\\n18| \\t}()\\n19| \\treturn 5\\n20| }\\n21| \\n22| func funcC() (y int) {\\n23| \\tx := 5\\n24| \\tdefer func() {\\n```\\n\\n```\\n5| )\\n6| \\n7| func funcA() int {\\n8| \\tx := 5\\n9| \\tdefer func() {\\n10| \\t\\tx += 1\\n11| \\t}()\\n12| \\treturn x\\n13| }\\n14| \\n15| \\tdefer func() {\\n16| \\tdefer func() {\\n17| \\t\\tx += 1\\n18| \\t}()\\n19| \\treturn 5\\n20| }\\n21| \\n22| func funcC() (y int) {\\n23| \\tx := 5\\n24| \\tdefer func() {\\n25| \\t\\tx += 1\\n```\\n\\n```\\n11| \\t}()\\n12| \\treturn x\\n13| }\\n14| \\n15| func funcB() (x int) {\\n16| \\tdefer func() {\\n17| \\t\\tx += 1\\n18| \\t}()\\n19| \\treturn 5\\n20| }\\n21| func funcC() (y int) {\\n22| func funcC() (y int) {\\n23| \\tx := 5\\n24| \\tdefer func() {\\n25| \\t\\tx += 1\\n26| \\t}()\\n27| \\treturn x\\n28| }\\n29| \\n30| func funcD() (x int) {\\n31| \\tdefer func(x int) {\\n```\\n\\n```\\n13| }\\n14| \\n15| func funcB() (x int) {\\n16| \\tdefer func() {\\n17| \\t\\tx += 1\\n18| \\t}()\\n19| \\treturn 5\\n20| }\\n21| \\n22| func funcC() (y int) {\\n23| \\tdefer func() {\\n24| \\tdefer func() {\\n25| \\t\\tx += 1\\n26| \\t}()\\n27| \\treturn x\\n28| }\\n29| \\n30| func funcD() (x int) {\\n31| \\tdefer func(x int) {\\n32| \\t\\tx += 1\\n33| \\t}(x)\\n```\\n\\n```\\n19| \\treturn 5\\n20| }\\n21| \\n22| func funcC() (y int) {\\n23| \\tx := 5\\n24| \\tdefer func() {\\n25| \\t\\tx += 1\\n26| \\t}()\\n27| \\treturn x\\n28| }\\n29| func funcD() (x int) {\\n30| func funcD() (x int) {\\n31| \\tdefer func(x int) {\\n32| \\t\\tx += 1\\n33| \\t}(x)\\n34| \\treturn 5\\n35| }\\n36| \\n37| func main() {\\n38| \\t//fmt.Println(funcA())\\n39| \\t//fmt.Println(funcB())\\n```\\n\\n```\\n20| }\\n21| \\n22| func funcC() (y int) {\\n23| \\tx := 5\\n24| \\tdefer func() {\\n25| \\t\\tx += 1\\n26| \\t}()\\n27| \\treturn x\\n28| }\\n29| \\n30| \\tdefer func(x int) {\\n31| \\tdefer func(x int) {\\n32| \\t\\tx += 1\\n33| \\t}(x)\\n34| \\treturn 5\\n35| }\\n36| \\n37| func main() {\\n38| \\t//fmt.Println(funcA())\\n39| \\t//fmt.Println(funcB())\\n40| \\t//fmt.Println(funcC())\\n```\\n\\n## Result 4: github.com/Zhouchaowen/golang-tutorial/12-library/8-error/ch_1/main.go\\n\\nURL: /github.com/Zhouchaowen/golang-tutorial/-/blob/12-library/8-error/ch_1/main.go\\n\\n```\\n5| \\t\\\"fmt\\\"\\n6| )\\n7| \\n8| func func1() error {\\n9| \\treturn errors.New(\\\"func1 error\\\")\\n10| }\\n11| \\n12| func func2() error {\\n13| \\treturn fmt.Errorf(\\\"func2 error: %w\\\", func1())\\n14| }\\n15| func main() {\\n16| func main() {\\n17| \\terr := func2()\\n18| \\tif err != nil {\\n19| \\t\\tfmt.Println(err)\\n20| \\t}\\n21| }\\n22| \\n```\\n\\n\",\"tool_call_id\":\"TestCoderAgent/openrouter-kimi-k2/sourcegraph_tool-1\",\"role\":\"tool\"}],\"model\":\"moonshotai/kimi-k2-0905\",\"max_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"usage\":{\"include\":true},\"stream\":true}" + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/sourcegraph_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use sourcegraph to search for 'func main' in Go repositories\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"TestCoderAgent/openrouter-kimi-k2/sourcegraph_tool-1\",\"function\":{\"arguments\":\"{\\\"query\\\": \\\"func main\\\", \\\"count\\\": 10}\",\"name\":\"sourcegraph\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"# Sourcegraph Search Results\\n\\nFound 30 matches across 30 results\\n(Result limit reached, try a more specific query)\\n\\n## Result 4: github.com/swiftlang/swift/test/Concurrency/attr_discardableResult_async_await.swift\\n\\nURL: /github.com/swiftlang/swift/-/blob/test/Concurrency/attr_discardableResult_async_await.swift\\n\\n```\\n16| // https://github.com/swiftlang/swift/issues/83463\\n17| \\n18| @MainActor\\n19| @discardableResult\\n20| func returnsDiscardableFunc() -> () -> Void { return {} }\\n21| \\n22| @MainActor\\n23| func testDiscardsSyncFuncWithImplicitSendableConversion() {\\n24| returnsDiscardableFunc()\\n25| }\\n26| @MainActor\\n27| @MainActor\\n28| @discardableResult\\n29| func mainActorAsyncReturnsDiscardableFunc() async -> () -> Void { return {} }\\n30| \\n31| @MainActor\\n32| func discardsAsyncFuncWithImplicitSendableConversion() async {\\n33| await mainActorAsyncReturnsDiscardableFunc()\\n34| }\\n35| \\n```\\n\\n```\\n18| @MainActor\\n19| @discardableResult\\n20| func returnsDiscardableFunc() -> () -> Void { return {} }\\n21| \\n22| @MainActor\\n23| func testDiscardsSyncFuncWithImplicitSendableConversion() {\\n24| returnsDiscardableFunc()\\n25| }\\n26| \\n27| @MainActor\\n28| func mainActorAsyncReturnsDiscardableFunc() async -> () -> Void { return {} }\\n29| func mainActorAsyncReturnsDiscardableFunc() async -> () -> Void { return {} }\\n30| \\n31| @MainActor\\n32| func discardsAsyncFuncWithImplicitSendableConversion() async {\\n33| await mainActorAsyncReturnsDiscardableFunc()\\n34| }\\n35| \\n```\\n\\n```\\n20| func returnsDiscardableFunc() -> () -> Void { return {} }\\n21| \\n22| @MainActor\\n23| func testDiscardsSyncFuncWithImplicitSendableConversion() {\\n24| returnsDiscardableFunc()\\n25| }\\n26| \\n27| @MainActor\\n28| @discardableResult\\n29| func mainActorAsyncReturnsDiscardableFunc() async -> () -> Void { return {} }\\n30| @MainActor\\n31| @MainActor\\n32| func discardsAsyncFuncWithImplicitSendableConversion() async {\\n33| await mainActorAsyncReturnsDiscardableFunc()\\n34| }\\n35| \\n```\\n\\n```\\n21| \\n22| @MainActor\\n23| func testDiscardsSyncFuncWithImplicitSendableConversion() {\\n24| returnsDiscardableFunc()\\n25| }\\n26| \\n27| @MainActor\\n28| @discardableResult\\n29| func mainActorAsyncReturnsDiscardableFunc() async -> () -> Void { return {} }\\n30| \\n31| func discardsAsyncFuncWithImplicitSendableConversion() async {\\n32| func discardsAsyncFuncWithImplicitSendableConversion() async {\\n33| await mainActorAsyncReturnsDiscardableFunc()\\n34| }\\n35| \\n```\\n\\n```\\n22| @MainActor\\n23| func testDiscardsSyncFuncWithImplicitSendableConversion() {\\n24| returnsDiscardableFunc()\\n25| }\\n26| \\n27| @MainActor\\n28| @discardableResult\\n29| func mainActorAsyncReturnsDiscardableFunc() async -> () -> Void { return {} }\\n30| \\n31| @MainActor\\n32| await mainActorAsyncReturnsDiscardableFunc()\\n33| await mainActorAsyncReturnsDiscardableFunc()\\n34| }\\n35| \\n```\\n\\n```\\n1| // RUN: %target-swift-frontend -target %target-swift-5.1-abi-triple %s -emit-sil -o /dev/null -verify\\n2| // RUN: %target-swift-frontend -target %target-swift-5.1-abi-triple %s -emit-sil -o /dev/null -verify -strict-concurrency=targeted\\n3| // RUN: %target-swift-frontend -target %target-swift-5.1-abi-triple %s -emit-sil -o /dev/null -verify -strict-concurrency=complete\\n4| \\n5| // REQUIRES: concurrency\\n6| \\n7| // https://github.com/apple/swift/issues/60276\\n8| @discardableResult @MainActor\\n9| @discardableResult @MainActor\\n10| func mainActorAsyncDiscardable() async -> Int { 0 }\\n11| \\n12| func consumesMainActorAsyncDiscardable() async {\\n13| await mainActorAsyncDiscardable() // ok\\n14| }\\n15| \\n16| // https://github.com/swiftlang/swift/issues/83463\\n17| \\n18| @MainActor\\n```\\n\\n```\\n1| // RUN: %target-swift-frontend -target %target-swift-5.1-abi-triple %s -emit-sil -o /dev/null -verify\\n2| // RUN: %target-swift-frontend -target %target-swift-5.1-abi-triple %s -emit-sil -o /dev/null -verify -strict-concurrency=targeted\\n3| // RUN: %target-swift-frontend -target %target-swift-5.1-abi-triple %s -emit-sil -o /dev/null -verify -strict-concurrency=complete\\n4| \\n5| // REQUIRES: concurrency\\n6| \\n7| // https://github.com/apple/swift/issues/60276\\n8| \\n9| func mainActorAsyncDiscardable() async -> Int { 0 }\\n10| func mainActorAsyncDiscardable() async -> Int { 0 }\\n11| \\n12| func consumesMainActorAsyncDiscardable() async {\\n13| await mainActorAsyncDiscardable() // ok\\n14| }\\n15| \\n16| // https://github.com/swiftlang/swift/issues/83463\\n17| \\n18| @MainActor\\n19| @discardableResult\\n```\\n\\n```\\n1| // RUN: %target-swift-frontend -target %target-swift-5.1-abi-triple %s -emit-sil -o /dev/null -verify\\n2| // RUN: %target-swift-frontend -target %target-swift-5.1-abi-triple %s -emit-sil -o /dev/null -verify -strict-concurrency=targeted\\n3| // RUN: %target-swift-frontend -target %target-swift-5.1-abi-triple %s -emit-sil -o /dev/null -verify -strict-concurrency=complete\\n4| \\n5| // REQUIRES: concurrency\\n6| \\n7| // https://github.com/apple/swift/issues/60276\\n8| \\n9| @discardableResult @MainActor\\n10| func mainActorAsyncDiscardable() async -> Int { 0 }\\n11| func consumesMainActorAsyncDiscardable() async {\\n12| func consumesMainActorAsyncDiscardable() async {\\n13| await mainActorAsyncDiscardable() // ok\\n14| }\\n15| \\n16| // https://github.com/swiftlang/swift/issues/83463\\n17| \\n18| @MainActor\\n19| @discardableResult\\n20| func returnsDiscardableFunc() -> () -> Void { return {} }\\n21| \\n```\\n\\n```\\n2| // RUN: %target-swift-frontend -target %target-swift-5.1-abi-triple %s -emit-sil -o /dev/null -verify -strict-concurrency=targeted\\n3| // RUN: %target-swift-frontend -target %target-swift-5.1-abi-triple %s -emit-sil -o /dev/null -verify -strict-concurrency=complete\\n4| \\n5| // REQUIRES: concurrency\\n6| \\n7| // https://github.com/apple/swift/issues/60276\\n8| \\n9| @discardableResult @MainActor\\n10| func mainActorAsyncDiscardable() async -> Int { 0 }\\n11| \\n12| await mainActorAsyncDiscardable() // ok\\n13| await mainActorAsyncDiscardable() // ok\\n14| }\\n15| \\n16| // https://github.com/swiftlang/swift/issues/83463\\n17| \\n18| @MainActor\\n19| @discardableResult\\n20| func returnsDiscardableFunc() -> () -> Void { return {} }\\n21| \\n22| @MainActor\\n```\\n\\n```\\n7| // https://github.com/apple/swift/issues/60276\\n8| \\n9| @discardableResult @MainActor\\n10| func mainActorAsyncDiscardable() async -> Int { 0 }\\n11| \\n12| func consumesMainActorAsyncDiscardable() async {\\n13| await mainActorAsyncDiscardable() // ok\\n14| }\\n15| \\n16| // https://github.com/swiftlang/swift/issues/83463\\n17| @MainActor\\n18| @MainActor\\n19| @discardableResult\\n20| func returnsDiscardableFunc() -> () -> Void { return {} }\\n21| \\n22| @MainActor\\n23| func testDiscardsSyncFuncWithImplicitSendableConversion() {\\n24| returnsDiscardableFunc()\\n25| }\\n26| \\n27| @MainActor\\n```\\n\\n```\\n9| @discardableResult @MainActor\\n10| func mainActorAsyncDiscardable() async -> Int { 0 }\\n11| \\n12| func consumesMainActorAsyncDiscardable() async {\\n13| await mainActorAsyncDiscardable() // ok\\n14| }\\n15| \\n16| // https://github.com/swiftlang/swift/issues/83463\\n17| \\n18| @MainActor\\n19| func returnsDiscardableFunc() -> () -> Void { return {} }\\n20| func returnsDiscardableFunc() -> () -> Void { return {} }\\n21| \\n22| @MainActor\\n23| func testDiscardsSyncFuncWithImplicitSendableConversion() {\\n24| returnsDiscardableFunc()\\n25| }\\n26| \\n27| @MainActor\\n28| @discardableResult\\n29| func mainActorAsyncReturnsDiscardableFunc() async -> () -> Void { return {} }\\n```\\n\\n```\\n11| \\n12| func consumesMainActorAsyncDiscardable() async {\\n13| await mainActorAsyncDiscardable() // ok\\n14| }\\n15| \\n16| // https://github.com/swiftlang/swift/issues/83463\\n17| \\n18| @MainActor\\n19| @discardableResult\\n20| func returnsDiscardableFunc() -> () -> Void { return {} }\\n21| @MainActor\\n22| @MainActor\\n23| func testDiscardsSyncFuncWithImplicitSendableConversion() {\\n24| returnsDiscardableFunc()\\n25| }\\n26| \\n27| @MainActor\\n28| @discardableResult\\n29| func mainActorAsyncReturnsDiscardableFunc() async -> () -> Void { return {} }\\n30| \\n31| @MainActor\\n```\\n\\n```\\n12| func consumesMainActorAsyncDiscardable() async {\\n13| await mainActorAsyncDiscardable() // ok\\n14| }\\n15| \\n16| // https://github.com/swiftlang/swift/issues/83463\\n17| \\n18| @MainActor\\n19| @discardableResult\\n20| func returnsDiscardableFunc() -> () -> Void { return {} }\\n21| \\n22| func testDiscardsSyncFuncWithImplicitSendableConversion() {\\n23| func testDiscardsSyncFuncWithImplicitSendableConversion() {\\n24| returnsDiscardableFunc()\\n25| }\\n26| \\n27| @MainActor\\n28| @discardableResult\\n29| func mainActorAsyncReturnsDiscardableFunc() async -> () -> Void { return {} }\\n30| \\n31| @MainActor\\n32| func discardsAsyncFuncWithImplicitSendableConversion() async {\\n```\\n\\n```\\n13| await mainActorAsyncDiscardable() // ok\\n14| }\\n15| \\n16| // https://github.com/swiftlang/swift/issues/83463\\n17| \\n18| @MainActor\\n19| @discardableResult\\n20| func returnsDiscardableFunc() -> () -> Void { return {} }\\n21| \\n22| @MainActor\\n23| returnsDiscardableFunc()\\n24| returnsDiscardableFunc()\\n25| }\\n26| \\n27| @MainActor\\n28| @discardableResult\\n29| func mainActorAsyncReturnsDiscardableFunc() async -> () -> Void { return {} }\\n30| \\n31| @MainActor\\n32| func discardsAsyncFuncWithImplicitSendableConversion() async {\\n33| await mainActorAsyncReturnsDiscardableFunc()\\n```\\n\\n## Result 5: github.com/swiftlang/swift/test/embedded/linkage-mergeable4.swift\\n\\nURL: /github.com/swiftlang/swift/-/blob/test/embedded/linkage-mergeable4.swift\\n\\n```\\n16| \\n17| public func module_func() {\\n18| print(\\\"module_func: \\\\(dict[1]!)\\\")\\n19| }\\n20| \\n21| // BEGIN MainA.swift\\n22| \\n23| import MyModule\\n24| \\n25| fileprivate var dict: [Int:Int] = [5: 6, 7: 8]\\n26| func mainA_func() {\\n27| func mainA_func() {\\n28| print(\\\"main_func: \\\\(dict[5]!)\\\")\\n29| }\\n30| \\n31| // BEGIN MainB.swift\\n32| \\n33| import MyModule\\n34| \\n35| fileprivate var dict: [Int:Int] = [5: 6, 7: 8]\\n36| \\n```\\n\\n```\\n17| public func module_func() {\\n18| print(\\\"module_func: \\\\(dict[1]!)\\\")\\n19| }\\n20| \\n21| // BEGIN MainA.swift\\n22| \\n23| import MyModule\\n24| \\n25| fileprivate var dict: [Int:Int] = [5: 6, 7: 8]\\n26| \\n27| print(\\\"main_func: \\\\(dict[5]!)\\\")\\n28| print(\\\"main_func: \\\\(dict[5]!)\\\")\\n29| }\\n30| \\n31| // BEGIN MainB.swift\\n32| \\n33| import MyModule\\n34| \\n35| fileprivate var dict: [Int:Int] = [5: 6, 7: 8]\\n36| \\n37| func mainB_func() {\\n```\\n\\n```\\n26| \\n27| func mainA_func() {\\n28| print(\\\"main_func: \\\\(dict[5]!)\\\")\\n29| }\\n30| \\n31| // BEGIN MainB.swift\\n32| \\n33| import MyModule\\n34| \\n35| fileprivate var dict: [Int:Int] = [5: 6, 7: 8]\\n36| func mainB_func() {\\n37| func mainB_func() {\\n38| print(\\\"main_func: \\\\(dict[5]!)\\\")\\n39| }\\n40| \\n41| @main\\n42| struct Main {\\n43| static func main() {\\n44| module_func()\\n45| mainA_func()\\n46| mainB_func()\\n```\\n\\n```\\n27| func mainA_func() {\\n28| print(\\\"main_func: \\\\(dict[5]!)\\\")\\n29| }\\n30| \\n31| // BEGIN MainB.swift\\n32| \\n33| import MyModule\\n34| \\n35| fileprivate var dict: [Int:Int] = [5: 6, 7: 8]\\n36| \\n37| print(\\\"main_func: \\\\(dict[5]!)\\\")\\n38| print(\\\"main_func: \\\\(dict[5]!)\\\")\\n39| }\\n40| \\n41| @main\\n42| struct Main {\\n43| static func main() {\\n44| module_func()\\n45| mainA_func()\\n46| mainB_func()\\n47| }\\n```\\n\\n\",\"tool_call_id\":\"TestCoderAgent/openrouter-kimi-k2/sourcegraph_tool-1\",\"role\":\"tool\"},{\"tool_calls\":[{\"id\":\"TestCoderAgent/openrouter-kimi-k2/sourcegraph_tool-2\",\"function\":{\"arguments\":\"{\\\"count\\\":10,\\\"query\\\":\\\"lang:Go func main\\\"}\",\"name\":\"sourcegraph\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"# Sourcegraph Search Results\\n\\nFound 30 matches across 30 results\\n(Result limit reached, try a more specific query)\\n\\n## Result 1: github.com/yanfeizhang/go-training/8-internal/memory/stackgrow/main.go\\n\\nURL: /github.com/yanfeizhang/go-training/-/blob/8-internal/memory/stackgrow/main.go\\n\\n```\\n0| package main\\n1| package main\\n2| \\n3| func main() {\\n4| \\tn := 1\\n5| \\t_ = func1(n)\\n6| \\t_ = func2(n)\\n7| }\\n8| \\n9| func func1(n int) int {\\n10| \\t_ = make([]byte, 200)\\n```\\n\\n```\\n1| package main\\n2| func main() {\\n3| func main() {\\n4| \\tn := 1\\n5| \\t_ = func1(n)\\n6| \\t_ = func2(n)\\n7| }\\n8| \\n9| func func1(n int) int {\\n10| \\t_ = make([]byte, 200)\\n11| \\treturn n\\n12| }\\n```\\n\\n```\\n1| package main\\n2| \\n3| func main() {\\n4| \\t_ = func1(n)\\n5| \\t_ = func1(n)\\n6| \\t_ = func2(n)\\n7| }\\n8| \\n9| func func1(n int) int {\\n10| \\t_ = make([]byte, 200)\\n11| \\treturn n\\n12| }\\n13| \\n14| func func2(n int) int {\\n```\\n\\n```\\n1| package main\\n2| \\n3| func main() {\\n4| \\tn := 1\\n5| \\t_ = func2(n)\\n6| \\t_ = func2(n)\\n7| }\\n8| \\n9| func func1(n int) int {\\n10| \\t_ = make([]byte, 200)\\n11| \\treturn n\\n12| }\\n13| \\n14| func func2(n int) int {\\n15| \\t_ = make([]byte, 20)\\n```\\n\\n```\\n1| package main\\n2| \\n3| func main() {\\n4| \\tn := 1\\n5| \\t_ = func1(n)\\n6| \\t_ = func2(n)\\n7| }\\n8| func func1(n int) int {\\n9| func func1(n int) int {\\n10| \\t_ = make([]byte, 200)\\n11| \\treturn n\\n12| }\\n13| \\n14| func func2(n int) int {\\n15| \\t_ = make([]byte, 20)\\n16| \\treturn n\\n17| }\\n18| \\n```\\n\\n```\\n3| func main() {\\n4| \\tn := 1\\n5| \\t_ = func1(n)\\n6| \\t_ = func2(n)\\n7| }\\n8| \\n9| func func1(n int) int {\\n10| \\t_ = make([]byte, 200)\\n11| \\treturn n\\n12| }\\n13| func func2(n int) int {\\n14| func func2(n int) int {\\n15| \\t_ = make([]byte, 20)\\n16| \\treturn n\\n17| }\\n18| \\n```\\n\\n## Result 2: github.com/GolangUA/go-training/src/functions/functions3/main.go\\n\\nURL: /github.com/GolangUA/go-training/-/blob/src/functions/functions3/main.go\\n\\n```\\n1| package main\\n2| \\n3| // START OMIT\\n4| func hello(name int) {\\n5| \\tprintln(\\\"Hello \\\" + name)\\n6| }\\n7| func main() {\\n8| func main() {\\n9| \\thello(\\\"David\\\")\\n10| }\\n11| \\n12| // END OMIT\\n13| \\n```\\n\\n```\\n0| package main\\n1| package main\\n2| \\n3| // START OMIT\\n4| func hello(name int) {\\n5| \\tprintln(\\\"Hello \\\" + name)\\n6| }\\n7| \\n8| func main() {\\n9| \\thello(\\\"David\\\")\\n10| }\\n```\\n\\n```\\n1| package main\\n2| \\n3| func hello(name int) {\\n4| func hello(name int) {\\n5| \\tprintln(\\\"Hello \\\" + name)\\n6| }\\n7| \\n8| func main() {\\n9| \\thello(\\\"David\\\")\\n10| }\\n11| \\n12| // END OMIT\\n13| \\n```\\n\\n## Result 3: github.com/pingguoxueyuan/gostudy/listen15/defer/main.go\\n\\nURL: /github.com/pingguoxueyuan/gostudy/-/blob/listen15/defer/main.go\\n\\n```\\n26| \\t}()\\n27| \\treturn x\\n28| }\\n29| \\n30| func funcD() (x int) {\\n31| \\tdefer func(x int) {\\n32| \\t\\tx += 1\\n33| \\t}(x)\\n34| \\treturn 5\\n35| }\\n36| func main() {\\n37| func main() {\\n38| \\t//fmt.Println(funcA())\\n39| \\t//fmt.Println(funcB())\\n40| \\t//fmt.Println(funcC())\\n41| \\tfmt.Println(funcD())\\n42| }\\n43| \\n```\\n\\n```\\n27| \\treturn x\\n28| }\\n29| \\n30| func funcD() (x int) {\\n31| \\tdefer func(x int) {\\n32| \\t\\tx += 1\\n33| \\t}(x)\\n34| \\treturn 5\\n35| }\\n36| \\n37| \\t//fmt.Println(funcA())\\n38| \\t//fmt.Println(funcA())\\n39| \\t//fmt.Println(funcB())\\n40| \\t//fmt.Println(funcC())\\n41| \\tfmt.Println(funcD())\\n42| }\\n43| \\n```\\n\\n```\\n28| }\\n29| \\n30| func funcD() (x int) {\\n31| \\tdefer func(x int) {\\n32| \\t\\tx += 1\\n33| \\t}(x)\\n34| \\treturn 5\\n35| }\\n36| \\n37| func main() {\\n38| \\t//fmt.Println(funcB())\\n39| \\t//fmt.Println(funcB())\\n40| \\t//fmt.Println(funcC())\\n41| \\tfmt.Println(funcD())\\n42| }\\n43| \\n```\\n\\n```\\n29| \\n30| func funcD() (x int) {\\n31| \\tdefer func(x int) {\\n32| \\t\\tx += 1\\n33| \\t}(x)\\n34| \\treturn 5\\n35| }\\n36| \\n37| func main() {\\n38| \\t//fmt.Println(funcA())\\n39| \\t//fmt.Println(funcC())\\n40| \\t//fmt.Println(funcC())\\n41| \\tfmt.Println(funcD())\\n42| }\\n43| \\n```\\n\\n```\\n30| func funcD() (x int) {\\n31| \\tdefer func(x int) {\\n32| \\t\\tx += 1\\n33| \\t}(x)\\n34| \\treturn 5\\n35| }\\n36| \\n37| func main() {\\n38| \\t//fmt.Println(funcA())\\n39| \\t//fmt.Println(funcB())\\n40| \\tfmt.Println(funcD())\\n41| \\tfmt.Println(funcD())\\n42| }\\n43| \\n```\\n\\n```\\n1| package main\\n2| \\n3| import (\\n4| \\t\\\"fmt\\\"\\n5| )\\n6| func funcA() int {\\n7| func funcA() int {\\n8| \\tx := 5\\n9| \\tdefer func() {\\n10| \\t\\tx += 1\\n11| \\t}()\\n12| \\treturn x\\n13| }\\n14| \\n15| func funcB() (x int) {\\n16| \\tdefer func() {\\n```\\n\\n```\\n1| package main\\n2| \\n3| import (\\n4| \\t\\\"fmt\\\"\\n5| )\\n6| \\n7| func funcA() int {\\n8| \\tdefer func() {\\n9| \\tdefer func() {\\n10| \\t\\tx += 1\\n11| \\t}()\\n12| \\treturn x\\n13| }\\n14| \\n15| func funcB() (x int) {\\n16| \\tdefer func() {\\n17| \\t\\tx += 1\\n18| \\t}()\\n```\\n\\n```\\n0| package main\\n1| package main\\n2| \\n3| import (\\n4| \\t\\\"fmt\\\"\\n5| )\\n6| \\n7| func funcA() int {\\n8| \\tx := 5\\n9| \\tdefer func() {\\n10| \\t\\tx += 1\\n```\\n\\n```\\n4| \\t\\\"fmt\\\"\\n5| )\\n6| \\n7| func funcA() int {\\n8| \\tx := 5\\n9| \\tdefer func() {\\n10| \\t\\tx += 1\\n11| \\t}()\\n12| \\treturn x\\n13| }\\n14| func funcB() (x int) {\\n15| func funcB() (x int) {\\n16| \\tdefer func() {\\n17| \\t\\tx += 1\\n18| \\t}()\\n19| \\treturn 5\\n20| }\\n21| \\n22| func funcC() (y int) {\\n23| \\tx := 5\\n24| \\tdefer func() {\\n```\\n\\n```\\n5| )\\n6| \\n7| func funcA() int {\\n8| \\tx := 5\\n9| \\tdefer func() {\\n10| \\t\\tx += 1\\n11| \\t}()\\n12| \\treturn x\\n13| }\\n14| \\n15| \\tdefer func() {\\n16| \\tdefer func() {\\n17| \\t\\tx += 1\\n18| \\t}()\\n19| \\treturn 5\\n20| }\\n21| \\n22| func funcC() (y int) {\\n23| \\tx := 5\\n24| \\tdefer func() {\\n25| \\t\\tx += 1\\n```\\n\\n```\\n11| \\t}()\\n12| \\treturn x\\n13| }\\n14| \\n15| func funcB() (x int) {\\n16| \\tdefer func() {\\n17| \\t\\tx += 1\\n18| \\t}()\\n19| \\treturn 5\\n20| }\\n21| func funcC() (y int) {\\n22| func funcC() (y int) {\\n23| \\tx := 5\\n24| \\tdefer func() {\\n25| \\t\\tx += 1\\n26| \\t}()\\n27| \\treturn x\\n28| }\\n29| \\n30| func funcD() (x int) {\\n31| \\tdefer func(x int) {\\n```\\n\\n```\\n13| }\\n14| \\n15| func funcB() (x int) {\\n16| \\tdefer func() {\\n17| \\t\\tx += 1\\n18| \\t}()\\n19| \\treturn 5\\n20| }\\n21| \\n22| func funcC() (y int) {\\n23| \\tdefer func() {\\n24| \\tdefer func() {\\n25| \\t\\tx += 1\\n26| \\t}()\\n27| \\treturn x\\n28| }\\n29| \\n30| func funcD() (x int) {\\n31| \\tdefer func(x int) {\\n32| \\t\\tx += 1\\n33| \\t}(x)\\n```\\n\\n```\\n19| \\treturn 5\\n20| }\\n21| \\n22| func funcC() (y int) {\\n23| \\tx := 5\\n24| \\tdefer func() {\\n25| \\t\\tx += 1\\n26| \\t}()\\n27| \\treturn x\\n28| }\\n29| func funcD() (x int) {\\n30| func funcD() (x int) {\\n31| \\tdefer func(x int) {\\n32| \\t\\tx += 1\\n33| \\t}(x)\\n34| \\treturn 5\\n35| }\\n36| \\n37| func main() {\\n38| \\t//fmt.Println(funcA())\\n39| \\t//fmt.Println(funcB())\\n```\\n\\n```\\n20| }\\n21| \\n22| func funcC() (y int) {\\n23| \\tx := 5\\n24| \\tdefer func() {\\n25| \\t\\tx += 1\\n26| \\t}()\\n27| \\treturn x\\n28| }\\n29| \\n30| \\tdefer func(x int) {\\n31| \\tdefer func(x int) {\\n32| \\t\\tx += 1\\n33| \\t}(x)\\n34| \\treturn 5\\n35| }\\n36| \\n37| func main() {\\n38| \\t//fmt.Println(funcA())\\n39| \\t//fmt.Println(funcB())\\n40| \\t//fmt.Println(funcC())\\n```\\n\\n## Result 4: github.com/Zhouchaowen/golang-tutorial/12-library/8-error/ch_1/main.go\\n\\nURL: /github.com/Zhouchaowen/golang-tutorial/-/blob/12-library/8-error/ch_1/main.go\\n\\n```\\n5| \\t\\\"fmt\\\"\\n6| )\\n7| \\n8| func func1() error {\\n9| \\treturn errors.New(\\\"func1 error\\\")\\n10| }\\n11| \\n12| func func2() error {\\n13| \\treturn fmt.Errorf(\\\"func2 error: %w\\\", func1())\\n14| }\\n15| func main() {\\n16| func main() {\\n17| \\terr := func2()\\n18| \\tif err != nil {\\n19| \\t\\tfmt.Println(err)\\n20| \\t}\\n21| }\\n22| \\n```\\n\\n\",\"tool_call_id\":\"TestCoderAgent/openrouter-kimi-k2/sourcegraph_tool-2\",\"role\":\"tool\"}],\"model\":\"moonshotai/kimi-k2-0905\",\"max_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"usage\":{\"include\":true},\"stream\":true}" headers: Accept: - application/json @@ -178,149 +241,207 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":"Found"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" "},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":"30"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" Go"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" repositories"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" with"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" `"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":"func"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" main"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":"`"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" definitions"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":"."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" The"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" search"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" results"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" show"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" various"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" Go"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" programs"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" with"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" main"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" functions"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":","},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" including"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":":\n\n"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":"1"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":"."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" **"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":"Stack"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":"Found "},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" growth"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":"30"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" examples"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":"+"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":"**"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":" repositories"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" -"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":" with"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" Go"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":" `"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" training"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":"func"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" code"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":" main"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" demonstrating"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":"()`"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" memory"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":" in"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":"/stack"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":" Go"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" operations"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":" code"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":"\n"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":"."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":"2"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":" The"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":"."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":" search"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" **"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":" returned"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":"Function"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":" examples"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" tutorials"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":" from"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":"**"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":" various"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" -"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":" Go"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" Basic"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":" training"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" Go"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":" repositories"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" function"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":" and"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" examples"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":" tutorials"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" \n"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":","},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":"3"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":" showing"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":"."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":" different"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" **"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":" patterns"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":"Defer"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":" like"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" examples"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":" defer"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":"**"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":" usage"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" -"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":","},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" Go"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":" error"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" defer"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":" handling"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" statement"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":","},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" usage"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":" and"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" patterns"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":" basic"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":"\n"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":" function"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":"4"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":" calls"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":"."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":"."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" **"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":" The"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":"Error"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":" results"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" handling"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":" include"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":"**"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":" repositories"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" -"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":" from"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" Go"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":" organizations"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" error"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":" like"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" handling"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":" `"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" patterns"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":"yan"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":"\n\n"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":"fe"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":"The"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":"iz"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" results"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":"hang"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" show"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":"/go"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" typical"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":"-training"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" Go"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":"`,"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" program"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":" `"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" entry"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":"G"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" points"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":"olang"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" with"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":"UA"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" `"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":"/go"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":"func"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":"-training"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" main"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":"`,"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":"()`"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":" and"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" declarations"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":" others"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" across"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":" focused"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" educational"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":" on"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" and"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":" Go"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" training"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":" education"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":" repositories"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":"."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":"."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]} - data: {"id":"gen-1759337000-0RCSUxbZd6O5rFsT6x8e","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337000,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":10157,"completion_tokens":71,"total_tokens":10228,"cost":0.0062717,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0060942,"upstream_inference_completions_cost":0.0001775},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} + data: {"id":"gen-1759338220-seNkf1JEOeVrstsjgdbc","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338220,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":13570,"completion_tokens":99,"total_tokens":13669,"cost":0.00565075,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.005428,"upstream_inference_completions_cost":0.00022275},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} data: [DONE] @@ -329,4 +450,4 @@ interactions: - text/event-stream status: 200 OK code: 200 - duration: 1.040289417s + duration: 2.03913325s diff --git a/internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/update_a_file.yaml b/internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/update_a_file.yaml index 7405a20d571515835c9d3807f211c57d2d555299..067983ac724dbdd0decb8debd22576780add51fb 100644 --- a/internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/update_a_file.yaml +++ b/internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/update_a_file.yaml @@ -24,19 +24,19 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"gen-1759336941-eKJFGe3QKidxTmheiO6r","provider":"Alibaba","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336941,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null} + data: {"id":"gen-1759338148-cW7pABU0qeaLg0NwSX1d","provider":"Novita","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338149,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - data: {"id":"gen-1759336941-eKJFGe3QKidxTmheiO6r","provider":"Alibaba","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336941,"choices":[{"index":0,"delta":{"role":"assistant","content":"Update"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null} + data: {"id":"gen-1759338148-cW7pABU0qeaLg0NwSX1d","provider":"Novita","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338149,"choices":[{"index":0,"delta":{"role":"assistant","content":"Update"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - data: {"id":"gen-1759336941-eKJFGe3QKidxTmheiO6r","provider":"Alibaba","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336941,"choices":[{"index":0,"delta":{"role":"assistant","content":" main.go to print"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null} + data: {"id":"gen-1759338148-cW7pABU0qeaLg0NwSX1d","provider":"Novita","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338149,"choices":[{"index":0,"delta":{"role":"assistant","content":" main.go to print"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - data: {"id":"gen-1759336941-eKJFGe3QKidxTmheiO6r","provider":"Alibaba","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336941,"choices":[{"index":0,"delta":{"role":"assistant","content":" hello"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null} + data: {"id":"gen-1759338148-cW7pABU0qeaLg0NwSX1d","provider":"Novita","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338149,"choices":[{"index":0,"delta":{"role":"assistant","content":" hello"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - data: {"id":"gen-1759336941-eKJFGe3QKidxTmheiO6r","provider":"Alibaba","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336941,"choices":[{"index":0,"delta":{"role":"assistant","content":" from crush"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":null} + data: {"id":"gen-1759338148-cW7pABU0qeaLg0NwSX1d","provider":"Novita","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338149,"choices":[{"index":0,"delta":{"role":"assistant","content":" from crush"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - data: {"id":"gen-1759336941-eKJFGe3QKidxTmheiO6r","provider":"Alibaba","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336941,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}],"system_fingerprint":null} + data: {"id":"gen-1759338148-cW7pABU0qeaLg0NwSX1d","provider":"Novita","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338149,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}],"system_fingerprint":""} - data: {"id":"gen-1759336941-eKJFGe3QKidxTmheiO6r","provider":"Alibaba","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759336941,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":126,"completion_tokens":8,"total_tokens":134,"cost":0.000079,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.000063,"upstream_inference_completions_cost":0.000016},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} + data: {"id":"gen-1759338148-cW7pABU0qeaLg0NwSX1d","provider":"Novita","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338149,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":126,"completion_tokens":8,"total_tokens":134,"cost":0.0000309,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0000189,"upstream_inference_completions_cost":0.000012},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} data: [DONE] @@ -45,15 +45,15 @@ interactions: - text/event-stream status: 200 OK code: 200 - duration: 1.853033542s + duration: 1.320866667s - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 30626 + content_length: 30699 host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/update_a_file\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"update the main.go file by changing the print to say hello from crush\",\"role\":\"user\"}],\"model\":\"moonshotai/kimi-k2-0905\",\"max_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"usage\":{\"include\":true},\"stream\":true}" + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/update_a_file\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"update the main.go file by changing the print to say hello from crush\",\"role\":\"user\"}],\"model\":\"moonshotai/kimi-k2-0905\",\"max_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"usage\":{\"include\":true},\"stream\":true}" headers: Accept: - application/json @@ -69,97 +69,61 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"gen-1759336941-xOhC4n5VYcLL0qtV4HqG","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336941,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338149-DPl8vzYjs1GDhaz7L4fq","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338149,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336941-xOhC4n5VYcLL0qtV4HqG","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336941,"choices":[{"index":0,"delta":{"role":"assistant","content":"I'll"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338149-DPl8vzYjs1GDhaz7L4fq","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338149,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"view:0","type":"function","function":{"name":"view","arguments":""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336941-xOhC4n5VYcLL0qtV4HqG","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336941,"choices":[{"index":0,"delta":{"role":"assistant","content":" update"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338149-DPl8vzYjs1GDhaz7L4fq","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338149,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"{\""},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336941-xOhC4n5VYcLL0qtV4HqG","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336941,"choices":[{"index":0,"delta":{"role":"assistant","content":" the"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338149-DPl8vzYjs1GDhaz7L4fq","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338149,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"file"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336941-xOhC4n5VYcLL0qtV4HqG","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336941,"choices":[{"index":0,"delta":{"role":"assistant","content":" main"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338149-DPl8vzYjs1GDhaz7L4fq","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338149,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"_path"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336941-xOhC4n5VYcLL0qtV4HqG","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336941,"choices":[{"index":0,"delta":{"role":"assistant","content":".go"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338149-DPl8vzYjs1GDhaz7L4fq","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338149,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"\":"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336941-xOhC4n5VYcLL0qtV4HqG","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336941,"choices":[{"index":0,"delta":{"role":"assistant","content":" file"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338149-DPl8vzYjs1GDhaz7L4fq","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338149,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":" \"/"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336941-xOhC4n5VYcLL0qtV4HqG","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336941,"choices":[{"index":0,"delta":{"role":"assistant","content":" to"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338149-DPl8vzYjs1GDhaz7L4fq","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338149,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"tmp"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336941-xOhC4n5VYcLL0qtV4HqG","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336941,"choices":[{"index":0,"delta":{"role":"assistant","content":" change"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338149-DPl8vzYjs1GDhaz7L4fq","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338149,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"/c"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336941-xOhC4n5VYcLL0qtV4HqG","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336941,"choices":[{"index":0,"delta":{"role":"assistant","content":" the"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338149-DPl8vzYjs1GDhaz7L4fq","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338149,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"rush"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336941-xOhC4n5VYcLL0qtV4HqG","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336941,"choices":[{"index":0,"delta":{"role":"assistant","content":" print"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338149-DPl8vzYjs1GDhaz7L4fq","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338149,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"-test"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336941-xOhC4n5VYcLL0qtV4HqG","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336941,"choices":[{"index":0,"delta":{"role":"assistant","content":" statement"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338149-DPl8vzYjs1GDhaz7L4fq","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338149,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"/Test"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336941-xOhC4n5VYcLL0qtV4HqG","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336941,"choices":[{"index":0,"delta":{"role":"assistant","content":" to"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338149-DPl8vzYjs1GDhaz7L4fq","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338149,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"Coder"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336941-xOhC4n5VYcLL0qtV4HqG","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336941,"choices":[{"index":0,"delta":{"role":"assistant","content":" say"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338149-DPl8vzYjs1GDhaz7L4fq","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338149,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"Agent"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336941-xOhC4n5VYcLL0qtV4HqG","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336941,"choices":[{"index":0,"delta":{"role":"assistant","content":" \""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338149-DPl8vzYjs1GDhaz7L4fq","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338149,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"/open"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336941-xOhC4n5VYcLL0qtV4HqG","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336941,"choices":[{"index":0,"delta":{"role":"assistant","content":"hello"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338149-DPl8vzYjs1GDhaz7L4fq","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338149,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"router"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336941-xOhC4n5VYcLL0qtV4HqG","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336941,"choices":[{"index":0,"delta":{"role":"assistant","content":" from"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338149-DPl8vzYjs1GDhaz7L4fq","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338149,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"-k"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336941-xOhC4n5VYcLL0qtV4HqG","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336941,"choices":[{"index":0,"delta":{"role":"assistant","content":" crush"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338149-DPl8vzYjs1GDhaz7L4fq","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338149,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"imi"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336941-xOhC4n5VYcLL0qtV4HqG","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336941,"choices":[{"index":0,"delta":{"role":"assistant","content":"\"."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338149-DPl8vzYjs1GDhaz7L4fq","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338149,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"-k"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336941-xOhC4n5VYcLL0qtV4HqG","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336941,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"functions.view:0","type":"function","function":{"name":"view","arguments":""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338149-DPl8vzYjs1GDhaz7L4fq","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338149,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"2"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336941-xOhC4n5VYcLL0qtV4HqG","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336941,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"{\""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338149-DPl8vzYjs1GDhaz7L4fq","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338149,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"/update"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336941-xOhC4n5VYcLL0qtV4HqG","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336941,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"file"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338149-DPl8vzYjs1GDhaz7L4fq","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338149,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"_a"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336941-xOhC4n5VYcLL0qtV4HqG","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336941,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"_path"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338149-DPl8vzYjs1GDhaz7L4fq","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338149,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"_file"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336941-xOhC4n5VYcLL0qtV4HqG","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336941,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338149-DPl8vzYjs1GDhaz7L4fq","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338149,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"/main"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336941-xOhC4n5VYcLL0qtV4HqG","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336941,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":" \"/"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338149-DPl8vzYjs1GDhaz7L4fq","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338149,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":".go"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336941-xOhC4n5VYcLL0qtV4HqG","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336941,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"tmp"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338149-DPl8vzYjs1GDhaz7L4fq","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338149,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"\"}"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336941-xOhC4n5VYcLL0qtV4HqG","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336941,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"/c"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338149-DPl8vzYjs1GDhaz7L4fq","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338149,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"tool_calls","native_finish_reason":"tool_calls","logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336941-xOhC4n5VYcLL0qtV4HqG","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336941,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"rush"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759336941-xOhC4n5VYcLL0qtV4HqG","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336941,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"-test"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759336941-xOhC4n5VYcLL0qtV4HqG","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336941,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"/Test"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759336941-xOhC4n5VYcLL0qtV4HqG","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336941,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"Coder"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759336941-xOhC4n5VYcLL0qtV4HqG","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336941,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"Agent"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759336941-xOhC4n5VYcLL0qtV4HqG","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336941,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"/open"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759336941-xOhC4n5VYcLL0qtV4HqG","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336941,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"router"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759336941-xOhC4n5VYcLL0qtV4HqG","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336941,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"-k"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759336941-xOhC4n5VYcLL0qtV4HqG","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336941,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"imi"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759336941-xOhC4n5VYcLL0qtV4HqG","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336941,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"-k"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759336941-xOhC4n5VYcLL0qtV4HqG","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336941,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"2"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759336941-xOhC4n5VYcLL0qtV4HqG","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336941,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"/update"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759336941-xOhC4n5VYcLL0qtV4HqG","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336941,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"_a"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759336941-xOhC4n5VYcLL0qtV4HqG","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336941,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"_file"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759336941-xOhC4n5VYcLL0qtV4HqG","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336941,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"/main"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759336941-xOhC4n5VYcLL0qtV4HqG","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336941,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":".go"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759336941-xOhC4n5VYcLL0qtV4HqG","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336941,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"\"}"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759336941-xOhC4n5VYcLL0qtV4HqG","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336941,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"tool_calls","native_finish_reason":"tool_calls","logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759336941-xOhC4n5VYcLL0qtV4HqG","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336941,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":7295,"completion_tokens":51,"total_tokens":7346,"cost":0.00302,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.002918,"upstream_inference_completions_cost":0.000102},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} + data: {"id":"gen-1759338149-DPl8vzYjs1GDhaz7L4fq","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338149,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":7579,"completion_tokens":33,"total_tokens":7612,"cost":0.0046299,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0045474,"upstream_inference_completions_cost":0.0000825},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} data: [DONE] @@ -168,15 +132,15 @@ interactions: - text/event-stream status: 200 OK code: 200 - duration: 2.512202583s + duration: 2.55651475s - id: 2 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 31221 + content_length: 31194 host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/update_a_file\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"update the main.go file by changing the print to say hello from crush\",\"role\":\"user\"},{\"content\":\"I'll update the main.go file to change the print statement to say \\\"hello from crush\\\".\",\"tool_calls\":[{\"id\":\"TestCoderAgent/openrouter-kimi-k2/update_a_file-1\",\"function\":{\"arguments\":\"{\\\"file_path\\\": \\\"/tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/update_a_file/main.go\\\"}\",\"name\":\"view\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"\\n 1|package main\\n 2|\\n 3|import \\\"fmt\\\"\\n 4|\\n 5|func main() {\\n 6|\\tfmt.Println(\\\"Hello, World!\\\")\\n 7|}\\n\\n\",\"tool_call_id\":\"TestCoderAgent/openrouter-kimi-k2/update_a_file-1\",\"role\":\"tool\"}],\"model\":\"moonshotai/kimi-k2-0905\",\"max_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"usage\":{\"include\":true},\"stream\":true}" + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/update_a_file\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"update the main.go file by changing the print to say hello from crush\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"TestCoderAgent/openrouter-kimi-k2/update_a_file-1\",\"function\":{\"arguments\":\"{\\\"file_path\\\": \\\"/tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/update_a_file/main.go\\\"}\",\"name\":\"view\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"\\n 1|package main\\n 2|\\n 3|import \\\"fmt\\\"\\n 4|\\n 5|func main() {\\n 6|\\tfmt.Println(\\\"Hello, World!\\\")\\n 7|}\\n\\n\",\"tool_call_id\":\"TestCoderAgent/openrouter-kimi-k2/update_a_file-1\",\"role\":\"tool\"}],\"model\":\"moonshotai/kimi-k2-0905\",\"max_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"usage\":{\"include\":true},\"stream\":true}" headers: Accept: - application/json @@ -192,121 +156,121 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"gen-1759336948-mQPNn53PpU1qtgyoDxS0","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336948,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338153-QpfDcel5gSt51UWX9IUC","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338153,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336948-mQPNn53PpU1qtgyoDxS0","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336948,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"functions.edit:1","type":"function","function":{"name":"edit"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338153-QpfDcel5gSt51UWX9IUC","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338153,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"edit:1","type":"function","function":{"name":"edit","arguments":""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336948-mQPNn53PpU1qtgyoDxS0","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336948,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"{\""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338153-QpfDcel5gSt51UWX9IUC","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338153,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"{\""},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336948-mQPNn53PpU1qtgyoDxS0","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336948,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"file"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338153-QpfDcel5gSt51UWX9IUC","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338153,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"file"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336948-mQPNn53PpU1qtgyoDxS0","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336948,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"_path"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338153-QpfDcel5gSt51UWX9IUC","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338153,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"_path"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336948-mQPNn53PpU1qtgyoDxS0","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336948,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338153-QpfDcel5gSt51UWX9IUC","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338153,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"\":"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336948-mQPNn53PpU1qtgyoDxS0","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336948,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":" \"/"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338153-QpfDcel5gSt51UWX9IUC","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338153,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":" \"/"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336948-mQPNn53PpU1qtgyoDxS0","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336948,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"tmp"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338153-QpfDcel5gSt51UWX9IUC","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338153,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"tmp"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336948-mQPNn53PpU1qtgyoDxS0","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336948,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"/c"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338153-QpfDcel5gSt51UWX9IUC","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338153,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"/c"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336948-mQPNn53PpU1qtgyoDxS0","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336948,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"rush"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338153-QpfDcel5gSt51UWX9IUC","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338153,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"rush"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336948-mQPNn53PpU1qtgyoDxS0","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336948,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"-test"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338153-QpfDcel5gSt51UWX9IUC","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338153,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"-test"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336948-mQPNn53PpU1qtgyoDxS0","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336948,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"/Test"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338153-QpfDcel5gSt51UWX9IUC","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338153,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"/Test"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336948-mQPNn53PpU1qtgyoDxS0","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336948,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"Coder"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338153-QpfDcel5gSt51UWX9IUC","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338153,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"Coder"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336948-mQPNn53PpU1qtgyoDxS0","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336948,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"Agent"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338153-QpfDcel5gSt51UWX9IUC","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338153,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"Agent"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336948-mQPNn53PpU1qtgyoDxS0","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336948,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"/open"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338153-QpfDcel5gSt51UWX9IUC","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338153,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"/open"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336948-mQPNn53PpU1qtgyoDxS0","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336948,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"router"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338153-QpfDcel5gSt51UWX9IUC","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338153,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"router"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336948-mQPNn53PpU1qtgyoDxS0","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336948,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"-k"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338153-QpfDcel5gSt51UWX9IUC","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338153,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"-k"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336948-mQPNn53PpU1qtgyoDxS0","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336948,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"imi"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338153-QpfDcel5gSt51UWX9IUC","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338153,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"imi"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336948-mQPNn53PpU1qtgyoDxS0","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336948,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"-k"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338153-QpfDcel5gSt51UWX9IUC","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338153,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"-k"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336948-mQPNn53PpU1qtgyoDxS0","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336948,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"2"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338153-QpfDcel5gSt51UWX9IUC","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338153,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"2"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336948-mQPNn53PpU1qtgyoDxS0","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336948,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"/update"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338153-QpfDcel5gSt51UWX9IUC","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338153,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"/update"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336948-mQPNn53PpU1qtgyoDxS0","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336948,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"_a"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338153-QpfDcel5gSt51UWX9IUC","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338153,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"_a"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336948-mQPNn53PpU1qtgyoDxS0","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336948,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"_file"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338153-QpfDcel5gSt51UWX9IUC","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338153,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"_file"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336948-mQPNn53PpU1qtgyoDxS0","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336948,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"/main"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338153-QpfDcel5gSt51UWX9IUC","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338153,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"/main"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336948-mQPNn53PpU1qtgyoDxS0","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336948,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":".go"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338153-QpfDcel5gSt51UWX9IUC","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338153,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":".go"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336948-mQPNn53PpU1qtgyoDxS0","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336948,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"\","}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338153-QpfDcel5gSt51UWX9IUC","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338153,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"\","},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336948-mQPNn53PpU1qtgyoDxS0","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336948,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":" \""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338153-QpfDcel5gSt51UWX9IUC","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338153,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":" \""},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336948-mQPNn53PpU1qtgyoDxS0","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336948,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"old"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338153-QpfDcel5gSt51UWX9IUC","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338153,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"old"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336948-mQPNn53PpU1qtgyoDxS0","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336948,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"_string"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338153-QpfDcel5gSt51UWX9IUC","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338153,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"_string"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336948-mQPNn53PpU1qtgyoDxS0","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336948,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338153-QpfDcel5gSt51UWX9IUC","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338153,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"\":"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336948-mQPNn53PpU1qtgyoDxS0","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336948,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":" \"\\"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338153-QpfDcel5gSt51UWX9IUC","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338153,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":" \"\\"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336948-mQPNn53PpU1qtgyoDxS0","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336948,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"tf"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338153-QpfDcel5gSt51UWX9IUC","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338153,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"tf"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336948-mQPNn53PpU1qtgyoDxS0","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336948,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"mt"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338153-QpfDcel5gSt51UWX9IUC","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338153,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"mt"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336948-mQPNn53PpU1qtgyoDxS0","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336948,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":".Println"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338153-QpfDcel5gSt51UWX9IUC","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338153,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":".Println"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336948-mQPNn53PpU1qtgyoDxS0","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336948,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"(\\\""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338153-QpfDcel5gSt51UWX9IUC","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338153,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"(\\\""},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336948-mQPNn53PpU1qtgyoDxS0","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336948,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"Hello"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338153-QpfDcel5gSt51UWX9IUC","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338153,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"Hello"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336948-mQPNn53PpU1qtgyoDxS0","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336948,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":","}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338153-QpfDcel5gSt51UWX9IUC","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338153,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":","},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336948-mQPNn53PpU1qtgyoDxS0","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336948,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":" World"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338153-QpfDcel5gSt51UWX9IUC","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338153,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":" World"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336948-mQPNn53PpU1qtgyoDxS0","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336948,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"!\\"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338153-QpfDcel5gSt51UWX9IUC","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338153,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"!\\"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336948-mQPNn53PpU1qtgyoDxS0","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336948,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"\")"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338153-QpfDcel5gSt51UWX9IUC","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338153,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"\")"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336948-mQPNn53PpU1qtgyoDxS0","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336948,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"\","}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338153-QpfDcel5gSt51UWX9IUC","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338153,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"\","},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336948-mQPNn53PpU1qtgyoDxS0","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336948,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":" \""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338153-QpfDcel5gSt51UWX9IUC","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338153,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":" \""},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336948-mQPNn53PpU1qtgyoDxS0","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336948,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"new"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338153-QpfDcel5gSt51UWX9IUC","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338153,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"new"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336948-mQPNn53PpU1qtgyoDxS0","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336948,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"_string"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338153-QpfDcel5gSt51UWX9IUC","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338153,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"_string"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336948-mQPNn53PpU1qtgyoDxS0","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336948,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338153-QpfDcel5gSt51UWX9IUC","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338153,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"\":"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336948-mQPNn53PpU1qtgyoDxS0","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336948,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":" \"\\"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338153-QpfDcel5gSt51UWX9IUC","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338153,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":" \"\\"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336948-mQPNn53PpU1qtgyoDxS0","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336948,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"tf"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338153-QpfDcel5gSt51UWX9IUC","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338153,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"tf"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336948-mQPNn53PpU1qtgyoDxS0","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336948,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"mt"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338153-QpfDcel5gSt51UWX9IUC","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338153,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"mt"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336948-mQPNn53PpU1qtgyoDxS0","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336948,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":".Println"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338153-QpfDcel5gSt51UWX9IUC","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338153,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":".Println"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336948-mQPNn53PpU1qtgyoDxS0","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336948,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"(\\\""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338153-QpfDcel5gSt51UWX9IUC","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338153,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"(\\\""},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336948-mQPNn53PpU1qtgyoDxS0","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336948,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"hello"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338153-QpfDcel5gSt51UWX9IUC","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338153,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"Hello"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336948-mQPNn53PpU1qtgyoDxS0","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336948,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":" from"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338153-QpfDcel5gSt51UWX9IUC","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338153,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":" from"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336948-mQPNn53PpU1qtgyoDxS0","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336948,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":" crush"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338153-QpfDcel5gSt51UWX9IUC","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338153,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":" Crush"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336948-mQPNn53PpU1qtgyoDxS0","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336948,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"\\\")"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338153-QpfDcel5gSt51UWX9IUC","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338153,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"!\\"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336948-mQPNn53PpU1qtgyoDxS0","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336948,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"\"}"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338153-QpfDcel5gSt51UWX9IUC","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338153,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"\")"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336948-mQPNn53PpU1qtgyoDxS0","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336948,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338153-QpfDcel5gSt51UWX9IUC","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338153,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"function":{"arguments":"\"}"},"type":"function"}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336948-mQPNn53PpU1qtgyoDxS0","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336948,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"tool_calls","native_finish_reason":"tool_calls","logprobs":null}]} + data: {"id":"gen-1759338153-QpfDcel5gSt51UWX9IUC","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338153,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"tool_calls","native_finish_reason":"tool_calls","logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336948-mQPNn53PpU1qtgyoDxS0","provider":"Fireworks","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336948,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":7414,"completion_tokens":63,"total_tokens":7477,"cost":0.0046059,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0044484,"upstream_inference_completions_cost":0.0001575},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} + data: {"id":"gen-1759338153-QpfDcel5gSt51UWX9IUC","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338153,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":7680,"completion_tokens":63,"total_tokens":7743,"cost":0.0047655,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.004608,"upstream_inference_completions_cost":0.0001575},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} data: [DONE] @@ -315,15 +279,15 @@ interactions: - text/event-stream status: 200 OK code: 200 - duration: 1.319622542s + duration: 2.818355625s - id: 3 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 31805 + content_length: 31779 host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/update_a_file\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"update the main.go file by changing the print to say hello from crush\",\"role\":\"user\"},{\"content\":\"I'll update the main.go file to change the print statement to say \\\"hello from crush\\\".\",\"tool_calls\":[{\"id\":\"TestCoderAgent/openrouter-kimi-k2/update_a_file-1\",\"function\":{\"arguments\":\"{\\\"file_path\\\": \\\"/tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/update_a_file/main.go\\\"}\",\"name\":\"view\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"\\n 1|package main\\n 2|\\n 3|import \\\"fmt\\\"\\n 4|\\n 5|func main() {\\n 6|\\tfmt.Println(\\\"Hello, World!\\\")\\n 7|}\\n\\n\",\"tool_call_id\":\"TestCoderAgent/openrouter-kimi-k2/update_a_file-1\",\"role\":\"tool\"},{\"tool_calls\":[{\"id\":\"TestCoderAgent/openrouter-kimi-k2/update_a_file-2\",\"function\":{\"arguments\":\"{\\\"file_path\\\": \\\"/tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/update_a_file/main.go\\\", \\\"old_string\\\": \\\"\\\\tfmt.Println(\\\\\\\"Hello, World!\\\\\\\")\\\", \\\"new_string\\\": \\\"\\\\tfmt.Println(\\\\\\\"hello from crush\\\\\\\")\\\"}\",\"name\":\"edit\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"\\nContent replaced in file: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/update_a_file/main.go\\n\\n\",\"tool_call_id\":\"TestCoderAgent/openrouter-kimi-k2/update_a_file-2\",\"role\":\"tool\"}],\"model\":\"moonshotai/kimi-k2-0905\",\"max_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"usage\":{\"include\":true},\"stream\":true}" + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/update_a_file\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"update the main.go file by changing the print to say hello from crush\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"TestCoderAgent/openrouter-kimi-k2/update_a_file-1\",\"function\":{\"arguments\":\"{\\\"file_path\\\": \\\"/tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/update_a_file/main.go\\\"}\",\"name\":\"view\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"\\n 1|package main\\n 2|\\n 3|import \\\"fmt\\\"\\n 4|\\n 5|func main() {\\n 6|\\tfmt.Println(\\\"Hello, World!\\\")\\n 7|}\\n\\n\",\"tool_call_id\":\"TestCoderAgent/openrouter-kimi-k2/update_a_file-1\",\"role\":\"tool\"},{\"tool_calls\":[{\"id\":\"TestCoderAgent/openrouter-kimi-k2/update_a_file-2\",\"function\":{\"arguments\":\"{\\\"file_path\\\": \\\"/tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/update_a_file/main.go\\\", \\\"old_string\\\": \\\"\\\\tfmt.Println(\\\\\\\"Hello, World!\\\\\\\")\\\", \\\"new_string\\\": \\\"\\\\tfmt.Println(\\\\\\\"Hello from Crush!\\\\\\\")\\\"}\",\"name\":\"edit\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"\\nContent replaced in file: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/update_a_file/main.go\\n\\n\",\"tool_call_id\":\"TestCoderAgent/openrouter-kimi-k2/update_a_file-2\",\"role\":\"tool\"}],\"model\":\"moonshotai/kimi-k2-0905\",\"max_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"usage\":{\"include\":true},\"stream\":true}" headers: Accept: - application/json @@ -339,59 +303,31 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"gen-1759336950-i8X6BzvjeaBpdEU54JlT","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336950,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759336950-i8X6BzvjeaBpdEU54JlT","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336950,"choices":[{"index":0,"delta":{"role":"assistant","content":"Done"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759336950-i8X6BzvjeaBpdEU54JlT","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336950,"choices":[{"index":0,"delta":{"role":"assistant","content":"."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759336950-i8X6BzvjeaBpdEU54JlT","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336950,"choices":[{"index":0,"delta":{"role":"assistant","content":" The"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759336950-i8X6BzvjeaBpdEU54JlT","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336950,"choices":[{"index":0,"delta":{"role":"assistant","content":" main"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759336950-i8X6BzvjeaBpdEU54JlT","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336950,"choices":[{"index":0,"delta":{"role":"assistant","content":".go"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759336950-i8X6BzvjeaBpdEU54JlT","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336950,"choices":[{"index":0,"delta":{"role":"assistant","content":" file"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759336950-i8X6BzvjeaBpdEU54JlT","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336950,"choices":[{"index":0,"delta":{"role":"assistant","content":" has"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759336950-i8X6BzvjeaBpdEU54JlT","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336950,"choices":[{"index":0,"delta":{"role":"assistant","content":" been"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759336950-i8X6BzvjeaBpdEU54JlT","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336950,"choices":[{"index":0,"delta":{"role":"assistant","content":" updated"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759336950-i8X6BzvjeaBpdEU54JlT","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336950,"choices":[{"index":0,"delta":{"role":"assistant","content":" to"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759336950-i8X6BzvjeaBpdEU54JlT","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336950,"choices":[{"index":0,"delta":{"role":"assistant","content":" print"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759336950-i8X6BzvjeaBpdEU54JlT","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336950,"choices":[{"index":0,"delta":{"role":"assistant","content":" \""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759336950-i8X6BzvjeaBpdEU54JlT","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336950,"choices":[{"index":0,"delta":{"role":"assistant","content":"hello"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759336950-i8X6BzvjeaBpdEU54JlT","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336950,"choices":[{"index":0,"delta":{"role":"assistant","content":" from"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338158-zo6o333bSmanhP0O5UuH","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338158,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336950-i8X6BzvjeaBpdEU54JlT","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336950,"choices":[{"index":0,"delta":{"role":"assistant","content":" crush"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338158-zo6o333bSmanhP0O5UuH","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338158,"choices":[{"index":0,"delta":{"role":"assistant","content":"Updated"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336950-i8X6BzvjeaBpdEU54JlT","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336950,"choices":[{"index":0,"delta":{"role":"assistant","content":"\""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338158-zo6o333bSmanhP0O5UuH","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338158,"choices":[{"index":0,"delta":{"role":"assistant","content":" main"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336950-i8X6BzvjeaBpdEU54JlT","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336950,"choices":[{"index":0,"delta":{"role":"assistant","content":" instead"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338158-zo6o333bSmanhP0O5UuH","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338158,"choices":[{"index":0,"delta":{"role":"assistant","content":".go"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336950-i8X6BzvjeaBpdEU54JlT","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336950,"choices":[{"index":0,"delta":{"role":"assistant","content":" of"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338158-zo6o333bSmanhP0O5UuH","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338158,"choices":[{"index":0,"delta":{"role":"assistant","content":" to"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336950-i8X6BzvjeaBpdEU54JlT","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336950,"choices":[{"index":0,"delta":{"role":"assistant","content":" \""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338158-zo6o333bSmanhP0O5UuH","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338158,"choices":[{"index":0,"delta":{"role":"assistant","content":" print"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336950-i8X6BzvjeaBpdEU54JlT","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336950,"choices":[{"index":0,"delta":{"role":"assistant","content":"Hello"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338158-zo6o333bSmanhP0O5UuH","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338158,"choices":[{"index":0,"delta":{"role":"assistant","content":" \""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336950-i8X6BzvjeaBpdEU54JlT","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336950,"choices":[{"index":0,"delta":{"role":"assistant","content":","},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338158-zo6o333bSmanhP0O5UuH","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338158,"choices":[{"index":0,"delta":{"role":"assistant","content":"Hello"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336950-i8X6BzvjeaBpdEU54JlT","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336950,"choices":[{"index":0,"delta":{"role":"assistant","content":" World"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338158-zo6o333bSmanhP0O5UuH","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338158,"choices":[{"index":0,"delta":{"role":"assistant","content":" from"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336950-i8X6BzvjeaBpdEU54JlT","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336950,"choices":[{"index":0,"delta":{"role":"assistant","content":"!"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338158-zo6o333bSmanhP0O5UuH","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338158,"choices":[{"index":0,"delta":{"role":"assistant","content":" Crush"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336950-i8X6BzvjeaBpdEU54JlT","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336950,"choices":[{"index":0,"delta":{"role":"assistant","content":"\"."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338158-zo6o333bSmanhP0O5UuH","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338158,"choices":[{"index":0,"delta":{"role":"assistant","content":"!\""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336950-i8X6BzvjeaBpdEU54JlT","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336950,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338158-zo6o333bSmanhP0O5UuH","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338158,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}],"system_fingerprint":"fpv0_ef28f882"} - data: {"id":"gen-1759336950-i8X6BzvjeaBpdEU54JlT","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759336950,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":7548,"completion_tokens":24,"total_tokens":7572,"cost":0.0030672,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0030192,"upstream_inference_completions_cost":0.000048},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} + data: {"id":"gen-1759338158-zo6o333bSmanhP0O5UuH","provider":"Moonshot AI","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338158,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":7790,"completion_tokens":11,"total_tokens":7801,"cost":0.0047015,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.004674,"upstream_inference_completions_cost":0.0000275},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} data: [DONE] @@ -400,4 +336,4 @@ interactions: - text/event-stream status: 200 OK code: 200 - duration: 2.186907958s + duration: 1.864724084s diff --git a/internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/write_tool.yaml b/internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/write_tool.yaml index 4a67c3fb0aaa11ceb4813cc422df17b0649d8404..e74aa94d8a2a434f9fde0d64a17ddcbb675062d4 100644 --- a/internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/write_tool.yaml +++ b/internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/write_tool.yaml @@ -6,9 +6,9 @@ interactions: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 765 + content_length: 30736 host: "" - body: '{"messages":[{"content":"you will generate a short title based on the first message a user begins a conversation with\n\n- ensure it is not more than 50 characters long\n- the title should be a summary of the user''s message\n- it should be one line long\n- do not use quotes or colons\n- the entire text you return will be used as the title\n- never return anything that is more than one sentence (one line) long\n","role":"system"},{"content":"Generate a concise title for the following content:\n\nuse write to create a new file called config.json with content ''{\"name\": \"test\", \"version\": \"1.0.0\"}''","role":"user"}],"model":"qwen/qwen3-next-80b-a3b-instruct","max_tokens":40,"stream_options":{"include_usage":true},"usage":{"include":true},"stream":true}' + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/write_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use write to create a new file called config.json with content '{\\\"name\\\": \\\"test\\\", \\\"version\\\": \\\"1.0.0\\\"}'\",\"role\":\"user\"}],\"model\":\"moonshotai/kimi-k2-0905\",\"max_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"usage\":{\"include\":true},\"stream\":true}" headers: Accept: - application/json @@ -24,17 +24,13 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"gen-1759337002-oAScgSzxJkcUOTEYMDuy","provider":"GMICloud","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759337002,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - - data: {"id":"gen-1759337002-oAScgSzxJkcUOTEYMDuy","provider":"GMICloud","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759337002,"choices":[{"index":0,"delta":{"role":"assistant","content":"Create"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - - data: {"id":"gen-1759337002-oAScgSzxJkcUOTEYMDuy","provider":"GMICloud","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759337002,"choices":[{"index":0,"delta":{"role":"assistant","content":" config.json with sample"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338228-SOzN4B9tZRtFsb5XWxmb","provider":"Groq","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338228,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fp_6e6ff3688b"} - data: {"id":"gen-1759337002-oAScgSzxJkcUOTEYMDuy","provider":"GMICloud","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759337002,"choices":[{"index":0,"delta":{"role":"assistant","content":" JSON content"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} + data: {"id":"gen-1759338228-SOzN4B9tZRtFsb5XWxmb","provider":"Groq","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338228,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":"functions.write:0","type":"function","function":{"name":"write","arguments":"{\"content\":\"{\\\"name\\\": \\\"test\\\", \\\"like\\\": \\\"1.0.0\\\"}\",\"file_path\":\"/tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/write_tool/config.json\"}"},"index":0}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fp_6e6ff3688b"} - data: {"id":"gen-1759337002-oAScgSzxJkcUOTEYMDuy","provider":"GMICloud","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759337002,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]} + data: {"id":"gen-1759338228-SOzN4B9tZRtFsb5XWxmb","provider":"Groq","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338228,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"tool_calls","native_finish_reason":"tool_calls","logprobs":null}],"system_fingerprint":"fp_6e6ff3688b"} - data: {"id":"gen-1759337002-oAScgSzxJkcUOTEYMDuy","provider":"GMICloud","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759337002,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":141,"completion_tokens":8,"total_tokens":149,"cost":0.00003315,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.00002115,"upstream_inference_completions_cost":0.000012},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} + data: {"id":"gen-1759338228-SOzN4B9tZRtFsb5XWxmb","provider":"Groq","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338228,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":8159,"completion_tokens":54,"total_tokens":8213,"cost":0.004353,"is_byok":false,"prompt_tokens_details":{"cached_tokens":7936,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.004191,"upstream_inference_completions_cost":0.000162},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} data: [DONE] @@ -43,15 +39,15 @@ interactions: - text/event-stream status: 200 OK code: 200 - duration: 1.260181833s + duration: 656.490542ms - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 30663 + content_length: 31268 host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/write_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use write to create a new file called config.json with content '{\\\"name\\\": \\\"test\\\", \\\"version\\\": \\\"1.0.0\\\"}'\",\"role\":\"user\"}],\"model\":\"moonshotai/kimi-k2-0905\",\"max_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"usage\":{\"include\":true},\"stream\":true}" + body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/write_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use write to create a new file called config.json with content '{\\\"name\\\": \\\"test\\\", \\\"version\\\": \\\"1.0.0\\\"}'\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"TestCoderAgent/openrouter-kimi-k2/write_tool-1\",\"function\":{\"arguments\":\"{\\\"content\\\":\\\"{\\\\\\\"name\\\\\\\": \\\\\\\"test\\\\\\\", \\\\\\\"like\\\\\\\": \\\\\\\"1.0.0\\\\\\\"}\\\",\\\"file_path\\\":\\\"/tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/write_tool/config.json\\\"}\",\"name\":\"write\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"\\nFile successfully written: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/write_tool/config.json\\n\",\"tool_call_id\":\"TestCoderAgent/openrouter-kimi-k2/write_tool-1\",\"role\":\"tool\"}],\"model\":\"moonshotai/kimi-k2-0905\",\"max_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"depth\":{\"description\":\"The maximum depth to traverse\",\"type\":\"integer\"},\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"usage\":{\"include\":true},\"stream\":true}" headers: Accept: - application/json @@ -67,101 +63,23 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"gen-1759337002-c1HqLPPkeN9JK2Oin5lw","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337002,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759337002-c1HqLPPkeN9JK2Oin5lw","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337002,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"functions.write:0","type":"function","function":{"name":"write","arguments":""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759337002-c1HqLPPkeN9JK2Oin5lw","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337002,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"{\""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759337002-c1HqLPPkeN9JK2Oin5lw","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337002,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"file"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759337002-c1HqLPPkeN9JK2Oin5lw","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337002,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"_path"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759337002-c1HqLPPkeN9JK2Oin5lw","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337002,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759337002-c1HqLPPkeN9JK2Oin5lw","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337002,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":" \"/"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759337002-c1HqLPPkeN9JK2Oin5lw","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337002,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"tmp"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759337002-c1HqLPPkeN9JK2Oin5lw","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337002,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"/c"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759337002-c1HqLPPkeN9JK2Oin5lw","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337002,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"rush"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759337002-c1HqLPPkeN9JK2Oin5lw","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337002,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"-test"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759337002-c1HqLPPkeN9JK2Oin5lw","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337002,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"/Test"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759337002-c1HqLPPkeN9JK2Oin5lw","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337002,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"Coder"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759337002-c1HqLPPkeN9JK2Oin5lw","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337002,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"Agent"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759337002-c1HqLPPkeN9JK2Oin5lw","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337002,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"/open"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759337002-c1HqLPPkeN9JK2Oin5lw","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337002,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"router"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759337002-c1HqLPPkeN9JK2Oin5lw","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337002,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"-k"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759337002-c1HqLPPkeN9JK2Oin5lw","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337002,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"imi"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759337002-c1HqLPPkeN9JK2Oin5lw","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337002,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"-k"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759337002-c1HqLPPkeN9JK2Oin5lw","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337002,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"2"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759337002-c1HqLPPkeN9JK2Oin5lw","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337002,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"/write"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759337002-c1HqLPPkeN9JK2Oin5lw","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337002,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"_tool"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759337002-c1HqLPPkeN9JK2Oin5lw","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337002,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"/config"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338228-mFceGfrHdCwDhSgkOL0f","provider":"Groq","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338229,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fp_6e6ff3688b"} - data: {"id":"gen-1759337002-c1HqLPPkeN9JK2Oin5lw","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337002,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":".json"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338228-mFceGfrHdCwDhSgkOL0f","provider":"Groq","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338229,"choices":[{"index":0,"delta":{"role":"assistant","content":"Created"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fp_6e6ff3688b"} - data: {"id":"gen-1759337002-c1HqLPPkeN9JK2Oin5lw","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337002,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"\","}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338228-mFceGfrHdCwDhSgkOL0f","provider":"Groq","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338229,"choices":[{"index":0,"delta":{"role":"assistant","content":" config"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fp_6e6ff3688b"} - data: {"id":"gen-1759337002-c1HqLPPkeN9JK2Oin5lw","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337002,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":" \""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338228-mFceGfrHdCwDhSgkOL0f","provider":"Groq","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338229,"choices":[{"index":0,"delta":{"role":"assistant","content":".json"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fp_6e6ff3688b"} - data: {"id":"gen-1759337002-c1HqLPPkeN9JK2Oin5lw","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337002,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"content"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338228-mFceGfrHdCwDhSgkOL0f","provider":"Groq","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338229,"choices":[{"index":0,"delta":{"role":"assistant","content":" with"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fp_6e6ff3688b"} - data: {"id":"gen-1759337002-c1HqLPPkeN9JK2Oin5lw","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337002,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338228-mFceGfrHdCwDhSgkOL0f","provider":"Groq","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338229,"choices":[{"index":0,"delta":{"role":"assistant","content":" content"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fp_6e6ff3688b"} - data: {"id":"gen-1759337002-c1HqLPPkeN9JK2Oin5lw","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337002,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":" \"{\\\""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338228-mFceGfrHdCwDhSgkOL0f","provider":"Groq","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338229,"choices":[{"index":0,"delta":{"role":"assistant","content":"."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":"fp_6e6ff3688b"} - data: {"id":"gen-1759337002-c1HqLPPkeN9JK2Oin5lw","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337002,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"name"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338228-mFceGfrHdCwDhSgkOL0f","provider":"Groq","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338229,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}],"system_fingerprint":"fp_6e6ff3688b"} - data: {"id":"gen-1759337002-c1HqLPPkeN9JK2Oin5lw","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337002,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"\\\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759337002-c1HqLPPkeN9JK2Oin5lw","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337002,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":" \\\""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759337002-c1HqLPPkeN9JK2Oin5lw","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337002,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"test"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759337002-c1HqLPPkeN9JK2Oin5lw","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337002,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"\\\","}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759337002-c1HqLPPkeN9JK2Oin5lw","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337002,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":" \\\""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759337002-c1HqLPPkeN9JK2Oin5lw","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337002,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"version"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759337002-c1HqLPPkeN9JK2Oin5lw","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337002,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"\\\":"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759337002-c1HqLPPkeN9JK2Oin5lw","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337002,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":" \\\""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759337002-c1HqLPPkeN9JK2Oin5lw","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337002,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"1"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759337002-c1HqLPPkeN9JK2Oin5lw","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337002,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"."}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759337002-c1HqLPPkeN9JK2Oin5lw","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337002,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"0"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759337002-c1HqLPPkeN9JK2Oin5lw","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337002,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"."}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759337002-c1HqLPPkeN9JK2Oin5lw","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337002,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"0"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759337002-c1HqLPPkeN9JK2Oin5lw","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337002,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"\\\""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759337002-c1HqLPPkeN9JK2Oin5lw","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337002,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"}\""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759337002-c1HqLPPkeN9JK2Oin5lw","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337002,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":null,"type":"function","function":{"arguments":"}"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759337002-c1HqLPPkeN9JK2Oin5lw","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337002,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"tool_calls","native_finish_reason":"tool_calls","logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759337002-c1HqLPPkeN9JK2Oin5lw","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337002,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":7309,"completion_tokens":53,"total_tokens":7362,"cost":0.0030296,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0029236,"upstream_inference_completions_cost":0.000106},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} + data: {"id":"gen-1759338228-mFceGfrHdCwDhSgkOL0f","provider":"Groq","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759338229,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":8257,"completion_tokens":7,"total_tokens":8264,"cost":0.00431,"is_byok":false,"prompt_tokens_details":{"cached_tokens":7936,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.004289,"upstream_inference_completions_cost":0.000021},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} data: [DONE] @@ -170,15 +88,15 @@ interactions: - text/event-stream status: 200 OK code: 200 - duration: 2.896722459s + duration: 276.069417ms - id: 2 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 31201 + content_length: 765 host: "" - body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\nUse the instructions below and the tools available to you to assist the user.\\n\\n\\nIf the current working directory contains a file called CRUSH.md, it will be automatically added to your context.\\n\\nThis file serves multiple purposes:\\n\\n- Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time\\n- Recording the user's code style preferences (naming conventions, preferred libraries, etc.)\\n- Maintaining useful information about the codebase structure and organization\\n\\nWhen you discover important information that could be useful for the future update/add the info to the CRUSH.md.\\n\\nMemory might be added to you during a task if there are nested memory files that relate to the work you are doing.\\n\\n\\n- Be concise and direct\\n- Keep responses under 4 lines unless details requested\\n- Answer without preamble/postamble (\\\"Here is...\\\", \\\"The answer is...\\\")\\n- One-word answers preferred when possible\\n- Never use emojis in your responses\\n- You MUST answer concisely with fewer than 4 lines of text (not including tool use or code generation), unless user asks for detail\\n- User markdown formatting for responses when appropriate\\n\\n\\nuser: 2 + 2\\nassistant: 4\\n\\n\\n\\nuser: what is 2+2?\\nassistant: 4\\n\\n\\n\\nuser: is 11 a prime number?\\nassistant: true\\n\\n\\n\\nuser: what command should I run to list files in the current directory?\\nassistant: ls\\n\\n\\n\\nuser: what command should I run to watch files in the current directory?\\nassistant: [use the ls tool to list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]\\nnpm run dev\\n\\n\\n\\nuser: How many golf balls fit inside a jetta?\\nassistant: 150000\\n\\n\\n\\nuser: what files are in the directory src/?\\nassistant: [runs ls and sees foo.c, bar.c, baz.c]\\nuser: which file contains the implementation of foo?\\nassistant: src/foo.c\\n\\n\\n\\nuser: write tests for new feature\\nassistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]\\n\\n\\n\\n\\nYou are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:\\n\\n- Doing the right thing when asked, including taking actions and follow-up actions\\n- Not surprising the user with actions you take without asking\\n - For example, if the user asks you how to approach something, you should do your best to answer their question first, and not immediately jump into taking actions.\\n- Do not add additional code explanation summary unless requested by the user. After working on a file, just stop, rather than providing an explanation of what you did.\\n\\n\\n\\nWhen making changes to files, first understand the file's code conventions. Mimic code style, use existing libraries and utilities, and follow existing patterns.\\n\\n- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language).\\n- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.\\n- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.\\n- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository.\\n\\n\\n\\n- Follow existing code style and patterns\\n- Do not add any comments to code you write unless asked to do so\\n\\n\\n\\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\\n\\n- Use the available search tools to understand the codebase and the user's query.\\n- Plan out the implementation\\n- Implement the solution using all tools available to you\\n- Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.\\n- When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.\\n\\nNEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked.\\n\\n\\n\\n- When doing file search, prefer to use the Agent tool in order to reduce context usage.\\n- All tools are executed in parallel when multiple tool calls are sent in a single message. Only send multiple tool calls when they are safe to run in parallel (no dependencies between them).\\n- The user does not see the full output of the tool responses, so if you need the output of the tool for the response make sure to summarize it for the user.\\n\\n\\n\\nWorking directory: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/write_tool\\nIs directory a git repo: no \\nPlatform: linux\\nToday's date: 1/1/2025\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\",\"role\":\"system\"},{\"content\":\"use write to create a new file called config.json with content '{\\\"name\\\": \\\"test\\\", \\\"version\\\": \\\"1.0.0\\\"}'\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"TestCoderAgent/openrouter-kimi-k2/write_tool-1\",\"function\":{\"arguments\":\"{\\\"file_path\\\": \\\"/tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/write_tool/config.json\\\", \\\"content\\\": \\\"{\\\\\\\"name\\\\\\\": \\\\\\\"test\\\\\\\", \\\\\\\"version\\\\\\\": \\\\\\\"1.0.0\\\\\\\"}\\\"}\",\"name\":\"write\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"\\nFile successfully written: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/write_tool/config.json\\n\",\"tool_call_id\":\"TestCoderAgent/openrouter-kimi-k2/write_tool-1\",\"role\":\"tool\"}],\"model\":\"moonshotai/kimi-k2-0905\",\"max_tokens\":10000,\"stream_options\":{\"include_usage\":true},\"tool_choice\":\"auto\",\"tools\":[{\"function\":{\"name\":\"bash\",\"strict\":false,\"description\":\"Executes bash commands in persistent shell session with timeout and security measures.\\n\\n\\nUses mvdan/sh interpreter (Bash-compatible on all platforms including Windows).\\nUse forward slashes for paths: \\\"ls C:/foo/bar\\\" not \\\"ls C:\\\\foo\\\\bar\\\".\\nCommon shell builtins and core utils available on Windows.\\n\\n\\n\\n1. Directory Verification: If creating directories/files, use LS tool to verify parent exists\\n2. Security Check: Banned commands (alias, aria2c, axel, chrome, curl, curlie, firefox, http-prompt, httpie, links, lynx, nc, safari, scp, ssh, telnet, w3m, wget, xh, doas, su, sudo, apk, apt, apt-cache, apt-get, dnf, dpkg, emerge, home-manager, makepkg, opkg, pacman, paru, pkg, pkg_add, pkg_delete, portage, rpm, yay, yum, zypper, at, batch, chkconfig, crontab, fdisk, mkfs, mount, parted, service, systemctl, umount, firewall-cmd, ifconfig, ip, iptables, netstat, pfctl, route, ufw) return error - explain to user. Safe read-only commands execute without prompts\\n3. Command Execution: Execute with proper quoting, capture output\\n4. Output Processing: Truncate if exceeds 30000 characters\\n5. Return Result: Include errors, metadata with tags\\n\\n\\n\\n- Command required, timeout optional (max 600000ms/10min, default 30min if unspecified)\\n- IMPORTANT: Use Grep/Glob/Agent tools instead of 'find'/'grep'. Use View/LS tools instead of 'cat'/'head'/'tail'/'ls'\\n- Chain with ';' or '&&', avoid newlines except in quoted strings\\n- Shell state persists (env vars, virtual envs, cwd, etc.)\\n- Prefer absolute paths over 'cd' (use 'cd' only if user explicitly requests)\\n\\n\\n\\nWhen user asks to create git commit:\\n\\n1. Single message with three tool_use blocks (IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - git log (recent commit message style)\\n\\n2. Add relevant untracked files to staging. Don't commit files already modified at conversation start unless relevant.\\n\\n3. Analyze staged changes in tags:\\n - List changed/added files, summarize nature (feature/enhancement/bug fix/refactoring/test/docs)\\n - Brainstorm purpose/motivation, assess project impact, check for sensitive info\\n - Don't use tools beyond git context\\n - Draft concise (1-2 sentences) message focusing on \\\"why\\\" not \\\"what\\\"\\n - Use clear language, accurate reflection (\\\"add\\\"=new feature, \\\"update\\\"=enhancement, \\\"fix\\\"=bug fix)\\n - Avoid generic messages, review draft\\n\\n4. Create commit with Crush signature using HEREDOC:\\n git commit -m \\\"$(cat <<'EOF'\\n Commit message here.\\n\\n \U0001F498 Generated with Crush\\n\\n\\n Co-Authored-By: Crush \\n\\n EOF\\n )\\\"\\n\\n5. If pre-commit hook fails, retry ONCE. If fails again, hook preventing commit. If succeeds but files modified, MUST amend.\\n\\n6. Run git status to verify.\\n\\nNotes: Use \\\"git commit -am\\\" when possible, don't stage unrelated files, NEVER update config, don't push, no -i flags, no empty commits, return empty response.\\n\\n\\n\\nUse gh command for ALL GitHub tasks. When user asks to create PR:\\n\\n1. Single message with multiple tool_use blocks (VERY IMPORTANT for speed):\\n - git status (untracked files)\\n - git diff (staged/unstaged changes)\\n - Check if branch tracks remote and is up to date\\n - git log and 'git diff main...HEAD' (full commit history from main divergence)\\n\\n2. Create new branch if needed\\n3. Commit changes if needed\\n4. Push to remote with -u flag if needed\\n\\n5. Analyze changes in tags:\\n - List commits since diverging from main\\n - Summarize nature of changes\\n - Brainstorm purpose/motivation\\n - Assess project impact\\n - Don't use tools beyond git context\\n - Check for sensitive information\\n - Draft concise (1-2 bullet points) PR summary focusing on \\\"why\\\"\\n - Ensure summary reflects ALL changes since main divergence\\n - Clear, concise language\\n - Accurate reflection of changes and purpose\\n - Avoid generic summaries\\n - Review draft\\n\\n6. Create PR with gh pr create using HEREDOC:\\n gh pr create --title \\\"title\\\" --body \\\"$(cat <<'EOF'\\n\\n ## Summary\\n\\n <1-3 bullet points>\\n\\n ## Test plan\\n\\n [Checklist of TODOs...]\\n\\n\\n \U0001F498 Generated with Crush\\n\\n\\n EOF\\n )\\\"\\n\\nImportant:\\n\\n- Return empty response - user sees gh output\\n- Never update git config\\n \\n\\n\\nGood: pytest /foo/bar/tests\\nBad: cd /foo/bar && pytest tests\\n\\n\",\"parameters\":{\"properties\":{\"command\":{\"description\":\"The command to execute\",\"type\":\"string\"},\"description\":{\"description\":\"A brief description of what the command does\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in milliseconds (max 600000)\",\"type\":\"integer\"}},\"required\":[\"command\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"download\",\"strict\":false,\"description\":\"Downloads binary data from URL and saves to local file.\\n\\n\\n- Provide URL to download from\\n- Specify local file path where content should be saved\\n- Optional timeout for request\\n\\n\\n\\n- Downloads any file type (binary or text)\\n- Auto-creates parent directories if missing\\n- Handles large files efficiently with streaming\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max file size: 100MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n- Will overwrite existing files without warning\\n\\n\\n\\n- Use absolute paths or paths relative to working directory\\n- Set appropriate timeouts for large files or slow connections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The local file path where the downloaded content should be saved\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 600)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to download from\",\"type\":\"string\"}},\"required\":[\"url\",\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit\",\"strict\":false,\"description\":\"Edits files by replacing text, creating new files, or deleting content. For moving/renaming use Bash 'mv'. For large edits use Write tool.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. For new files: Use LS tool to verify parent directory exists\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. old_string: Text to replace (must match exactly including whitespace/indentation)\\n3. new_string: Replacement text\\n4. replace_all: Replace all occurrences (default false)\\n\\n\\n\\n\\n- Create file: provide file_path + new_string, leave old_string empty\\n- Delete content: provide file_path + old_string, leave new_string empty\\n \\n\\n\\nUNIQUENESS (when replace_all=false): old_string MUST uniquely identify target instance\\n\\n- Include 3-5 lines context BEFORE and AFTER change point\\n- Include exact whitespace, indentation, surrounding code\\n\\nSINGLE INSTANCE: Tool changes ONE instance when replace_all=false\\n\\n- For multiple instances: set replace_all=true OR make separate calls with unique context\\n- Plan calls carefully to avoid conflicts\\n\\nVERIFICATION: Before using\\n\\n- Check how many instances of target text exist\\n- Gather sufficient context for unique identification\\n- Plan separate calls or use replace_all\\n \\n\\n\\nTool fails if:\\n- old_string matches multiple locations and replace_all=false\\n- old_string doesn't match exactly (including whitespace)\\n- Insufficient context causes wrong instance change\\n\\n\\n\\n\\n- Ensure edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use forward slashes (/) for cross-platform compatibility\\n- Multiple edits to same file: send all in single message with multiple tool calls\\n \\n\\n\\n\\n- Forward slashes work throughout (C:/path/file)\\n- File permissions handled automatically\\n- Line endings converted automatically (\\\\n ↔ \\\\r\\\\n)\\n \\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"},\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false)\",\"type\":\"boolean\"}},\"required\":[\"file_path\",\"old_string\",\"new_string\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"multiedit\",\"strict\":false,\"description\":\"Makes multiple edits to a single file in one operation. Built on Edit tool for efficient multiple find-and-replace operations. Prefer over Edit tool for multiple edits to same file.\\n\\n\\n1. Use View tool to understand file contents and context\\n2. Verify directory path is correct\\n\\n\\n\\n1. file_path: Absolute path to file (required)\\n2. edits: Array of edit operations, each containing:\\n - old_string: Text to replace (must match exactly including whitespace/indentation)\\n - new_string: Replacement text\\n - replace_all: Replace all occurrences (optional, defaults to false)\\n\\n\\n\\n- Edits applied sequentially in provided order\\n- Each edit operates on result of previous edit\\n- All edits must be valid for operation to succeed - if any fails, none applied\\n- Ideal for several changes to different parts of same file\\n\\n\\n\\n\\n1. All edits follow same requirements as single Edit tool\\n2. Edits are atomic - either all succeed or none applied\\n3. Plan edits carefully to avoid conflicts between sequential operations\\n \\n\\n\\n- Tool fails if old_string doesn't match file contents exactly (including whitespace)\\n- Tool fails if old_string and new_string are identical\\n- Earlier edits may affect text that later edits try to find - plan sequence carefully\\n\\n\\n\\n\\n- Ensure all edits result in correct, idiomatic code\\n- Don't leave code in broken state\\n- Use absolute file paths (starting with /)\\n- Use replace_all for renaming variables across file\\n- Avoid adding emojis unless user explicitly requests\\n \\n\\n\\n\\n- Provide new file path (including directory if needed)\\n- First edit: empty old_string, new file contents as new_string\\n- Subsequent edits: normal edit operations on created content\\n \\n\",\"parameters\":{\"properties\":{\"edits\":{\"description\":\"Array of edit operations to perform sequentially on the file\",\"items\":{\"new_string\":{\"description\":\"The text to replace it with\",\"type\":\"string\"},\"old_string\":{\"description\":\"The text to replace\",\"type\":\"string\"},\"replace_all\":{\"description\":\"Replace all occurrences of old_string (default false).\",\"type\":\"boolean\"}},\"type\":\"array\"},\"file_path\":{\"description\":\"The absolute path to the file to modify\",\"type\":\"string\"}},\"required\":[\"file_path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"fetch\",\"strict\":false,\"description\":\"Fetches content from URL and returns it in specified format.\\n\\n\\n- Provide URL to fetch content from\\n- Specify desired output format (text, markdown, or html)\\n- Optional timeout for request\\n\\n\\n\\n- Supports three output formats: text, markdown, html\\n- Auto-handles HTTP redirects\\n- Sets reasonable timeouts to prevent hanging\\n- Validates input parameters before requests\\n\\n\\n\\n- Max response size: 5MB\\n- Only supports HTTP and HTTPS protocols\\n- Cannot handle authentication or cookies\\n- Some websites may block automated requests\\n\\n\\n\\n- Use text format for plain text content or simple API responses\\n- Use markdown format for content that should be rendered with formatting\\n- Use html format when you need raw HTML structure\\n- Set appropriate timeouts for potentially slow websites\\n\\n\",\"parameters\":{\"properties\":{\"format\":{\"description\":\"The format to return the content in (text, markdown, or html)\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"},\"url\":{\"description\":\"The URL to fetch content from\",\"type\":\"string\"}},\"required\":[\"url\",\"format\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"glob\",\"strict\":false,\"description\":\"Fast file pattern matching tool that finds files by name/pattern, returning paths sorted by modification time (newest first).\\n\\n\\n- Provide glob pattern to match against file paths\\n- Optional starting directory (defaults to current working directory)\\n- Results sorted with most recently modified files first\\n\\n\\n\\n\\n- '\\\\*' matches any sequence of non-separator characters\\n- '\\\\*\\\\*' matches any sequence including separators\\n- '?' matches any single non-separator character\\n- '[...]' matches any character in brackets\\n- '[!...]' matches any character not in brackets\\n \\n\\n\\n- '*.js' - JavaScript files in current directory\\n- '**/*.js' - JavaScript files in any subdirectory\\n- 'src/**/*.{ts,tsx}' - TypeScript files in src directory\\n- '*.{html,css,js}' - HTML, CSS, and JS files\\n\\n\\n\\n- Results limited to 100 files (newest first)\\n- Does not search file contents (use Grep for that)\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Path separators handled automatically (/ and \\\\ work)\\n- Uses ripgrep (rg) if available, otherwise Go implementation\\n- Patterns should use forward slashes (/) for compatibility\\n \\n\\n\\n- Combine with Grep: find files with Glob, search contents with Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine pattern if needed\\n\\n\",\"parameters\":{\"properties\":{\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The glob pattern to match files against\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"grep\",\"strict\":false,\"description\":\"Fast content search tool that finds files containing specific text/patterns, returning matching paths sorted by modification time (newest first).\\n\\n\\n- Provide regex pattern to search within file contents\\n- Set literal_text=true for exact text with special characters (recommended for non-regex users)\\n- Optional starting directory (defaults to current working directory)\\n- Optional include pattern to filter which files to search\\n- Results sorted with most recently modified files first\\n\\n\\n\\nWhen literal_text=false (supports standard regex):\\n\\n- 'function' searches for literal text \\\"function\\\"\\n- 'log\\\\..\\\\*Error' finds text starting with \\\"log.\\\" and ending with \\\"Error\\\"\\n- 'import\\\\s+.\\\\*\\\\s+from' finds import statements in JavaScript/TypeScript\\n \\n\\n\\n\\n- '\\\\*.js' - Only search JavaScript files\\n- '\\\\*.{ts,tsx}' - Only search TypeScript files\\n- '\\\\*.go' - Only search Go files\\n \\n\\n\\n- Results limited to 100 files (newest first)\\n- Performance depends on number of files searched\\n- Very large binary files may be skipped\\n- Hidden files (starting with '.') skipped\\n\\n\\n\\n\\n- Respects .gitignore patterns to skip ignored files/directories\\n- Respects .crushignore patterns for additional ignore rules\\n- Both ignore files auto-detected in search root directory\\n \\n\\n\\n\\n- Uses ripgrep (rg) if available for better performance\\n- Falls back to Go implementation if ripgrep unavailable\\n- File paths normalized automatically for compatibility\\n \\n\\n\\n- For faster searches: use Glob to find relevant files first, then Grep\\n- For iterative exploration requiring multiple searches, consider Agent tool\\n- Check if results truncated and refine search pattern if needed\\n- Use literal_text=true for exact text with special characters (dots, parentheses, etc.)\\n\\n\",\"parameters\":{\"properties\":{\"include\":{\"description\":\"File pattern to include in the search (e.g. \\\"*.js\\\", \\\"*.{ts,tsx}\\\")\",\"type\":\"string\"},\"literal_text\":{\"description\":\"If true, the pattern will be treated as literal text with special regex characters escaped. Default is false.\",\"type\":\"boolean\"},\"path\":{\"description\":\"The directory to search in. Defaults to the current working directory.\",\"type\":\"string\"},\"pattern\":{\"description\":\"The regex pattern to search for in file contents\",\"type\":\"string\"}},\"required\":[\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"ls\",\"strict\":false,\"description\":\"Shows files and subdirectories in tree structure for exploring project organization.\\n\\n\\n- Provide path to list (defaults to current working directory)\\n- Optional glob patterns to ignore\\n- Results displayed in tree structure\\n\\n\\n\\n- Hierarchical view of files and directories\\n- Auto-skips hidden files/directories (starting with '.')\\n- Skips common system directories like __pycache__\\n- Can filter files matching specific patterns\\n\\n\\n\\n- Results limited to 1000 files\\n- Large directories truncated\\n- No file sizes or permissions shown\\n- Cannot recursively list all directories in large projects\\n\\n\\n\\n\\n- Hidden file detection uses Unix convention (files starting with '.')\\n- Windows hidden files (with hidden attribute) not auto-skipped\\n- Common Windows directories (System32, Program Files) not in default ignore\\n- Path separators handled automatically (/ and \\\\ work)\\n \\n\\n\\n- Use Glob for finding files by name patterns instead of browsing\\n- Use Grep for searching file contents\\n- Combine with other tools for effective exploration\\n\\n\",\"parameters\":{\"properties\":{\"ignore\":{\"description\":\"List of glob patterns to ignore\",\"items\":{},\"type\":\"array\"},\"path\":{\"description\":\"The path to the directory to list (defaults to current working directory)\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"sourcegraph\",\"strict\":false,\"description\":\"Search code across public repositories using Sourcegraph's GraphQL API.\\n\\n\\n- Provide search query using Sourcegraph syntax\\n- Optional result count (default: 10, max: 20)\\n- Optional timeout for request\\n\\n\\n\\n\\n- \\\"fmt.Println\\\" - exact matches\\n- \\\"file:.go fmt.Println\\\" - limit to Go files\\n- \\\"repo:^github\\\\.com/golang/go$ fmt.Println\\\" - specific repos\\n- \\\"lang:go fmt.Println\\\" - limit to Go code\\n- \\\"fmt.Println AND log.Fatal\\\" - combined terms\\n- \\\"fmt\\\\.(Print|Printf|Println)\\\" - regex patterns\\n- \\\"\\\\\\\"exact phrase\\\\\\\"\\\" - exact phrase matching\\n- \\\"-file:test\\\" or \\\"-repo:forks\\\" - exclude matches\\n \\n\\n\\nRepository: repo:name, repo:^exact$, repo:org/repo@branch, -repo:exclude, fork:yes, archived:yes, visibility:public\\nFile: file:\\\\.js$, file:internal/, -file:test, file:has.content(text)\\nContent: content:\\\"exact\\\", -content:\\\"unwanted\\\", case:yes\\nType: type:symbol, type:file, type:path, type:diff, type:commit\\nTime: after:\\\"1 month ago\\\", before:\\\"2023-01-01\\\", author:name, message:\\\"fix\\\"\\nResult: select:repo, select:file, select:content, count:100, timeout:30s\\n\\n\\n\\n- \\\"file:.go context.WithTimeout\\\" - Go code using context.WithTimeout\\n- \\\"lang:typescript useState type:symbol\\\" - TypeScript React useState hooks\\n- \\\"repo:^github\\\\.com/kubernetes/kubernetes$ pod list type:file\\\" - Kubernetes pod files\\n- \\\"file:Dockerfile (alpine OR ubuntu) -content:alpine:latest\\\" - Dockerfiles with base images\\n\\n\\n\\n\\n- \\\"term1 AND term2\\\" - both terms\\n- \\\"term1 OR term2\\\" - either term\\n- \\\"term1 NOT term2\\\" - term1 but not term2\\n- \\\"term1 and (term2 or term3)\\\" - grouping with parentheses\\n \\n\\n\\n- Only searches public repositories\\n- Rate limits may apply\\n- Complex queries take longer\\n- Max 20 results per query\\n\\n\\n\\n- Use specific file extensions to narrow results\\n- Add repo: filters for targeted searches\\n- Use type:symbol for function/method definitions\\n- Use type:file to find relevant files\\n\\n\",\"parameters\":{\"properties\":{\"context_window\":{\"description\":\"The context around the match to return (default: 10 lines)\",\"type\":\"integer\"},\"count\":{\"description\":\"Optional number of results to return (default: 10, max: 20)\",\"type\":\"integer\"},\"query\":{\"description\":\"The Sourcegraph search query\",\"type\":\"string\"},\"timeout\":{\"description\":\"Optional timeout in seconds (max 120)\",\"type\":\"integer\"}},\"required\":[\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"view\",\"strict\":false,\"description\":\"Reads and displays file contents with line numbers for examining code, logs, or text data.\\n\\n\\n- Provide file path to read\\n- Optional offset: start reading from specific line (0-based)\\n- Optional limit: control lines read (default 2000)\\n- Don't use for directories (use LS tool instead)\\n\\n\\n\\n- Displays contents with line numbers\\n- Can read from any file position using offset\\n- Handles large files by limiting lines read\\n- Auto-truncates very long lines for display\\n- Suggests similar filenames when file not found\\n\\n\\n\\n- Max file size: 250KB\\n- Default limit: 2000 lines\\n- Lines >2000 chars truncated\\n- Cannot display binary files/images (identifies them)\\n\\n\\n\\n\\n- Handles Windows (CRLF) and Unix (LF) line endings\\n- Works with forward slashes (/) and backslashes (\\\\)\\n- Auto-detects text encoding for common formats\\n \\n\\n\\n- Use with Glob to find files first\\n- For code exploration: Grep to find relevant files, then View to examine\\n- For large files: use offset parameter for specific sections\\n\\n\",\"parameters\":{\"properties\":{\"file_path\":{\"description\":\"The path to the file to read\",\"type\":\"string\"},\"limit\":{\"description\":\"The number of lines to read (defaults to 2000)\",\"type\":\"integer\"},\"offset\":{\"description\":\"The line number to start reading from (0-based)\",\"type\":\"integer\"}},\"required\":[\"file_path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write\",\"strict\":false,\"description\":\"Creates or updates files in filesystem for saving/modifying text content.\\n\\n\\n- Provide file path to write\\n- Include content to write to file\\n- Tool creates necessary parent directories automatically\\n\\n\\n\\n- Creates new files or overwrites existing ones\\n- Auto-creates parent directories if missing\\n- Checks if file modified since last read for safety\\n- Avoids unnecessary writes when content unchanged\\n\\n\\n\\n- Read file before writing to avoid conflicts\\n- Cannot append (rewrites entire file)\\n\\n\\n\\n\\n- Use forward slashes (/) for compatibility\\n \\n\\n\\n- Use View tool first to examine existing files before modifying\\n- Use LS tool to verify location when creating new files\\n- Combine with Glob/Grep to find and modify multiple files\\n- Include descriptive comments when changing existing code\\n\\n\",\"parameters\":{\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"file_path\":{\"description\":\"The path to the file to write\",\"type\":\"string\"}},\"required\":[\"file_path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"usage\":{\"include\":true},\"stream\":true}" + body: '{"messages":[{"content":"you will generate a short title based on the first message a user begins a conversation with\n\n- ensure it is not more than 50 characters long\n- the title should be a summary of the user''s message\n- it should be one line long\n- do not use quotes or colons\n- the entire text you return will be used as the title\n- never return anything that is more than one sentence (one line) long\n","role":"system"},{"content":"Generate a concise title for the following content:\n\nuse write to create a new file called config.json with content ''{\"name\": \"test\", \"version\": \"1.0.0\"}''","role":"user"}],"model":"qwen/qwen3-next-80b-a3b-instruct","max_tokens":40,"stream_options":{"include_usage":true},"usage":{"include":true},"stream":true}' headers: Accept: - application/json @@ -194,29 +112,17 @@ interactions: proto_minor: 0 content_length: -1 body: |+ - data: {"id":"gen-1759337008-qoRbvvzOQWYzcsKIjDOf","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337008,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759337008-qoRbvvzOQWYzcsKIjDOf","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337008,"choices":[{"index":0,"delta":{"role":"assistant","content":"Done"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759337008-qoRbvvzOQWYzcsKIjDOf","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337008,"choices":[{"index":0,"delta":{"role":"assistant","content":"."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759337008-qoRbvvzOQWYzcsKIjDOf","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337008,"choices":[{"index":0,"delta":{"role":"assistant","content":" Created"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759337008-qoRbvvzOQWYzcsKIjDOf","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337008,"choices":[{"index":0,"delta":{"role":"assistant","content":" config"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759337008-qoRbvvzOQWYzcsKIjDOf","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337008,"choices":[{"index":0,"delta":{"role":"assistant","content":".json"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} - - data: {"id":"gen-1759337008-qoRbvvzOQWYzcsKIjDOf","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337008,"choices":[{"index":0,"delta":{"role":"assistant","content":" with"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338228-xRcdTDGME7hX7aRJZfbU","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338228,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337008-qoRbvvzOQWYzcsKIjDOf","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337008,"choices":[{"index":0,"delta":{"role":"assistant","content":" specified"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338228-xRcdTDGME7hX7aRJZfbU","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338228,"choices":[{"index":0,"delta":{"role":"assistant","content":"Create"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337008-qoRbvvzOQWYzcsKIjDOf","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337008,"choices":[{"index":0,"delta":{"role":"assistant","content":" content"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338228-xRcdTDGME7hX7aRJZfbU","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338228,"choices":[{"index":0,"delta":{"role":"assistant","content":" config.json with name"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337008-qoRbvvzOQWYzcsKIjDOf","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337008,"choices":[{"index":0,"delta":{"role":"assistant","content":"."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338228-xRcdTDGME7hX7aRJZfbU","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338228,"choices":[{"index":0,"delta":{"role":"assistant","content":" and version data"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]} - data: {"id":"gen-1759337008-qoRbvvzOQWYzcsKIjDOf","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337008,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}],"system_fingerprint":""} + data: {"id":"gen-1759338228-xRcdTDGME7hX7aRJZfbU","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338228,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]} - data: {"id":"gen-1759337008-qoRbvvzOQWYzcsKIjDOf","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1759337008,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":7418,"completion_tokens":9,"total_tokens":7427,"cost":0.0029852,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0029672,"upstream_inference_completions_cost":0.000018},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} + data: {"id":"gen-1759338228-xRcdTDGME7hX7aRJZfbU","provider":"Google","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1759338228,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":141,"completion_tokens":9,"total_tokens":150,"cost":0.00003195,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.00002115,"upstream_inference_completions_cost":0.0000108},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}} data: [DONE] @@ -225,4 +131,4 @@ interactions: - text/event-stream status: 200 OK code: 200 - duration: 2.549849292s + duration: 1.32887175s diff --git a/internal/agent/tools/ls.go b/internal/agent/tools/ls.go index 06f4ed68520bede0e13ed1177f4a29db83e87b8a..20a68cf89b761f4cdf736318e40dd880baabefdd 100644 --- a/internal/agent/tools/ls.go +++ b/internal/agent/tools/ls.go @@ -1,6 +1,7 @@ package tools import ( + "cmp" "context" _ "embed" "fmt" @@ -8,6 +9,7 @@ import ( "path/filepath" "strings" + "github.com/charmbracelet/crush/internal/config" "github.com/charmbracelet/crush/internal/fsext" "github.com/charmbracelet/crush/internal/permission" "github.com/charmbracelet/fantasy/ai" @@ -16,11 +18,13 @@ import ( type LSParams struct { Path string `json:"path" description:"The path to the directory to list (defaults to current working directory)"` Ignore []string `json:"ignore,omitempty" description:"List of glob patterns to ignore"` + Depth int `json:"depth,omitempty" description:"The maximum depth to traverse"` } type LSPermissionsParams struct { Path string `json:"path"` Ignore []string `json:"ignore"` + Depth int `json:"depth"` } type TreeNode struct { @@ -37,24 +41,18 @@ type LSResponseMetadata struct { const ( LSToolName = "ls" - MaxLSFiles = 1000 + maxLSFiles = 1000 ) //go:embed ls.md var lsDescription []byte -func NewLsTool(permissions permission.Service, workingDir string) ai.AgentTool { +func NewLsTool(permissions permission.Service, workingDir string, lsConfig config.ToolLs) ai.AgentTool { return ai.NewAgentTool( LSToolName, string(lsDescription), func(ctx context.Context, params LSParams, call ai.ToolCall) (ai.ToolResponse, error) { - searchPath := params.Path - if searchPath == "" { - searchPath = workingDir - } - - var err error - searchPath, err = fsext.Expand(searchPath) + searchPath, err := fsext.Expand(cmp.Or(params.Path, workingDir)) if err != nil { return ai.ToolResponse{}, fmt.Errorf("error expanding path: %w", err) } @@ -99,45 +97,49 @@ func NewLsTool(permissions permission.Service, workingDir string) ai.AgentTool { } } - output, err := ListDirectoryTree(searchPath, params.Ignore) + output, metadata, err := ListDirectoryTree(searchPath, params, lsConfig) if err != nil { return ai.ToolResponse{}, err } - // Get file count for metadata - files, truncated, err := fsext.ListDirectory(searchPath, params.Ignore, MaxLSFiles) - if err != nil { - return ai.ToolResponse{}, fmt.Errorf("error listing directory for metadata: %w", err) - } - return ai.WithResponseMetadata( ai.NewTextResponse(output), - LSResponseMetadata{ - NumberOfFiles: len(files), - Truncated: truncated, - }, + metadata, ), nil }) } -func ListDirectoryTree(searchPath string, ignore []string) (string, error) { +func ListDirectoryTree(searchPath string, params LSParams, lsConfig config.ToolLs) (string, LSResponseMetadata, error) { if _, err := os.Stat(searchPath); os.IsNotExist(err) { - return "", fmt.Errorf("path does not exist: %s", searchPath) + return "", LSResponseMetadata{}, fmt.Errorf("path does not exist: %s", searchPath) } - files, truncated, err := fsext.ListDirectory(searchPath, ignore, MaxLSFiles) + depth, limit := lsConfig.Limits() + maxFiles := min(limit, maxLSFiles) + files, truncated, err := fsext.ListDirectory( + searchPath, + params.Ignore, + cmp.Or(params.Depth, depth), + maxFiles, + ) if err != nil { - return "", fmt.Errorf("error listing directory: %w", err) + return "", LSResponseMetadata{}, fmt.Errorf("error listing directory: %w", err) } + metadata := LSResponseMetadata{ + NumberOfFiles: len(files), + Truncated: truncated, + } tree := createFileTree(files, searchPath) - output := printTree(tree, searchPath) + var output string if truncated { - output = fmt.Sprintf("There are more than %d files in the directory. Use a more specific path or use the Glob tool to find specific files. The first %d files and directories are included below:\n\n%s", MaxLSFiles, MaxLSFiles, output) + output = fmt.Sprintf("There are more than %d files in the directory. Use a more specific path or use the Glob tool to find specific files. The first %[1]d files and directories are included below.\n", maxFiles) } - - return output, nil + if depth > 0 { + output = fmt.Sprintf("The directory tree is shown up to a depth of %d. Use a higher depth and a specific path to see more levels.\n", cmp.Or(params.Depth, depth)) + } + return output + "\n" + printTree(tree, searchPath), metadata, nil } func createFileTree(sortedPaths []string, rootPath string) []*TreeNode {