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 f87937fc80ba704a0b067c454dcccab70772d117..acc57e9169791bed01c26e823e24594e6e51e315 100644
--- a/internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/bash_tool.yaml
+++ b/internal/agent/testdata/TestCoderAgent/openrouter-kimi-k2/bash_tool.yaml
@@ -6,9 +6,9 @@ interactions:
proto: HTTP/1.1
proto_major: 1
proto_minor: 1
- content_length: 29988
+ content_length: 775
host: ""
- body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\n\\n\\nThese rules override everything else. Follow them strictly:\\n\\n1. **ALWAYS READ BEFORE EDITING**: Never edit a file you haven't read in this conversation (only read files if you did not read them before or they changed)\\n2. **BE AUTONOMOUS**: Don't ask questions - search, read, decide, act\\n3. **TEST AFTER CHANGES**: Run tests immediately after each modification\\n4. **BE CONCISE**: Under 4 lines unless user asks for detail\\n5. **USE EXACT MATCHES**: When editing, match text exactly including whitespace\\n6. **NEVER COMMIT**: Unless user explicitly says \\\"commit\\\"\\n7. **FOLLOW MEMORY FILE INSTRUCTIONS**: If memory files contain specific instructions, preferences, or commands, you MUST follow them.\\n8. **NEVER ADD COMMENTS**: Only add comments if the user asked you to do so\\n\\n\\n\\nKeep responses minimal:\\n- Under 4 lines of text (tool use doesn't count)\\n- No preamble (\\\"Here's...\\\", \\\"I'll...\\\")\\n- No postamble (\\\"Let me know...\\\", \\\"Hope this helps...\\\")\\n- One-word answers when possible\\n- No emojis ever\\n- No explanations unless user asks\\n\\nExamples:\\nuser: what is 2+2?\\nassistant: 4\\n\\nuser: list files in src/\\nassistant: [uses ls tool]\\nfoo.c, bar.c, baz.c\\n\\nuser: which file has the foo implementation?\\nassistant: src/foo.c\\n\\nuser: add error handling to the login function\\nassistant: [searches for login, reads file, edits with exact match, runs tests]\\nDone\\n\\n\\n\\nFor every task, follow this sequence internally (don't narrate it):\\n\\n**Before acting**:\\n- Search codebase for relevant files\\n- Read files to understand current state\\n- Check memory for stored commands\\n- Identify what needs to change\\n\\n**While acting**:\\n- Read entire file before editing it\\n- Use exact text for find/replace (include whitespace)\\n- Make one logical change at a time\\n- After each change: run tests\\n- If tests fail: fix immediately\\n\\n**Before finishing**:\\n- Run lint/typecheck if in memory\\n- Verify all changes work\\n- Keep response under 4 lines\\n\\n**Key behaviors**:\\n- Use find_references before changing shared code\\n- Follow existing patterns (check similar files)\\n- If stuck, try different approach (don't repeat failures)\\n- Make decisions yourself (search first, don't ask)\\n\\n\\n\\n**Make decisions autonomously** - don't ask when you can:\\n- Search to find the answer\\n- Read files to see patterns\\n- Check similar code\\n- Infer from context\\n- Try most likely approach\\n\\n**Only ask user if**:\\n- Truly ambiguous business requirement\\n- Multiple valid approaches with big tradeoffs\\n- Could cause data loss\\n- Exhausted all attempts\\n\\nExamples of autonomous decisions:\\n- File location → search for similar files\\n- Test command → check package.json/memory\\n- Code style → read existing code\\n- Library choice → check what's used\\n- Naming → follow existing names\\n\\n\\n\\nCritical: ALWAYS read files before editing them in this conversation.\\n\\nWhen using edit tools:\\n1. Read the file first\\n2. Find exact text to replace (include indentation/spaces)\\n3. Make replacement unambiguous (enough context)\\n4. Verify edit succeeded\\n5. Run tests\\n\\nCommon mistakes to avoid:\\n- Editing without reading first\\n- Approximate text matches\\n- Wrong indentation\\n- Not enough context (text appears multiple times)\\n- Not testing after changes\\n\\n\\n\\nWhen errors occur:\\n1. Read complete error message\\n2. Understand root cause\\n3. Try different approach (don't repeat same action)\\n4. Search for similar code that works\\n5. Make targeted fix\\n6. Test to verify\\n\\nCommon errors:\\n- Import/Module → check paths, spelling, what exists\\n- Syntax → check brackets, indentation, typos\\n- Tests fail → read test, see what it expects\\n- File not found → use ls, check exact path\\n\\n\\n\\nMemory files store commands, preferences, and codebase info. Update them when you discover:\\n- Build/test/lint commands\\n- Code style preferences \\n- Important codebase patterns\\n- Useful project information\\n\\n\\n\\nBefore writing code:\\n1. Check if library exists (look at imports, package.json)\\n2. Read similar code for patterns\\n3. Match existing style\\n4. Use same libraries/frameworks\\n5. Follow security best practices (never log secrets)\\n\\nNever assume libraries are available - verify first.\\n\\n\\n\\nAfter significant changes:\\n- Run relevant test suite\\n- If tests fail, fix before continuing\\n- Check memory for test commands\\n- Run lint/typecheck if available\\n- Suggest adding commands to memory if not found\\n\\n\\n\\n- Search before assuming\\n- Read files before editing\\n- Use Agent tool for complex searches\\n- Run tools in parallel when safe (no dependencies)\\n- Summarize tool output for user (they don't see it)\\n\\n\\n\\nBalance autonomy with user intent:\\n- When asked to do something → do it fully (including follow-ups)\\n- When asked how to approach → explain first, don't auto-implement\\n- After completing work → stop, don't explain (unless asked)\\n- Don't surprise user with unexpected actions\\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\",\"role\":\"system\",\"cache_control\":{\"type\":\"ephemeral\"}},{\"content\":\"use bash to create a file named test.txt with content 'hello bash'\",\"role\":\"user\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"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- 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- 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- 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\\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- 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- 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- '\\\\*' 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- 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- '\\\\*.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- 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- 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- 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\":[],\"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- \\\"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- \\\"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- 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- 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\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\n\n /no_think","role":"system"},{"content":"Generate a concise title for the following content:\n\nuse bash to create a file named test.txt with content ''hello bash''\n \n\n","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
@@ -24,71 +24,27 @@ interactions:
proto_minor: 0
content_length: -1
body: |+
- data: {"id":"gen-1761220121-Nwd8L5a2klih4AqrkBw2","provider":"Parasail","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761220121,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
-
- data: {"id":"gen-1761220121-Nwd8L5a2klih4AqrkBw2","provider":"Parasail","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761220121,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":"functions.write:0","index":0,"type":"function","function":{"name":"write","arguments":""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
-
- data: {"id":"gen-1761220121-Nwd8L5a2klih4AqrkBw2","provider":"Parasail","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761220121,"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-1761220121-Nwd8L5a2klih4AqrkBw2","provider":"Parasail","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761220121,"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-1761220121-Nwd8L5a2klih4AqrkBw2","provider":"Parasail","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761220121,"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-1761220121-Nwd8L5a2klih4AqrkBw2","provider":"Parasail","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761220121,"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-1761220121-Nwd8L5a2klih4AqrkBw2","provider":"Parasail","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761220121,"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-1761220121-Nwd8L5a2klih4AqrkBw2","provider":"Parasail","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761220121,"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-1761220121-Nwd8L5a2klih4AqrkBw2","provider":"Parasail","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761220121,"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-1761220121-Nwd8L5a2klih4AqrkBw2","provider":"Parasail","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761220121,"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-1761220121-Nwd8L5a2klih4AqrkBw2","provider":"Parasail","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761220121,"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-1761220121-Nwd8L5a2klih4AqrkBw2","provider":"Parasail","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761220121,"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-1761220121-Nwd8L5a2klih4AqrkBw2","provider":"Parasail","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761220121,"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-1761220121-Nwd8L5a2klih4AqrkBw2","provider":"Parasail","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761220121,"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-1761220121-Nwd8L5a2klih4AqrkBw2","provider":"Parasail","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761220121,"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-1761220121-Nwd8L5a2klih4AqrkBw2","provider":"Parasail","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761220121,"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-1761220121-Nwd8L5a2klih4AqrkBw2","provider":"Parasail","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761220121,"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-1761239548-iE24hRsdSyjW1rz3L5yq","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761239548,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
- data: {"id":"gen-1761220121-Nwd8L5a2klih4AqrkBw2","provider":"Parasail","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761220121,"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-1761239548-iE24hRsdSyjW1rz3L5yq","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761239548,"choices":[{"index":0,"delta":{"role":"assistant","content":"Create"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
- data: {"id":"gen-1761220121-Nwd8L5a2klih4AqrkBw2","provider":"Parasail","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761220121,"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-1761239548-iE24hRsdSyjW1rz3L5yq","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761239548,"choices":[{"index":0,"delta":{"role":"assistant","content":" test"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
- data: {"id":"gen-1761220121-Nwd8L5a2klih4AqrkBw2","provider":"Parasail","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761220121,"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-1761239548-iE24hRsdSyjW1rz3L5yq","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761239548,"choices":[{"index":0,"delta":{"role":"assistant","content":".txt"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
- data: {"id":"gen-1761220121-Nwd8L5a2klih4AqrkBw2","provider":"Parasail","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761220121,"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-1761239548-iE24hRsdSyjW1rz3L5yq","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761239548,"choices":[{"index":0,"delta":{"role":"assistant","content":" with"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
- data: {"id":"gen-1761220121-Nwd8L5a2klih4AqrkBw2","provider":"Parasail","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761220121,"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-1761239548-iE24hRsdSyjW1rz3L5yq","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761239548,"choices":[{"index":0,"delta":{"role":"assistant","content":" hello"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
- data: {"id":"gen-1761220121-Nwd8L5a2klih4AqrkBw2","provider":"Parasail","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761220121,"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-1761239548-iE24hRsdSyjW1rz3L5yq","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761239548,"choices":[{"index":0,"delta":{"role":"assistant","content":" bash"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
- data: {"id":"gen-1761220121-Nwd8L5a2klih4AqrkBw2","provider":"Parasail","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761220121,"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-1761239548-iE24hRsdSyjW1rz3L5yq","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761239548,"choices":[{"index":0,"delta":{"role":"assistant","content":" using"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
- data: {"id":"gen-1761220121-Nwd8L5a2klih4AqrkBw2","provider":"Parasail","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761220121,"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-1761239548-iE24hRsdSyjW1rz3L5yq","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761239548,"choices":[{"index":0,"delta":{"role":"assistant","content":" bash"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
- data: {"id":"gen-1761220121-Nwd8L5a2klih4AqrkBw2","provider":"Parasail","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761220121,"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-1761239548-iE24hRsdSyjW1rz3L5yq","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761239548,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]}
- data: {"id":"gen-1761220121-Nwd8L5a2klih4AqrkBw2","provider":"Parasail","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761220121,"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-1761220121-Nwd8L5a2klih4AqrkBw2","provider":"Parasail","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761220121,"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-1761220121-Nwd8L5a2klih4AqrkBw2","provider":"Parasail","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761220121,"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-1761220121-Nwd8L5a2klih4AqrkBw2","provider":"Parasail","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761220121,"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-1761220121-Nwd8L5a2klih4AqrkBw2","provider":"Parasail","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761220121,"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-1761220121-Nwd8L5a2klih4AqrkBw2","provider":"Parasail","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761220121,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"tool_calls","native_finish_reason":"tool_calls","logprobs":null}]}
-
- data: {"id":"gen-1761220121-Nwd8L5a2klih4AqrkBw2","provider":"Parasail","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761220121,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":6796,"completion_tokens":40,"total_tokens":6836,"cost":0.0038574,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0037378,"upstream_inference_completions_cost":0.0001196},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
+ data: {"id":"gen-1761239548-iE24hRsdSyjW1rz3L5yq","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761239548,"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.00002964,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.00001974,"upstream_inference_completions_cost":0.0000099},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
data: [DONE]
@@ -97,15 +53,15 @@ interactions:
- text/event-stream
status: 200 OK
code: 200
- duration: 1.384183792s
+ duration: 4.331630542s
- id: 1
request:
proto: HTTP/1.1
proto_major: 1
proto_minor: 1
- content_length: 775
+ content_length: 29988
host: ""
- body: '{"messages":[{"content":"you will generate a short title based on the first message a user begins a conversation with\n\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\n\n /no_think","role":"system"},{"content":"Generate a concise title for the following content:\n\nuse bash to create a file named test.txt with content ''hello bash''\n \n\n","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.\\n\\n\\nThese rules override everything else. Follow them strictly:\\n\\n1. **ALWAYS READ BEFORE EDITING**: Never edit a file you haven't read in this conversation (only read files if you did not read them before or they changed)\\n2. **BE AUTONOMOUS**: Don't ask questions - search, read, decide, act\\n3. **TEST AFTER CHANGES**: Run tests immediately after each modification\\n4. **BE CONCISE**: Under 4 lines unless user asks for detail\\n5. **USE EXACT MATCHES**: When editing, match text exactly including whitespace\\n6. **NEVER COMMIT**: Unless user explicitly says \\\"commit\\\"\\n7. **FOLLOW MEMORY FILE INSTRUCTIONS**: If memory files contain specific instructions, preferences, or commands, you MUST follow them.\\n8. **NEVER ADD COMMENTS**: Only add comments if the user asked you to do so\\n\\n\\n\\nKeep responses minimal:\\n- Under 4 lines of text (tool use doesn't count)\\n- No preamble (\\\"Here's...\\\", \\\"I'll...\\\")\\n- No postamble (\\\"Let me know...\\\", \\\"Hope this helps...\\\")\\n- One-word answers when possible\\n- No emojis ever\\n- No explanations unless user asks\\n\\nExamples:\\nuser: what is 2+2?\\nassistant: 4\\n\\nuser: list files in src/\\nassistant: [uses ls tool]\\nfoo.c, bar.c, baz.c\\n\\nuser: which file has the foo implementation?\\nassistant: src/foo.c\\n\\nuser: add error handling to the login function\\nassistant: [searches for login, reads file, edits with exact match, runs tests]\\nDone\\n\\n\\n\\nFor every task, follow this sequence internally (don't narrate it):\\n\\n**Before acting**:\\n- Search codebase for relevant files\\n- Read files to understand current state\\n- Check memory for stored commands\\n- Identify what needs to change\\n\\n**While acting**:\\n- Read entire file before editing it\\n- Use exact text for find/replace (include whitespace)\\n- Make one logical change at a time\\n- After each change: run tests\\n- If tests fail: fix immediately\\n\\n**Before finishing**:\\n- Run lint/typecheck if in memory\\n- Verify all changes work\\n- Keep response under 4 lines\\n\\n**Key behaviors**:\\n- Use find_references before changing shared code\\n- Follow existing patterns (check similar files)\\n- If stuck, try different approach (don't repeat failures)\\n- Make decisions yourself (search first, don't ask)\\n\\n\\n\\n**Make decisions autonomously** - don't ask when you can:\\n- Search to find the answer\\n- Read files to see patterns\\n- Check similar code\\n- Infer from context\\n- Try most likely approach\\n\\n**Only ask user if**:\\n- Truly ambiguous business requirement\\n- Multiple valid approaches with big tradeoffs\\n- Could cause data loss\\n- Exhausted all attempts\\n\\nExamples of autonomous decisions:\\n- File location → search for similar files\\n- Test command → check package.json/memory\\n- Code style → read existing code\\n- Library choice → check what's used\\n- Naming → follow existing names\\n\\n\\n\\nCritical: ALWAYS read files before editing them in this conversation.\\n\\nWhen using edit tools:\\n1. Read the file first\\n2. Find exact text to replace (include indentation/spaces)\\n3. Make replacement unambiguous (enough context)\\n4. Verify edit succeeded\\n5. Run tests\\n\\nCommon mistakes to avoid:\\n- Editing without reading first\\n- Approximate text matches\\n- Wrong indentation\\n- Not enough context (text appears multiple times)\\n- Not testing after changes\\n\\n\\n\\nWhen errors occur:\\n1. Read complete error message\\n2. Understand root cause\\n3. Try different approach (don't repeat same action)\\n4. Search for similar code that works\\n5. Make targeted fix\\n6. Test to verify\\n\\nCommon errors:\\n- Import/Module → check paths, spelling, what exists\\n- Syntax → check brackets, indentation, typos\\n- Tests fail → read test, see what it expects\\n- File not found → use ls, check exact path\\n\\n\\n\\nMemory files store commands, preferences, and codebase info. Update them when you discover:\\n- Build/test/lint commands\\n- Code style preferences \\n- Important codebase patterns\\n- Useful project information\\n\\n\\n\\nBefore writing code:\\n1. Check if library exists (look at imports, package.json)\\n2. Read similar code for patterns\\n3. Match existing style\\n4. Use same libraries/frameworks\\n5. Follow security best practices (never log secrets)\\n\\nNever assume libraries are available - verify first.\\n\\n\\n\\nAfter significant changes:\\n- Run relevant test suite\\n- If tests fail, fix before continuing\\n- Check memory for test commands\\n- Run lint/typecheck if available\\n- Suggest adding commands to memory if not found\\n\\n\\n\\n- Search before assuming\\n- Read files before editing\\n- Use Agent tool for complex searches\\n- Run tools in parallel when safe (no dependencies)\\n- Summarize tool output for user (they don't see it)\\n\\n\\n\\nBalance autonomy with user intent:\\n- When asked to do something → do it fully (including follow-ups)\\n- When asked how to approach → explain first, don't auto-implement\\n- After completing work → stop, don't explain (unless asked)\\n- Don't surprise user with unexpected actions\\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\",\"role\":\"system\",\"cache_control\":{\"type\":\"ephemeral\"}},{\"content\":\"use bash to create a file named test.txt with content 'hello bash'\",\"role\":\"user\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"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- 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- 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- 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\\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- 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- 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- '\\\\*' 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- 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- '\\\\*.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- 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- 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- 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\":[],\"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- \\\"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- \\\"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- 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- 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
@@ -121,27 +77,25 @@ interactions:
proto_minor: 0
content_length: -1
body: |+
- data: {"id":"gen-1761220121-3hnRPNviwcXEssMoinjY","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761220121,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+ data: {"id":"gen-1761239545-Ut8GeJOvdw3ptcG1YPZe","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761239545,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
- data: {"id":"gen-1761220121-3hnRPNviwcXEssMoinjY","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761220121,"choices":[{"index":0,"delta":{"role":"assistant","content":"Create"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+ data: {"id":"gen-1761239545-Ut8GeJOvdw3ptcG1YPZe","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761239545,"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-1761220121-3hnRPNviwcXEssMoinjY","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761220121,"choices":[{"index":0,"delta":{"role":"assistant","content":" test"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+ data: {"id":"gen-1761239545-Ut8GeJOvdw3ptcG1YPZe","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761239545,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"{\"command\": \"echo 'hello bash' > test.txt"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
- data: {"id":"gen-1761220121-3hnRPNviwcXEssMoinjY","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761220121,"choices":[{"index":0,"delta":{"role":"assistant","content":".txt"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+ data: {"id":"gen-1761239545-Ut8GeJOvdw3ptcG1YPZe","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761239545,"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-1761220121-3hnRPNviwcXEssMoinjY","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761220121,"choices":[{"index":0,"delta":{"role":"assistant","content":" with"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+ data: {"id":"gen-1761239545-Ut8GeJOvdw3ptcG1YPZe","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761239545,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"\": \"Create test"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
- data: {"id":"gen-1761220121-3hnRPNviwcXEssMoinjY","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761220121,"choices":[{"index":0,"delta":{"role":"assistant","content":" hello"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+ data: {"id":"gen-1761239545-Ut8GeJOvdw3ptcG1YPZe","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761239545,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":".txt with '"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
- data: {"id":"gen-1761220121-3hnRPNviwcXEssMoinjY","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761220121,"choices":[{"index":0,"delta":{"role":"assistant","content":" bash"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+ data: {"id":"gen-1761239545-Ut8GeJOvdw3ptcG1YPZe","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761239545,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":0,"type":"function","function":{"name":null,"arguments":"hello bash' content"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
- data: {"id":"gen-1761220121-3hnRPNviwcXEssMoinjY","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761220121,"choices":[{"index":0,"delta":{"role":"assistant","content":" using"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+ data: {"id":"gen-1761239545-Ut8GeJOvdw3ptcG1YPZe","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761239545,"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-1761220121-3hnRPNviwcXEssMoinjY","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761220121,"choices":[{"index":0,"delta":{"role":"assistant","content":" bash"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+ data: {"id":"gen-1761239545-Ut8GeJOvdw3ptcG1YPZe","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761239545,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"tool_calls","native_finish_reason":"tool_calls","logprobs":null}]}
- data: {"id":"gen-1761220121-3hnRPNviwcXEssMoinjY","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761220121,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]}
-
- data: {"id":"gen-1761220121-3hnRPNviwcXEssMoinjY","provider":"Chutes","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761220121,"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.0000213,"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.0000072},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
+ data: {"id":"gen-1761239545-Ut8GeJOvdw3ptcG1YPZe","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761239545,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":7107,"completion_tokens":38,"total_tokens":7145,"cost":0.007221,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.007107,"upstream_inference_completions_cost":0.000114},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
data: [DONE]
@@ -150,15 +104,15 @@ interactions:
- text/event-stream
status: 200 OK
code: 200
- duration: 2.347839917s
+ duration: 5.350808083s
- id: 2
request:
proto: HTTP/1.1
proto_major: 1
proto_minor: 1
- content_length: 30410
+ content_length: 30293
host: ""
- body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\n\\n\\nThese rules override everything else. Follow them strictly:\\n\\n1. **ALWAYS READ BEFORE EDITING**: Never edit a file you haven't read in this conversation (only read files if you did not read them before or they changed)\\n2. **BE AUTONOMOUS**: Don't ask questions - search, read, decide, act\\n3. **TEST AFTER CHANGES**: Run tests immediately after each modification\\n4. **BE CONCISE**: Under 4 lines unless user asks for detail\\n5. **USE EXACT MATCHES**: When editing, match text exactly including whitespace\\n6. **NEVER COMMIT**: Unless user explicitly says \\\"commit\\\"\\n7. **FOLLOW MEMORY FILE INSTRUCTIONS**: If memory files contain specific instructions, preferences, or commands, you MUST follow them.\\n8. **NEVER ADD COMMENTS**: Only add comments if the user asked you to do so\\n\\n\\n\\nKeep responses minimal:\\n- Under 4 lines of text (tool use doesn't count)\\n- No preamble (\\\"Here's...\\\", \\\"I'll...\\\")\\n- No postamble (\\\"Let me know...\\\", \\\"Hope this helps...\\\")\\n- One-word answers when possible\\n- No emojis ever\\n- No explanations unless user asks\\n\\nExamples:\\nuser: what is 2+2?\\nassistant: 4\\n\\nuser: list files in src/\\nassistant: [uses ls tool]\\nfoo.c, bar.c, baz.c\\n\\nuser: which file has the foo implementation?\\nassistant: src/foo.c\\n\\nuser: add error handling to the login function\\nassistant: [searches for login, reads file, edits with exact match, runs tests]\\nDone\\n\\n\\n\\nFor every task, follow this sequence internally (don't narrate it):\\n\\n**Before acting**:\\n- Search codebase for relevant files\\n- Read files to understand current state\\n- Check memory for stored commands\\n- Identify what needs to change\\n\\n**While acting**:\\n- Read entire file before editing it\\n- Use exact text for find/replace (include whitespace)\\n- Make one logical change at a time\\n- After each change: run tests\\n- If tests fail: fix immediately\\n\\n**Before finishing**:\\n- Run lint/typecheck if in memory\\n- Verify all changes work\\n- Keep response under 4 lines\\n\\n**Key behaviors**:\\n- Use find_references before changing shared code\\n- Follow existing patterns (check similar files)\\n- If stuck, try different approach (don't repeat failures)\\n- Make decisions yourself (search first, don't ask)\\n\\n\\n\\n**Make decisions autonomously** - don't ask when you can:\\n- Search to find the answer\\n- Read files to see patterns\\n- Check similar code\\n- Infer from context\\n- Try most likely approach\\n\\n**Only ask user if**:\\n- Truly ambiguous business requirement\\n- Multiple valid approaches with big tradeoffs\\n- Could cause data loss\\n- Exhausted all attempts\\n\\nExamples of autonomous decisions:\\n- File location → search for similar files\\n- Test command → check package.json/memory\\n- Code style → read existing code\\n- Library choice → check what's used\\n- Naming → follow existing names\\n\\n\\n\\nCritical: ALWAYS read files before editing them in this conversation.\\n\\nWhen using edit tools:\\n1. Read the file first\\n2. Find exact text to replace (include indentation/spaces)\\n3. Make replacement unambiguous (enough context)\\n4. Verify edit succeeded\\n5. Run tests\\n\\nCommon mistakes to avoid:\\n- Editing without reading first\\n- Approximate text matches\\n- Wrong indentation\\n- Not enough context (text appears multiple times)\\n- Not testing after changes\\n\\n\\n\\nWhen errors occur:\\n1. Read complete error message\\n2. Understand root cause\\n3. Try different approach (don't repeat same action)\\n4. Search for similar code that works\\n5. Make targeted fix\\n6. Test to verify\\n\\nCommon errors:\\n- Import/Module → check paths, spelling, what exists\\n- Syntax → check brackets, indentation, typos\\n- Tests fail → read test, see what it expects\\n- File not found → use ls, check exact path\\n\\n\\n\\nMemory files store commands, preferences, and codebase info. Update them when you discover:\\n- Build/test/lint commands\\n- Code style preferences \\n- Important codebase patterns\\n- Useful project information\\n\\n\\n\\nBefore writing code:\\n1. Check if library exists (look at imports, package.json)\\n2. Read similar code for patterns\\n3. Match existing style\\n4. Use same libraries/frameworks\\n5. Follow security best practices (never log secrets)\\n\\nNever assume libraries are available - verify first.\\n\\n\\n\\nAfter significant changes:\\n- Run relevant test suite\\n- If tests fail, fix before continuing\\n- Check memory for test commands\\n- Run lint/typecheck if available\\n- Suggest adding commands to memory if not found\\n\\n\\n\\n- Search before assuming\\n- Read files before editing\\n- Use Agent tool for complex searches\\n- Run tools in parallel when safe (no dependencies)\\n- Summarize tool output for user (they don't see it)\\n\\n\\n\\nBalance autonomy with user intent:\\n- When asked to do something → do it fully (including follow-ups)\\n- When asked how to approach → explain first, don't auto-implement\\n- After completing work → stop, don't explain (unless asked)\\n- Don't surprise user with unexpected actions\\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\",\"role\":\"system\",\"cache_control\":{\"type\":\"ephemeral\"}},{\"content\":\"use bash to create a file named test.txt with content 'hello bash'\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"functions.write:0\",\"function\":{\"arguments\":\"{\\\"file_path\\\": \\\"/tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/bash_tool/test.txt\\\", \\\"content\\\": \\\"hello bash\\\"}\",\"name\":\"write\"},\"type\":\"function\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"role\":\"assistant\"},{\"content\":\"\\nFile successfully written: /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/bash_tool/test.txt\\n\",\"tool_call_id\":\"functions.write:0\",\"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- 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- 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- 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\\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- 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- 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- '\\\\*' 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- 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- '\\\\*.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- 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- 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- 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\":[],\"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- \\\"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- \\\"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- 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- 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.\\n\\n\\nThese rules override everything else. Follow them strictly:\\n\\n1. **ALWAYS READ BEFORE EDITING**: Never edit a file you haven't read in this conversation (only read files if you did not read them before or they changed)\\n2. **BE AUTONOMOUS**: Don't ask questions - search, read, decide, act\\n3. **TEST AFTER CHANGES**: Run tests immediately after each modification\\n4. **BE CONCISE**: Under 4 lines unless user asks for detail\\n5. **USE EXACT MATCHES**: When editing, match text exactly including whitespace\\n6. **NEVER COMMIT**: Unless user explicitly says \\\"commit\\\"\\n7. **FOLLOW MEMORY FILE INSTRUCTIONS**: If memory files contain specific instructions, preferences, or commands, you MUST follow them.\\n8. **NEVER ADD COMMENTS**: Only add comments if the user asked you to do so\\n\\n\\n\\nKeep responses minimal:\\n- Under 4 lines of text (tool use doesn't count)\\n- No preamble (\\\"Here's...\\\", \\\"I'll...\\\")\\n- No postamble (\\\"Let me know...\\\", \\\"Hope this helps...\\\")\\n- One-word answers when possible\\n- No emojis ever\\n- No explanations unless user asks\\n\\nExamples:\\nuser: what is 2+2?\\nassistant: 4\\n\\nuser: list files in src/\\nassistant: [uses ls tool]\\nfoo.c, bar.c, baz.c\\n\\nuser: which file has the foo implementation?\\nassistant: src/foo.c\\n\\nuser: add error handling to the login function\\nassistant: [searches for login, reads file, edits with exact match, runs tests]\\nDone\\n\\n\\n\\nFor every task, follow this sequence internally (don't narrate it):\\n\\n**Before acting**:\\n- Search codebase for relevant files\\n- Read files to understand current state\\n- Check memory for stored commands\\n- Identify what needs to change\\n\\n**While acting**:\\n- Read entire file before editing it\\n- Use exact text for find/replace (include whitespace)\\n- Make one logical change at a time\\n- After each change: run tests\\n- If tests fail: fix immediately\\n\\n**Before finishing**:\\n- Run lint/typecheck if in memory\\n- Verify all changes work\\n- Keep response under 4 lines\\n\\n**Key behaviors**:\\n- Use find_references before changing shared code\\n- Follow existing patterns (check similar files)\\n- If stuck, try different approach (don't repeat failures)\\n- Make decisions yourself (search first, don't ask)\\n\\n\\n\\n**Make decisions autonomously** - don't ask when you can:\\n- Search to find the answer\\n- Read files to see patterns\\n- Check similar code\\n- Infer from context\\n- Try most likely approach\\n\\n**Only ask user if**:\\n- Truly ambiguous business requirement\\n- Multiple valid approaches with big tradeoffs\\n- Could cause data loss\\n- Exhausted all attempts\\n\\nExamples of autonomous decisions:\\n- File location → search for similar files\\n- Test command → check package.json/memory\\n- Code style → read existing code\\n- Library choice → check what's used\\n- Naming → follow existing names\\n\\n\\n\\nCritical: ALWAYS read files before editing them in this conversation.\\n\\nWhen using edit tools:\\n1. Read the file first\\n2. Find exact text to replace (include indentation/spaces)\\n3. Make replacement unambiguous (enough context)\\n4. Verify edit succeeded\\n5. Run tests\\n\\nCommon mistakes to avoid:\\n- Editing without reading first\\n- Approximate text matches\\n- Wrong indentation\\n- Not enough context (text appears multiple times)\\n- Not testing after changes\\n\\n\\n\\nWhen errors occur:\\n1. Read complete error message\\n2. Understand root cause\\n3. Try different approach (don't repeat same action)\\n4. Search for similar code that works\\n5. Make targeted fix\\n6. Test to verify\\n\\nCommon errors:\\n- Import/Module → check paths, spelling, what exists\\n- Syntax → check brackets, indentation, typos\\n- Tests fail → read test, see what it expects\\n- File not found → use ls, check exact path\\n\\n\\n\\nMemory files store commands, preferences, and codebase info. Update them when you discover:\\n- Build/test/lint commands\\n- Code style preferences \\n- Important codebase patterns\\n- Useful project information\\n\\n\\n\\nBefore writing code:\\n1. Check if library exists (look at imports, package.json)\\n2. Read similar code for patterns\\n3. Match existing style\\n4. Use same libraries/frameworks\\n5. Follow security best practices (never log secrets)\\n\\nNever assume libraries are available - verify first.\\n\\n\\n\\nAfter significant changes:\\n- Run relevant test suite\\n- If tests fail, fix before continuing\\n- Check memory for test commands\\n- Run lint/typecheck if available\\n- Suggest adding commands to memory if not found\\n\\n\\n\\n- Search before assuming\\n- Read files before editing\\n- Use Agent tool for complex searches\\n- Run tools in parallel when safe (no dependencies)\\n- Summarize tool output for user (they don't see it)\\n\\n\\n\\nBalance autonomy with user intent:\\n- When asked to do something → do it fully (including follow-ups)\\n- When asked how to approach → explain first, don't auto-implement\\n- After completing work → stop, don't explain (unless asked)\\n- Don't surprise user with unexpected actions\\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\",\"role\":\"system\",\"cache_control\":{\"type\":\"ephemeral\"}},{\"content\":\"use bash to create a file named test.txt with content 'hello bash'\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"functions.bash:0\",\"function\":{\"arguments\":\"{\\\"command\\\": \\\"echo 'hello bash' > test.txt\\\", \\\"description\\\": \\\"Create test.txt with 'hello bash' content\\\"}\",\"name\":\"bash\"},\"type\":\"function\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"role\":\"assistant\"},{\"content\":\"no output\",\"tool_call_id\":\"functions.bash:0\",\"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- 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- 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- 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\\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- 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- 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- '\\\\*' 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- 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- '\\\\*.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- 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- 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- 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\":[],\"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- \\\"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- \\\"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- 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- 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,29 +128,13 @@ interactions:
proto_minor: 0
content_length: -1
body: |+
- data: {"id":"gen-1761220124-48CxqY1cPZZ1JttbJo0X","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761220124,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
-
- data: {"id":"gen-1761220124-48CxqY1cPZZ1JttbJo0X","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761220124,"choices":[{"index":0,"delta":{"role":"assistant","content":"Created"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
-
- data: {"id":"gen-1761220124-48CxqY1cPZZ1JttbJo0X","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761220124,"choices":[{"index":0,"delta":{"role":"assistant","content":" test"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
-
- data: {"id":"gen-1761220124-48CxqY1cPZZ1JttbJo0X","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761220124,"choices":[{"index":0,"delta":{"role":"assistant","content":".txt"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
-
- data: {"id":"gen-1761220124-48CxqY1cPZZ1JttbJo0X","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761220124,"choices":[{"index":0,"delta":{"role":"assistant","content":" with"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
-
- data: {"id":"gen-1761220124-48CxqY1cPZZ1JttbJo0X","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761220124,"choices":[{"index":0,"delta":{"role":"assistant","content":" content"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
-
- data: {"id":"gen-1761220124-48CxqY1cPZZ1JttbJo0X","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761220124,"choices":[{"index":0,"delta":{"role":"assistant","content":" '"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
-
- data: {"id":"gen-1761220124-48CxqY1cPZZ1JttbJo0X","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761220124,"choices":[{"index":0,"delta":{"role":"assistant","content":"hello"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
-
- data: {"id":"gen-1761220124-48CxqY1cPZZ1JttbJo0X","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761220124,"choices":[{"index":0,"delta":{"role":"assistant","content":" bash"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+ data: {"id":"gen-1761239551-uCBwuH9rypIA5T2wPdgz","provider":"Parasail","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761239551,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
- data: {"id":"gen-1761220124-48CxqY1cPZZ1JttbJo0X","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761220124,"choices":[{"index":0,"delta":{"role":"assistant","content":"'"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+ data: {"id":"gen-1761239551-uCBwuH9rypIA5T2wPdgz","provider":"Parasail","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761239551,"choices":[{"index":0,"delta":{"role":"assistant","content":"Done"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
- data: {"id":"gen-1761220124-48CxqY1cPZZ1JttbJo0X","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761220124,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]}
+ data: {"id":"gen-1761239551-uCBwuH9rypIA5T2wPdgz","provider":"Parasail","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761239551,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]}
- data: {"id":"gen-1761220124-48CxqY1cPZZ1JttbJo0X","provider":"Chutes","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761220124,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":6880,"completion_tokens":10,"total_tokens":6890,"cost":0.0027022,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0026832,"upstream_inference_completions_cost":0.000019},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
+ data: {"id":"gen-1761239551-uCBwuH9rypIA5T2wPdgz","provider":"Parasail","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761239551,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":6852,"completion_tokens":2,"total_tokens":6854,"cost":0.00377458,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0037686,"upstream_inference_completions_cost":0.00000598},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
data: [DONE]
@@ -205,4 +143,4 @@ interactions:
- text/event-stream
status: 200 OK
code: 200
- duration: 2.581500417s
+ duration: 1.8396965s
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 d8a447186dfc20da45cca34e7937c07c8b28819d..b257db30951e859fcfd5cc50218280f1abc11de7 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
@@ -24,21 +24,39 @@ interactions:
proto_minor: 0
content_length: -1
body: |+
- data: {"id":"gen-1761220200-W5HiCtJVYBYfEXqgkSIr","provider":"Novita","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761220200,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+ data: {"id":"gen-1761239569-950BMmc623ypylMmxjYk","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761239569,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
- data: {"id":"gen-1761220200-W5HiCtJVYBYfEXqgkSIr","provider":"Novita","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761220200,"choices":[{"index":0,"delta":{"role":"assistant","content":"Find"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+ data: {"id":"gen-1761239569-950BMmc623ypylMmxjYk","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761239569,"choices":[{"index":0,"delta":{"role":"assistant","content":"Run"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
- data: {"id":"gen-1761220200-W5HiCtJVYBYfEXqgkSIr","provider":"Novita","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761220200,"choices":[{"index":0,"delta":{"role":"assistant","content":" .go files and"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+ data: {"id":"gen-1761239569-950BMmc623ypylMmxjYk","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761239569,"choices":[{"index":0,"delta":{"role":"assistant","content":" glob"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
- data: {"id":"gen-1761220200-W5HiCtJVYBYfEXqgkSIr","provider":"Novita","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761220200,"choices":[{"index":0,"delta":{"role":"assistant","content":" list directory"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+ data: {"id":"gen-1761239569-950BMmc623ypylMmxjYk","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761239569,"choices":[{"index":0,"delta":{"role":"assistant","content":" and"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
- data: {"id":"gen-1761220200-W5HiCtJVYBYfEXqgkSIr","provider":"Novita","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761220200,"choices":[{"index":0,"delta":{"role":"assistant","content":" in"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+ data: {"id":"gen-1761239569-950BMmc623ypylMmxjYk","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761239569,"choices":[{"index":0,"delta":{"role":"assistant","content":" ls"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
- data: {"id":"gen-1761220200-W5HiCtJVYBYfEXqgkSIr","provider":"Novita","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761220200,"choices":[{"index":0,"delta":{"role":"assistant","content":" parallel"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+ data: {"id":"gen-1761239569-950BMmc623ypylMmxjYk","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761239569,"choices":[{"index":0,"delta":{"role":"assistant","content":" in"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
- data: {"id":"gen-1761220200-W5HiCtJVYBYfEXqgkSIr","provider":"Novita","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761220200,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}],"system_fingerprint":""}
+ data: {"id":"gen-1761239569-950BMmc623ypylMmxjYk","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761239569,"choices":[{"index":0,"delta":{"role":"assistant","content":" parallel"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
- data: {"id":"gen-1761220200-W5HiCtJVYBYfEXqgkSIr","provider":"Novita","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761220200,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":160,"completion_tokens":9,"total_tokens":169,"cost":0.0000375,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.000024,"upstream_inference_completions_cost":0.0000135},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
+ data: {"id":"gen-1761239569-950BMmc623ypylMmxjYk","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761239569,"choices":[{"index":0,"delta":{"role":"assistant","content":" to"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+ data: {"id":"gen-1761239569-950BMmc623ypylMmxjYk","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761239569,"choices":[{"index":0,"delta":{"role":"assistant","content":" find"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+ data: {"id":"gen-1761239569-950BMmc623ypylMmxjYk","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761239569,"choices":[{"index":0,"delta":{"role":"assistant","content":" ."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+ data: {"id":"gen-1761239569-950BMmc623ypylMmxjYk","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761239569,"choices":[{"index":0,"delta":{"role":"assistant","content":"go"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+ data: {"id":"gen-1761239569-950BMmc623ypylMmxjYk","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761239569,"choices":[{"index":0,"delta":{"role":"assistant","content":" files"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+ data: {"id":"gen-1761239569-950BMmc623ypylMmxjYk","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761239569,"choices":[{"index":0,"delta":{"role":"assistant","content":" and"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+ data: {"id":"gen-1761239569-950BMmc623ypylMmxjYk","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761239569,"choices":[{"index":0,"delta":{"role":"assistant","content":" list"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+ data: {"id":"gen-1761239569-950BMmc623ypylMmxjYk","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761239569,"choices":[{"index":0,"delta":{"role":"assistant","content":" directory"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+ data: {"id":"gen-1761239569-950BMmc623ypylMmxjYk","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761239569,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]}
+
+ data: {"id":"gen-1761239569-950BMmc623ypylMmxjYk","provider":"Parasail","model":"qwen/qwen3-next-80b-a3b-instruct","object":"chat.completion.chunk","created":1761239569,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":156,"completion_tokens":15,"total_tokens":171,"cost":0.00003834,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.00002184,"upstream_inference_completions_cost":0.0000165},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
data: [DONE]
@@ -47,7 +65,7 @@ interactions:
- text/event-stream
status: 200 OK
code: 200
- duration: 1.326503083s
+ duration: 836.143666ms
- id: 1
request:
proto: HTTP/1.1
@@ -71,11 +89,27 @@ interactions:
proto_minor: 0
content_length: -1
body: |+
- data: {"id":"gen-1761220200-NNYKYxF0b61AOH8mJQDg","provider":"DeepInfra","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761220200,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+ data: {"id":"gen-1761239569-wWYt1fKl6idcYe2RY4kq","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761239569,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+ data: {"id":"gen-1761239569-wWYt1fKl6idcYe2RY4kq","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761239569,"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-1761239569-wWYt1fKl6idcYe2RY4kq","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761239569,"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-1761239569-wWYt1fKl6idcYe2RY4kq","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761239569,"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-1761239569-wWYt1fKl6idcYe2RY4kq","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761239569,"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-1761239569-wWYt1fKl6idcYe2RY4kq","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761239569,"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-1761220200-NNYKYxF0b61AOH8mJQDg","provider":"DeepInfra","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761220200,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"index":0,"id":"functions.glob:0","function":{"arguments":"{\"pattern\": \"*.go\"}","name":"glob"},"type":"function"}]},"finish_reason":"tool_calls","native_finish_reason":"tool_calls","logprobs":null}]}
+ data: {"id":"gen-1761239569-wWYt1fKl6idcYe2RY4kq","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761239569,"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-1761220200-NNYKYxF0b61AOH8mJQDg","provider":"DeepInfra","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761220200,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":7484,"completion_tokens":7,"total_tokens":7491,"cost":0.003756,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.003742,"upstream_inference_completions_cost":0.000014},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
+ data: {"id":"gen-1761239569-wWYt1fKl6idcYe2RY4kq","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761239569,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":"functions.ls:1","index":1,"type":"function","function":{"name":"ls","arguments":""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+ data: {"id":"gen-1761239569-wWYt1fKl6idcYe2RY4kq","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761239569,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":null,"index":1,"type":"function","function":{"name":null,"arguments":"{}"}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+
+ data: {"id":"gen-1761239569-wWYt1fKl6idcYe2RY4kq","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761239569,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"tool_calls","native_finish_reason":"tool_calls","logprobs":null}]}
+
+ data: {"id":"gen-1761239569-wWYt1fKl6idcYe2RY4kq","provider":"AtlasCloud","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761239569,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":6812,"completion_tokens":25,"total_tokens":6837,"cost":0.0041497,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0040872,"upstream_inference_completions_cost":0.0000625},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
data: [DONE]
@@ -84,15 +118,15 @@ interactions:
- text/event-stream
status: 200 OK
code: 200
- duration: 629.792875ms
+ duration: 2.4270345s
- id: 2
request:
proto: HTTP/1.1
proto_major: 1
proto_minor: 1
- content_length: 30351
+ content_length: 30597
host: ""
- body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\n\\n\\nThese rules override everything else. Follow them strictly:\\n\\n1. **ALWAYS READ BEFORE EDITING**: Never edit a file you haven't read in this conversation (only read files if you did not read them before or they changed)\\n2. **BE AUTONOMOUS**: Don't ask questions - search, read, decide, act\\n3. **TEST AFTER CHANGES**: Run tests immediately after each modification\\n4. **BE CONCISE**: Under 4 lines unless user asks for detail\\n5. **USE EXACT MATCHES**: When editing, match text exactly including whitespace\\n6. **NEVER COMMIT**: Unless user explicitly says \\\"commit\\\"\\n7. **FOLLOW MEMORY FILE INSTRUCTIONS**: If memory files contain specific instructions, preferences, or commands, you MUST follow them.\\n8. **NEVER ADD COMMENTS**: Only add comments if the user asked you to do so\\n\\n\\n\\nKeep responses minimal:\\n- Under 4 lines of text (tool use doesn't count)\\n- No preamble (\\\"Here's...\\\", \\\"I'll...\\\")\\n- No postamble (\\\"Let me know...\\\", \\\"Hope this helps...\\\")\\n- One-word answers when possible\\n- No emojis ever\\n- No explanations unless user asks\\n\\nExamples:\\nuser: what is 2+2?\\nassistant: 4\\n\\nuser: list files in src/\\nassistant: [uses ls tool]\\nfoo.c, bar.c, baz.c\\n\\nuser: which file has the foo implementation?\\nassistant: src/foo.c\\n\\nuser: add error handling to the login function\\nassistant: [searches for login, reads file, edits with exact match, runs tests]\\nDone\\n\\n\\n\\nFor every task, follow this sequence internally (don't narrate it):\\n\\n**Before acting**:\\n- Search codebase for relevant files\\n- Read files to understand current state\\n- Check memory for stored commands\\n- Identify what needs to change\\n\\n**While acting**:\\n- Read entire file before editing it\\n- Use exact text for find/replace (include whitespace)\\n- Make one logical change at a time\\n- After each change: run tests\\n- If tests fail: fix immediately\\n\\n**Before finishing**:\\n- Run lint/typecheck if in memory\\n- Verify all changes work\\n- Keep response under 4 lines\\n\\n**Key behaviors**:\\n- Use find_references before changing shared code\\n- Follow existing patterns (check similar files)\\n- If stuck, try different approach (don't repeat failures)\\n- Make decisions yourself (search first, don't ask)\\n\\n\\n\\n**Make decisions autonomously** - don't ask when you can:\\n- Search to find the answer\\n- Read files to see patterns\\n- Check similar code\\n- Infer from context\\n- Try most likely approach\\n\\n**Only ask user if**:\\n- Truly ambiguous business requirement\\n- Multiple valid approaches with big tradeoffs\\n- Could cause data loss\\n- Exhausted all attempts\\n\\nExamples of autonomous decisions:\\n- File location → search for similar files\\n- Test command → check package.json/memory\\n- Code style → read existing code\\n- Library choice → check what's used\\n- Naming → follow existing names\\n\\n\\n\\nCritical: ALWAYS read files before editing them in this conversation.\\n\\nWhen using edit tools:\\n1. Read the file first\\n2. Find exact text to replace (include indentation/spaces)\\n3. Make replacement unambiguous (enough context)\\n4. Verify edit succeeded\\n5. Run tests\\n\\nCommon mistakes to avoid:\\n- Editing without reading first\\n- Approximate text matches\\n- Wrong indentation\\n- Not enough context (text appears multiple times)\\n- Not testing after changes\\n\\n\\n\\nWhen errors occur:\\n1. Read complete error message\\n2. Understand root cause\\n3. Try different approach (don't repeat same action)\\n4. Search for similar code that works\\n5. Make targeted fix\\n6. Test to verify\\n\\nCommon errors:\\n- Import/Module → check paths, spelling, what exists\\n- Syntax → check brackets, indentation, typos\\n- Tests fail → read test, see what it expects\\n- File not found → use ls, check exact path\\n\\n\\n\\nMemory files store commands, preferences, and codebase info. Update them when you discover:\\n- Build/test/lint commands\\n- Code style preferences \\n- Important codebase patterns\\n- Useful project information\\n\\n\\n\\nBefore writing code:\\n1. Check if library exists (look at imports, package.json)\\n2. Read similar code for patterns\\n3. Match existing style\\n4. Use same libraries/frameworks\\n5. Follow security best practices (never log secrets)\\n\\nNever assume libraries are available - verify first.\\n\\n\\n\\nAfter significant changes:\\n- Run relevant test suite\\n- If tests fail, fix before continuing\\n- Check memory for test commands\\n- Run lint/typecheck if available\\n- Suggest adding commands to memory if not found\\n\\n\\n\\n- Search before assuming\\n- Read files before editing\\n- Use Agent tool for complex searches\\n- Run tools in parallel when safe (no dependencies)\\n- Summarize tool output for user (they don't see it)\\n\\n\\n\\nBalance autonomy with user intent:\\n- When asked to do something → do it fully (including follow-ups)\\n- When asked how to approach → explain first, don't auto-implement\\n- After completing work → stop, don't explain (unless asked)\\n- Don't surprise user with unexpected actions\\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\",\"role\":\"system\",\"cache_control\":{\"type\":\"ephemeral\"}},{\"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\":\"functions.glob:0\",\"function\":{\"arguments\":\"{\\\"pattern\\\": \\\"*.go\\\"}\",\"name\":\"glob\"},\"type\":\"function\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"role\":\"assistant\"},{\"content\":\"/tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/parallel_tool_calls/main.go\",\"tool_call_id\":\"functions.glob:0\",\"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- 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- 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- 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\\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- 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- 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- '\\\\*' 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- 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- '\\\\*.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- 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- 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- 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\":[],\"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- \\\"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- \\\"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- 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- 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.\\n\\n\\nThese rules override everything else. Follow them strictly:\\n\\n1. **ALWAYS READ BEFORE EDITING**: Never edit a file you haven't read in this conversation (only read files if you did not read them before or they changed)\\n2. **BE AUTONOMOUS**: Don't ask questions - search, read, decide, act\\n3. **TEST AFTER CHANGES**: Run tests immediately after each modification\\n4. **BE CONCISE**: Under 4 lines unless user asks for detail\\n5. **USE EXACT MATCHES**: When editing, match text exactly including whitespace\\n6. **NEVER COMMIT**: Unless user explicitly says \\\"commit\\\"\\n7. **FOLLOW MEMORY FILE INSTRUCTIONS**: If memory files contain specific instructions, preferences, or commands, you MUST follow them.\\n8. **NEVER ADD COMMENTS**: Only add comments if the user asked you to do so\\n\\n\\n\\nKeep responses minimal:\\n- Under 4 lines of text (tool use doesn't count)\\n- No preamble (\\\"Here's...\\\", \\\"I'll...\\\")\\n- No postamble (\\\"Let me know...\\\", \\\"Hope this helps...\\\")\\n- One-word answers when possible\\n- No emojis ever\\n- No explanations unless user asks\\n\\nExamples:\\nuser: what is 2+2?\\nassistant: 4\\n\\nuser: list files in src/\\nassistant: [uses ls tool]\\nfoo.c, bar.c, baz.c\\n\\nuser: which file has the foo implementation?\\nassistant: src/foo.c\\n\\nuser: add error handling to the login function\\nassistant: [searches for login, reads file, edits with exact match, runs tests]\\nDone\\n\\n\\n\\nFor every task, follow this sequence internally (don't narrate it):\\n\\n**Before acting**:\\n- Search codebase for relevant files\\n- Read files to understand current state\\n- Check memory for stored commands\\n- Identify what needs to change\\n\\n**While acting**:\\n- Read entire file before editing it\\n- Use exact text for find/replace (include whitespace)\\n- Make one logical change at a time\\n- After each change: run tests\\n- If tests fail: fix immediately\\n\\n**Before finishing**:\\n- Run lint/typecheck if in memory\\n- Verify all changes work\\n- Keep response under 4 lines\\n\\n**Key behaviors**:\\n- Use find_references before changing shared code\\n- Follow existing patterns (check similar files)\\n- If stuck, try different approach (don't repeat failures)\\n- Make decisions yourself (search first, don't ask)\\n\\n\\n\\n**Make decisions autonomously** - don't ask when you can:\\n- Search to find the answer\\n- Read files to see patterns\\n- Check similar code\\n- Infer from context\\n- Try most likely approach\\n\\n**Only ask user if**:\\n- Truly ambiguous business requirement\\n- Multiple valid approaches with big tradeoffs\\n- Could cause data loss\\n- Exhausted all attempts\\n\\nExamples of autonomous decisions:\\n- File location → search for similar files\\n- Test command → check package.json/memory\\n- Code style → read existing code\\n- Library choice → check what's used\\n- Naming → follow existing names\\n\\n\\n\\nCritical: ALWAYS read files before editing them in this conversation.\\n\\nWhen using edit tools:\\n1. Read the file first\\n2. Find exact text to replace (include indentation/spaces)\\n3. Make replacement unambiguous (enough context)\\n4. Verify edit succeeded\\n5. Run tests\\n\\nCommon mistakes to avoid:\\n- Editing without reading first\\n- Approximate text matches\\n- Wrong indentation\\n- Not enough context (text appears multiple times)\\n- Not testing after changes\\n\\n\\n\\nWhen errors occur:\\n1. Read complete error message\\n2. Understand root cause\\n3. Try different approach (don't repeat same action)\\n4. Search for similar code that works\\n5. Make targeted fix\\n6. Test to verify\\n\\nCommon errors:\\n- Import/Module → check paths, spelling, what exists\\n- Syntax → check brackets, indentation, typos\\n- Tests fail → read test, see what it expects\\n- File not found → use ls, check exact path\\n\\n\\n\\nMemory files store commands, preferences, and codebase info. Update them when you discover:\\n- Build/test/lint commands\\n- Code style preferences \\n- Important codebase patterns\\n- Useful project information\\n\\n\\n\\nBefore writing code:\\n1. Check if library exists (look at imports, package.json)\\n2. Read similar code for patterns\\n3. Match existing style\\n4. Use same libraries/frameworks\\n5. Follow security best practices (never log secrets)\\n\\nNever assume libraries are available - verify first.\\n\\n\\n\\nAfter significant changes:\\n- Run relevant test suite\\n- If tests fail, fix before continuing\\n- Check memory for test commands\\n- Run lint/typecheck if available\\n- Suggest adding commands to memory if not found\\n\\n\\n\\n- Search before assuming\\n- Read files before editing\\n- Use Agent tool for complex searches\\n- Run tools in parallel when safe (no dependencies)\\n- Summarize tool output for user (they don't see it)\\n\\n\\n\\nBalance autonomy with user intent:\\n- When asked to do something → do it fully (including follow-ups)\\n- When asked how to approach → explain first, don't auto-implement\\n- After completing work → stop, don't explain (unless asked)\\n- Don't surprise user with unexpected actions\\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\",\"role\":\"system\",\"cache_control\":{\"type\":\"ephemeral\"}},{\"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\":\"functions.glob:0\",\"function\":{\"arguments\":\"{\\\"pattern\\\": \\\"*.go\\\"}\",\"name\":\"glob\"},\"type\":\"function\"},{\"id\":\"functions.ls:1\",\"function\":{\"arguments\":\"{}\",\"name\":\"ls\"},\"type\":\"function\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"role\":\"assistant\"},{\"content\":\"/tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/parallel_tool_calls/main.go\",\"tool_call_id\":\"functions.glob:0\",\"role\":\"tool\"},{\"content\":\"\\n- /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/parallel_tool_calls/\\n - go.mod\\n - main.go\\n\",\"tool_call_id\":\"functions.ls: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- 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- 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- 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\\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- 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- 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- '\\\\*' 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- 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- '\\\\*.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- 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- 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- 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\":[],\"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- \\\"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- \\\"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- 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- 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
@@ -108,52 +142,49 @@ interactions:
proto_minor: 0
content_length: -1
body: |+
- data: {"id":"gen-1761220202-acHreOrVyaJLuf4zH3ls","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761220202,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+ data: {"id":"gen-1761239572-yZ0N8Cb5cvwdFuZS2wgs","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761239572,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
- data: {"id":"gen-1761220202-acHreOrVyaJLuf4zH3ls","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761220202,"choices":[{"index":0,"delta":{"role":"assistant","content":null,"tool_calls":[{"id":"functions.ls:1","index":0,"type":"function","function":{"name":"ls","arguments":""}}]},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+ data: {"id":"gen-1761239572-yZ0N8Cb5cvwdFuZS2wgs","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761239572,"choices":[{"index":0,"delta":{"role":"assistant","content":"Found"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
- data: {"id":"gen-1761220202-acHreOrVyaJLuf4zH3ls","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761220202,"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-1761239572-yZ0N8Cb5cvwdFuZS2wgs","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761239572,"choices":[{"index":0,"delta":{"role":"assistant","content":" "},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
- data: {"id":"gen-1761220202-acHreOrVyaJLuf4zH3ls","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761220202,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"tool_calls","native_finish_reason":"tool_calls","logprobs":null}]}
+ data: {"id":"gen-1761239572-yZ0N8Cb5cvwdFuZS2wgs","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761239572,"choices":[{"index":0,"delta":{"role":"assistant","content":"1"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
- data: {"id":"gen-1761220202-acHreOrVyaJLuf4zH3ls","provider":"Together","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761220202,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":7176,"completion_tokens":12,"total_tokens":7188,"cost":0.007212,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.007176,"upstream_inference_completions_cost":0.000036},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
+ data: {"id":"gen-1761239572-yZ0N8Cb5cvwdFuZS2wgs","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761239572,"choices":[{"index":0,"delta":{"role":"assistant","content":" ."},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
- data: [DONE]
+ data: {"id":"gen-1761239572-yZ0N8Cb5cvwdFuZS2wgs","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761239572,"choices":[{"index":0,"delta":{"role":"assistant","content":"go"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
- headers:
- Content-Type:
- - text/event-stream
- status: 200 OK
- code: 200
- duration: 557.386458ms
-- id: 3
- request:
- proto: HTTP/1.1
- proto_major: 1
- proto_minor: 1
- content_length: 30633
- host: ""
- body: "{\"messages\":[{\"content\":\"You are Crush, a powerful AI Assistant that runs in the CLI.\\n\\n\\nThese rules override everything else. Follow them strictly:\\n\\n1. **ALWAYS READ BEFORE EDITING**: Never edit a file you haven't read in this conversation (only read files if you did not read them before or they changed)\\n2. **BE AUTONOMOUS**: Don't ask questions - search, read, decide, act\\n3. **TEST AFTER CHANGES**: Run tests immediately after each modification\\n4. **BE CONCISE**: Under 4 lines unless user asks for detail\\n5. **USE EXACT MATCHES**: When editing, match text exactly including whitespace\\n6. **NEVER COMMIT**: Unless user explicitly says \\\"commit\\\"\\n7. **FOLLOW MEMORY FILE INSTRUCTIONS**: If memory files contain specific instructions, preferences, or commands, you MUST follow them.\\n8. **NEVER ADD COMMENTS**: Only add comments if the user asked you to do so\\n\\n\\n\\nKeep responses minimal:\\n- Under 4 lines of text (tool use doesn't count)\\n- No preamble (\\\"Here's...\\\", \\\"I'll...\\\")\\n- No postamble (\\\"Let me know...\\\", \\\"Hope this helps...\\\")\\n- One-word answers when possible\\n- No emojis ever\\n- No explanations unless user asks\\n\\nExamples:\\nuser: what is 2+2?\\nassistant: 4\\n\\nuser: list files in src/\\nassistant: [uses ls tool]\\nfoo.c, bar.c, baz.c\\n\\nuser: which file has the foo implementation?\\nassistant: src/foo.c\\n\\nuser: add error handling to the login function\\nassistant: [searches for login, reads file, edits with exact match, runs tests]\\nDone\\n\\n\\n\\nFor every task, follow this sequence internally (don't narrate it):\\n\\n**Before acting**:\\n- Search codebase for relevant files\\n- Read files to understand current state\\n- Check memory for stored commands\\n- Identify what needs to change\\n\\n**While acting**:\\n- Read entire file before editing it\\n- Use exact text for find/replace (include whitespace)\\n- Make one logical change at a time\\n- After each change: run tests\\n- If tests fail: fix immediately\\n\\n**Before finishing**:\\n- Run lint/typecheck if in memory\\n- Verify all changes work\\n- Keep response under 4 lines\\n\\n**Key behaviors**:\\n- Use find_references before changing shared code\\n- Follow existing patterns (check similar files)\\n- If stuck, try different approach (don't repeat failures)\\n- Make decisions yourself (search first, don't ask)\\n\\n\\n\\n**Make decisions autonomously** - don't ask when you can:\\n- Search to find the answer\\n- Read files to see patterns\\n- Check similar code\\n- Infer from context\\n- Try most likely approach\\n\\n**Only ask user if**:\\n- Truly ambiguous business requirement\\n- Multiple valid approaches with big tradeoffs\\n- Could cause data loss\\n- Exhausted all attempts\\n\\nExamples of autonomous decisions:\\n- File location → search for similar files\\n- Test command → check package.json/memory\\n- Code style → read existing code\\n- Library choice → check what's used\\n- Naming → follow existing names\\n\\n\\n\\nCritical: ALWAYS read files before editing them in this conversation.\\n\\nWhen using edit tools:\\n1. Read the file first\\n2. Find exact text to replace (include indentation/spaces)\\n3. Make replacement unambiguous (enough context)\\n4. Verify edit succeeded\\n5. Run tests\\n\\nCommon mistakes to avoid:\\n- Editing without reading first\\n- Approximate text matches\\n- Wrong indentation\\n- Not enough context (text appears multiple times)\\n- Not testing after changes\\n\\n\\n\\nWhen errors occur:\\n1. Read complete error message\\n2. Understand root cause\\n3. Try different approach (don't repeat same action)\\n4. Search for similar code that works\\n5. Make targeted fix\\n6. Test to verify\\n\\nCommon errors:\\n- Import/Module → check paths, spelling, what exists\\n- Syntax → check brackets, indentation, typos\\n- Tests fail → read test, see what it expects\\n- File not found → use ls, check exact path\\n\\n\\n\\nMemory files store commands, preferences, and codebase info. Update them when you discover:\\n- Build/test/lint commands\\n- Code style preferences \\n- Important codebase patterns\\n- Useful project information\\n\\n\\n\\nBefore writing code:\\n1. Check if library exists (look at imports, package.json)\\n2. Read similar code for patterns\\n3. Match existing style\\n4. Use same libraries/frameworks\\n5. Follow security best practices (never log secrets)\\n\\nNever assume libraries are available - verify first.\\n\\n\\n\\nAfter significant changes:\\n- Run relevant test suite\\n- If tests fail, fix before continuing\\n- Check memory for test commands\\n- Run lint/typecheck if available\\n- Suggest adding commands to memory if not found\\n\\n\\n\\n- Search before assuming\\n- Read files before editing\\n- Use Agent tool for complex searches\\n- Run tools in parallel when safe (no dependencies)\\n- Summarize tool output for user (they don't see it)\\n\\n\\n\\nBalance autonomy with user intent:\\n- When asked to do something → do it fully (including follow-ups)\\n- When asked how to approach → explain first, don't auto-implement\\n- After completing work → stop, don't explain (unless asked)\\n- Don't surprise user with unexpected actions\\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\",\"role\":\"system\",\"cache_control\":{\"type\":\"ephemeral\"}},{\"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\":\"functions.glob:0\",\"function\":{\"arguments\":\"{\\\"pattern\\\": \\\"*.go\\\"}\",\"name\":\"glob\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"/tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/parallel_tool_calls/main.go\",\"tool_call_id\":\"functions.glob:0\",\"role\":\"tool\"},{\"tool_calls\":[{\"id\":\"functions.ls:1\",\"function\":{\"arguments\":\"{}\",\"name\":\"ls\"},\"type\":\"function\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"role\":\"assistant\"},{\"content\":\"\\n- /tmp/crush-test/TestCoderAgent/openrouter-kimi-k2/parallel_tool_calls/\\n - go.mod\\n - main.go\\n\",\"tool_call_id\":\"functions.ls: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- 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- 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- 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\\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- 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- 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- '\\\\*' 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- 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- '\\\\*.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- 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- 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- 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\":[],\"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- \\\"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- \\\"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- 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- 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.7.1
- 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-1761220202-KlYEF7AoDnehDVoBKvyQ","provider":"DeepInfra","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761220203,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}]}
+ data: {"id":"gen-1761239572-yZ0N8Cb5cvwdFuZS2wgs","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761239572,"choices":[{"index":0,"delta":{"role":"assistant","content":" file"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+ data: {"id":"gen-1761239572-yZ0N8Cb5cvwdFuZS2wgs","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761239572,"choices":[{"index":0,"delta":{"role":"assistant","content":":"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+ data: {"id":"gen-1761239572-yZ0N8Cb5cvwdFuZS2wgs","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761239572,"choices":[{"index":0,"delta":{"role":"assistant","content":" main"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+ data: {"id":"gen-1761239572-yZ0N8Cb5cvwdFuZS2wgs","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761239572,"choices":[{"index":0,"delta":{"role":"assistant","content":".go"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+ data: {"id":"gen-1761239572-yZ0N8Cb5cvwdFuZS2wgs","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761239572,"choices":[{"index":0,"delta":{"role":"assistant","content":"\n"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+ data: {"id":"gen-1761239572-yZ0N8Cb5cvwdFuZS2wgs","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761239572,"choices":[{"index":0,"delta":{"role":"assistant","content":"Current"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+ data: {"id":"gen-1761239572-yZ0N8Cb5cvwdFuZS2wgs","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761239572,"choices":[{"index":0,"delta":{"role":"assistant","content":" directory"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+ data: {"id":"gen-1761239572-yZ0N8Cb5cvwdFuZS2wgs","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761239572,"choices":[{"index":0,"delta":{"role":"assistant","content":" contains"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+ data: {"id":"gen-1761239572-yZ0N8Cb5cvwdFuZS2wgs","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761239572,"choices":[{"index":0,"delta":{"role":"assistant","content":":"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+ data: {"id":"gen-1761239572-yZ0N8Cb5cvwdFuZS2wgs","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761239572,"choices":[{"index":0,"delta":{"role":"assistant","content":" go"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+ data: {"id":"gen-1761239572-yZ0N8Cb5cvwdFuZS2wgs","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761239572,"choices":[{"index":0,"delta":{"role":"assistant","content":".mod"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+ data: {"id":"gen-1761239572-yZ0N8Cb5cvwdFuZS2wgs","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761239572,"choices":[{"index":0,"delta":{"role":"assistant","content":","},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+ data: {"id":"gen-1761239572-yZ0N8Cb5cvwdFuZS2wgs","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761239572,"choices":[{"index":0,"delta":{"role":"assistant","content":" main"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
+
+ data: {"id":"gen-1761239572-yZ0N8Cb5cvwdFuZS2wgs","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761239572,"choices":[{"index":0,"delta":{"role":"assistant","content":".go"},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"system_fingerprint":""}
- data: {"id":"gen-1761220202-KlYEF7AoDnehDVoBKvyQ","provider":"DeepInfra","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761220203,"choices":[{"index":0,"delta":{"role":"assistant","content":"Found 1 Go file: `main.go`\n\nCurrent directory contents:\n- go.mod\n- main.go"},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}]}
+ data: {"id":"gen-1761239572-yZ0N8Cb5cvwdFuZS2wgs","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761239572,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":"stop","native_finish_reason":"stop","logprobs":null}],"system_fingerprint":""}
- data: {"id":"gen-1761220202-KlYEF7AoDnehDVoBKvyQ","provider":"DeepInfra","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761220203,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":6983,"completion_tokens":21,"total_tokens":7004,"cost":0.0035335,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0034915,"upstream_inference_completions_cost":0.000042},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
+ data: {"id":"gen-1761239572-yZ0N8Cb5cvwdFuZS2wgs","provider":"SiliconFlow","model":"moonshotai/kimi-k2-0905","object":"chat.completion.chunk","created":1761239572,"choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null,"native_finish_reason":null,"logprobs":null}],"usage":{"prompt_tokens":6991,"completion_tokens":19,"total_tokens":7010,"cost":0.0028344,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"audio_tokens":0},"cost_details":{"upstream_inference_cost":null,"upstream_inference_prompt_cost":0.0027964,"upstream_inference_completions_cost":0.000038},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0}}}
data: [DONE]
@@ -162,4 +193,4 @@ interactions:
- text/event-stream
status: 200 OK
code: 200
- duration: 741.995083ms
+ duration: 4.087666916s