git_interop_colocate_13__d6LDiS2

Status: Failed
Started: 3/19 17:16
Execution: 3m 34.5s
Test: 11.1s
2026-03-19 09:17:10.163	DEBUG	native:1	Pochi	pochi v0.6.1
2026-03-19 09:17:10.167	DEBUG	native:7	PochiConfigManager	add workspace config: /root/.pochi/config.jsonc
2026-03-19 09:17:10.263	DEBUG	/$bunfs/pochi:503183	loadAgents	Loaded 5 custom agents (5 valid, 0 invalid)
2026-03-19 09:17:10.264	DEBUG	/$bunfs/pochi:503184	loadSkills	Loaded 2 skills (2 valid, 0 invalid)
2026-03-19 09:17:10.285	DEBUG	/$bunfs/pochi:439420	PochiVendor	JWT is expiring or missing, fetching a new one
2026-03-19 09:17:11.975	DEBUG	/$bunfs/pochi:415701	MCPHub	MCP servers configuration changed via signal:
2026-03-19 09:17:11.975	DEBUG	/$bunfs/pochi:415813	MCPHub	Build MCPHub Status
2026-03-19 09:17:12.086	DEBUG	/$bunfs/pochi:502609	TaskRunner	Starting TaskRunner...
2026-03-19 09:17:12.158	DEBUG	/$bunfs/pochi:454339	listFiles	Listing workspace files from /root with maxItems 500
2026-03-19 09:17:12.270	DEBUG	/$bunfs/pochi:496641	generateTaskTitle	Generating task title, old: null, new: You are a developer migrating from Git to Jujutsu (jj). You have an existing local Git repository at `/home/user/my-project`. Your task is to start using jj with this repository without breaking Git compatibility.\n\n1. Navigate to `/home/user/my-project`.\n2. Initialize a colocated jj repository so that jj and Git can be used together.\n3. Create a new bookmark named `feature-x`.\n4. Create a new file named `feature.txt` containing the text `Hello jj`.\n5. Create a new jj commit (or describe the working copy) with the description `Add feature.txt`.\n\nWhen finished, the repository should be a valid colocated jj/Git repo, the `feature-x` bookmark should exist and be exported to Git, and the commit should have the specified description and file.
2026-03-19 09:17:24.866	DEBUG	/$bunfs/pochi:454339	listFiles	Listing workspace files from /root with maxItems 500
2026-03-19 09:17:27.751	DEBUG	/$bunfs/pochi:496641	generateTaskTitle	Generating task title, old: You are a developer migrating from Git to Jujutsu (jj). You have an existing local Git repository at `/home/user/my-project`. Your task is to start using jj with this repository without breaking Git compatibility.\n\n1. Navigate to `/home/user/my-project`.\n2. Initialize a colocated jj repository so that jj and Git can be used together.\n3. Create a new bookmark named `feature-x`.\n4. Create a new file named `feature.txt` containing the text `Hello jj`.\n5. Create a new jj commit (or describe the working copy) with the description `Add feature.txt`.\n\nWhen finished, the repository should be a valid colocated jj/Git repo, the `feature-x` bookmark should exist and be exported to Git, and the commit should have the specified description and file., new: Migrate existing Git repository to colocated Jujutsu setup with bookmark and commit
2026-03-19 09:17:28.419	DEBUG	/$bunfs/pochi:454339	listFiles	Listing workspace files from /root with maxItems 500
2026-03-19 09:17:36.464	DEBUG	/$bunfs/pochi:454339	listFiles	Listing workspace files from /root with maxItems 500
2026-03-19 09:17:41.794	DEBUG	/$bunfs/pochi:454339	listFiles	Listing workspace files from /root with maxItems 500
2026-03-19 09:17:46.128	DEBUG	/$bunfs/pochi:454339	listFiles	Listing workspace files from /root with maxItems 500
2026-03-19 09:17:51.271	DEBUG	/$bunfs/pochi:454339	listFiles	Listing workspace files from /root with maxItems 500
2026-03-19 09:17:55.063	DEBUG	/$bunfs/pochi:454339	listFiles	Listing workspace files from /root with maxItems 500
2026-03-19 09:17:59.158	DEBUG	/$bunfs/pochi:454339	listFiles	Listing workspace files from /root with maxItems 500
2026-03-19 09:17:59.362	ERROR	/$bunfs/pochi:432009	LiveChatKit	onError

 AI_APICallError  This request would exceed your organization's rate limit of 2,000,000 input tokens per minute (org: e70c8d22-9099-49c5-a9af-e059e6515b76, model: claude-opus-4-6). For details, refer to: https://docs.claude.com/en/api/rate-limits. You can see the response headers for current usage. Please reduce the prompt length or the maximum tokens requested, or try again later. You may also contact sales at https://claude.com/contact-sales to discuss your options for a rate limit increase., AI_APICallError, , https://api.anthropic.com/v1/chat/completions, [object Object], 429, [object Object], {"error":{"code":"rate_limit_error","message":"This request would exceed your organization's rate limit of 2,000,000 input tokens per minute (org: e70c8d22-9099-49c5-a9af-e059e6515b76, model: claude-opus-4-6). For details, refer to: https://docs.claude.com/en/api/rate-limits. You can see the response headers for current usage. Please reduce the prompt length or the maximum tokens requested, or try again later. You may also contact sales at https://claude.com/contact-sales to discuss your options for a rate limit increase.","type":"invalid_request_error","param":null}}, true, [object Object], 423231, 30, 423231, 30, /$bunfs/root/pochi
error stack:
  • pochi	<anonymous>
	/$bunfs/pochi:423231
  • pochi	async <anonymous>
	/$bunfs/pochi:423092
  • native	processTicksAndRejections
	native:7
2026-03-19 09:17:59.380	ERROR	/$bunfs/pochi:502749	TaskRunner	Task is failed, trying to resend last message to resume it. {
  kind: 'APICallError',
  isRetryable: true,
  message: "This request would exceed your organization's rate limit of 2,000,000 input tokens per minute (org: e70c8d22-9099-49c5-a9af-e059e6515b76, model: claude-opus-4-6). For details, refer to: https://docs.claude.com/en/api/rate-limits. You can see the response headers for current usage. Please reduce the prompt length or the maximum tokens requested, or try again later. You may also contact sales at https://claude.com/contact-sales to discuss your options for a rate limit increase.",
  requestBodyValues: {
    model: 'claude-opus-4-6',
    max_tokens: 4096,
    messages: [
      {
        role: 'system',
        content: 'You are Pochi, a highly skilled software engineer with extensive knowledge in many programming languages, frameworks, design patterns, and best practices.\n' +
          '\n' +
          'IMPORTANT: You must NEVER generate or guess URLs for the user unless you are confident that the URLs are for helping the user with programming. You may use URLs provided by the user in their messages or local files.\n' +
          '\n' +
          'If the user asks for help or wants to give feedback inform them of the following:\n' +
          '- Join the discord channel at https://getpochi.com/discord to ask questions and get help\n' +
          '- To report bugs, users should report the issue at https://github.com/TabbyML/pochi/issues\n' +
          '\n' +
          "When the user directly asks about Pochi (eg 'can Pochi do...', 'does Pochi have...') or asks in second person (eg 'are you able...', 'can you do...'), first use curl to gather information to answer the question from Pochi docs at https://docs.getpochi.com/llms.txt\n" +
          '\n' +
          '====\n' +
          '\n' +
          'TASK MANAGEMENT\n' +
          '\n' +
          'You have access to the todoWrite tool to help you manage and plan tasks. Use these tools VERY frequently to ensure that you are tracking your tasks and giving the user visibility into your progress.\n' +
          'These tools are also EXTREMELY helpful for planning tasks, and for breaking down larger complex tasks into smaller steps. If you do not use this tool when planning, you may forget to do important tasks - and that is unacceptable.\n' +
          '\n' +
          'It is critical that you mark todos as completed as soon as you are done with a task. Do not batch up multiple tasks before marking them as completed.\n' +
          '\n' +
          '====\n' +
          '\n' +
          'RULES\n' +
          '\n' +
          "- User messages may include <system-reminder> tags. <system-reminder> tags contain useful information and reminders. They are NOT part of the user's provided input or the tool result. You shall pay close attention to information in these tags and use it to inform you actions.\n" +
          "- When the user initially gives you a task, a recursive list of all filepaths in the current working directory will be included in <system-reminder> tag. This provides an overview of the project's file structure, offering key insights into the project from directory/file names (how developers conceptualize and organize their code) and file extensions (the language used). This can also guide decision-making on which files to explore further. If you need to further explore directories such as outside the current working directory, you can use the listFiles tool. If you pass 'true' for the recursive parameter, it will list files recursively.\n" +
          '- All file paths used by tools must be relative to current working directory, do not use the ~ character or $HOME to refer to the home directory in file paths used by tools.\n' +
          "- You can use `pochi://` URI schema to access the Pochi virtual file system. This allows you to read and write files that are stored in Pochi's internal storage.\n" +
          "- Be sure to consider the type of project (e.g. Python, JavaScript, web application) when determining the appropriate structure and files to include. Also consider what files may be most relevant to accomplishing the task, for example looking at a project's manifest file would help you understand the project's dependencies, which you could incorporate into any code you write.\n" +
          "- Do not ask for more information than necessary. Use the tools provided to accomplish the user's request efficiently and effectively. When you've completed your task, you must use the attemptCompletion tool to present the result to the user. The user may provide feedback, which you can use to make improvements and try again.\n" +
          '- You are only allowed to ask the user questions using the askFollowupQuestion tool. Use this tool only when you need additional details to complete a task, and be sure to use a clear and concise question that will help you move forward with the task. However if you can use the available tools to avoid having to ask the user questions, you should do so. For example, if the user mentions a file that may be in an outside directory like the Desktop, you should use the listFiles tool to list the files in the Desktop and check if the file they are talking about is there, rather than asking the user to provide the file path themselves.\n' +
          `- You are STRICTLY FORBIDDEN from starting your messages with "Great", "Certainly", "Okay", "Sure". You should NOT be conversational in your responses, but rather direct and to the point. For example you should NOT say "Great, I've updated the CSS" but instead something like "I've updated the CSS". It is important you be clear and technical in your messages.\n` +
          "- Once you've completed the user's task, you MUST use the attemptCompletion tool to present the result of the task to the user. It is STRICTLY FORBIDDEN to complete the task without using this tool.\n" +
          '- When planning large-scale changes, create a high-level diagram using mermaid in Markdown. This helps explain your plan and allows you to gather user feedback before implementation.'
      },
      {
        role: 'user',
        content: [
          {
            type: 'text',
            text: '<system-reminder># System Information\n' +
              '\n' +
              'Operating System: linux\n' +
              'Default Shell: \n' +
              'Home Directory: /root\n' +
              'Current Working Directory: /root\n' +
              'Current Time: Thu Mar 19 2026 09:17:12 GMT+0000 (Coordinated Universal Time)\n' +
              '\n' +
              '# User Information\n' +
              '- Name: Test User\n' +
              '- Email: test@example.com\n' +
              '\n' +
              '# Current Working Directory (/root) Files\n' +
              '.bashrc\n' +
              '.profile\n' +
              '.daytona\n' +
              '.pochi\n' +
              '.gitconfig\n' +
              '.daytona/sessions\n' +
              '.pochi/config.jsonc\n' +
              '.daytona/sessions/a3777110-8132-47af-b51b-5923306e85aa\n' +
              '.daytona/sessions/693f5c50-112b-4d7e-b770-9650df4dec45\n' +
              '.daytona/sessions/380662f8-8805-47f4-91d4-31c76feba356\n' +
              '.daytona/sessions/9fa6e4a8-0a92-4a65-ac29-ae9e066c28a4\n' +
              '.daytona/sessions/a3777110-8132-47af-b51b-5923306e85aa/b4ba62f8-aee3-4106-9aef-66f6c5df79f2\n' +
              '.daytona/sessions/693f5c50-112b-4d7e-b770-9650df4dec45/ebb5ee05-6f54-4f88-9e78-089e3dc49fda\n' +
              '.daytona/sessions/380662f8-8805-47f4-91d4-31c76feba356/d6e3820d-c720-4dd4-b5a4-372b6a6f4077\n' +
              '.daytona/sessions/9fa6e4a8-0a92-4a65-ac29-ae9e066c28a4/4f04fe80-a746-46a5-b898-0d363239583c\n' +
              '.daytona/sessions/a3777110-8132-47af-b51b-5923306e85aa/b4ba62f8-aee3-4106-9aef-66f6c5df79f2/exit_code\n' +
              '.daytona/sessions/693f5c50-112b-4d7e-b770-9650df4dec45/ebb5ee05-6f54-4f88-9e78-089e3dc49fda/exit_code\n' +
              '.daytona/sessions/380662f8-8805-47f4-91d4-31c76feba356/d6e3820d-c720-4dd4-b5a4-372b6a6f4077/exit_code\n' +
              '\n' +
              '# GIT STATUS\n' +
              'Current branch: \n' +
              'Main branch (you will usually use this for PRs): \n' +
              '\n' +
              'Recent commits:\n' +
              '\n' +
              '\n' +
              '# TODOs\n' +
              'No TODOs yet, if you are working on tasks that would benefit from a todo list please use the todoWrite tool to create one.</system-reminder>'
          },
          {
            type: 'text',
            text: 'You are a developer migrating from Git to Jujutsu (jj). You have an existing local Git repository at `/home/user/my-project`. Your task is to start using jj with this repository without breaking Git compatibility.\\n\\n1. Navigate to `/home/user/my-project`.\\n2. Initialize a colocated jj repository so that jj and Git can be used together.\\n3. Create a new bookmark named `feature-x`.\\n4. Create a new file named `feature.txt` containing the text `Hello jj`.\\n5. Create a new jj commit (or describe the working copy) with the description `Add feature.txt`.\\n\\nWhen finished, the repository should be a valid colocated jj/Git repo, the `feature-x` bookmark should exist and be exported to Git, and the commit should have the specified description and file.'
          }
        ]
      },
      {
        role: 'assistant',
        content: '\n' +
          '\n' +
          "I'll work through this step-by-step, migrating the Git repository to use Jujutsu (jj) in colocated mode.",
        tool_calls: [
          {
            id: 'toolu_011rCkj2REAg3R87c4PHJkcQ',
            type: 'function',
            function: {
              name: 'todoWrite',
              arguments: `{"todos":[{"id":"check-repo","content":"Check if /home/user/my-project exists and has a Git repo","status":"in-progress","priority":"high"},{"id":"init-jj","content":"Initialize colocated jj repository","status":"pending","priority":"high"},{"id":"create-bookmark","content":"Create feature-x bookmark","status":"pending","priority":"high"},{"id":"create-file","content":"Create feature.txt with 'Hello jj'","status":"pending","priority":"high"},{"id":"describe-commit","content":"Describe/create commit with 'Add feature.txt'","status":"pending","priority":"high"},{"id":"verify","content":"Verify colocated repo, bookmark, and commit","status":"pending","priority":"high"}]}`
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_011rCkj2REAg3R87c4PHJkcQ',
        content: '{"success":true}'
      },
      {
        role: 'assistant',
        content: '',
        tool_calls: [
          {
            id: 'toolu_0174ARF4pbW41KSU4HQtRVw4',
            type: 'function',
            function: {
              name: 'executeCommand',
              arguments: '{"command":"ls -la /home/user/my-project 2>/dev/null; echo \\"---\\"; ls -la /home/user/my-project/.git 2>/dev/null"}'
            }
          },
          {
            id: 'toolu_01FmkuNLXYsjxvTsBfVmHFba',
            type: 'function',
            function: {
              name: 'executeCommand',
              arguments: '{"command":"which jj && jj --version"}'
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_0174ARF4pbW41KSU4HQtRVw4',
        content: '{"output":"total 8\\r\\ndrwxr-xr-x 3 root root   47 Mar 11 12:10 .\\r\\ndrwxr-xr-x 1 root root   32 Mar 11 12:10 ..\\r\\ndrwxr-xr-x 8 root root 4096 Mar 11 12:10 .git\\r\\n-rw-r--r-- 1 root root   15 Mar 11 12:10 README.md\\r\\n---\\r\\ntotal 28\\r\\ndrwxr-xr-x 8 root root 4096 Mar 11 12:10 .\\r\\ndrwxr-xr-x 3 root root   47 Mar 11 12:10 ..\\r\\n-rw-r--r-- 1 root root   15 Mar 11 12:10 COMMIT_EDITMSG\\r\\n-rw-r--r-- 1 root root   21 Mar 11 12:10 HEAD\\r\\ndrwxr-xr-x 2 root root    6 Mar 11 12:10 branches\\r\\n-rw-r--r-- 1 root root   92 Mar 11 12:10 config\\r\\n-rw-r--r-- 1 root root   73 Mar 11 12:10 description\\r\\ndrwxr-xr-x 2 root root 4096 Mar 11 12:10 hooks\\r\\n-rw-r--r-- 1 root root  137 Mar 11 12:10 index\\r\\ndrwxr-xr-x 2 root root   29 Mar 11 12:10 info\\r\\ndrwxr-xr-x 3 root root   30 Mar 11 12:10 logs\\r\\ndrwxr-xr-x 7 root root   84 Mar 11 12:10 objects\\r\\ndrwxr-xr-x 4 root root   43 Mar 11 12:10 refs\\r\\n","isTruncated":false}'
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_01FmkuNLXYsjxvTsBfVmHFba',
        content: '{"output":"/usr/local/bin/jj\\r\\njj 0.38.0-2508982cde5c7e4db0933e0b6469f9e778e71e28\\r\\n","isTruncated":false}'
      },
      {
        role: 'assistant',
        content: 'The Git repository exists at `/home/user/my-project` with a `README.md` file, and `jj` v0.38.0 is installed.',
        tool_calls: [
          {
            id: 'toolu_01ULas2uw3TnyRPAHN6aUhhT',
            type: 'function',
            function: {
              name: 'todoWrite',
              arguments: `{"todos":[{"id":"check-repo","content":"Check if /home/user/my-project exists and has a Git repo","status":"completed","priority":"high"},{"id":"init-jj","content":"Initialize colocated jj repository","status":"in-progress","priority":"high"},{"id":"create-bookmark","content":"Create feature-x bookmark","status":"pending","priority":"high"},{"id":"create-file","content":"Create feature.txt with 'Hello jj'","status":"pending","priority":"high"},{"id":"describe-commit","content":"Describe/create commit with 'Add feature.txt'","status":"pending","priority":"high"},{"id":"verify","content":"Verify colocated repo, bookmark, and commit","status":"pending","priority":"high"}]}`
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_01ULas2uw3TnyRPAHN6aUhhT',
        content: '{"success":true}'
      },
      {
        role: 'assistant',
        content: '**Step 1 & 2: Initialize a colocated jj repository.** The `--colocate` flag (or running `jj git init --colocate` inside an existing Git repo) sets up jj to share the `.git` directory, so both tools work together.',
        tool_calls: [
          {
            id: 'toolu_019jY8xFeB1m7PfbXfapjtni',
            type: 'function',
            function: {
              name: 'executeCommand',
              arguments: '{"command":"cd /home/user/my-project && jj git init --colocate"}'
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_019jY8xFeB1m7PfbXfapjtni',
        content: '{"output":"Done importing changes from the underlying Git repo.\\r\\nInitialized repo in \\".\\"\\r\\nHint: Running `git clean -xdf` will remove `.jj/`!\\r\\n","isTruncated":false}'
      },
      {
        role: 'assistant',
        content: 'Colocated jj repository initialized. Let me verify the `.jj` directory was created alongside `.git`:',
        tool_calls: [
          {
            id: 'toolu_017U73gxk7EtcnybfQfMwDDW',
            type: 'function',
            function: {
              name: 'executeCommand',
              arguments: '{"command":"ls -la /home/user/my-project/ | head -20"}'
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_017U73gxk7EtcnybfQfMwDDW',
        content: '{"output":"total 4\\r\\ndrwxr-xr-x 1 root root 41 Mar 19 09:17 .\\r\\ndrwxr-xr-x 1 root root 32 Mar 11 12:10 ..\\r\\ndrwxr-xr-x 1 root root 45 Mar 11 12:10 .git\\r\\ndrwxr-xr-x 4 root root 72 Mar 19 09:17 .jj\\r\\n-rw-r--r-- 1 root root 15 Mar 11 12:10 README.md\\r\\n","isTruncated":false}'
      },
      {
        role: 'assistant',
        content: 'Both `.git` and `.jj` directories exist — the repo is colocated.',
        tool_calls: [
          {
            id: 'toolu_01RbFKbcqvYrAPXMhdewxZNQ',
            type: 'function',
            function: {
              name: 'todoWrite',
              arguments: `{"todos":[{"id":"check-repo","content":"Check if /home/user/my-project exists and has a Git repo","status":"completed","priority":"high"},{"id":"init-jj","content":"Initialize colocated jj repository","status":"completed","priority":"high"},{"id":"create-bookmark","content":"Create feature-x bookmark","status":"in-progress","priority":"high"},{"id":"create-file","content":"Create feature.txt with 'Hello jj'","status":"pending","priority":"high"},{"id":"describe-commit","content":"Describe/create commit with 'Add feature.txt'","status":"pending","priority":"high"},{"id":"verify","content":"Verify colocated repo, bookmark, and commit","status":"pending","priority":"high"}]}`
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_01RbFKbcqvYrAPXMhdewxZNQ',
        content: '{"success":true}'
      },
      {
        role: 'assistant',
        content: '**Step 3: Create the `feature-x` bookmark.** Let me first check the current jj log to understand the state:',
        tool_calls: [
          {
            id: 'toolu_0194HmfhNtUVQ4zP16p2MXym',
            type: 'function',
            function: {
              name: 'executeCommand',
              arguments: '{"command":"cd /home/user/my-project && jj log"}'
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_0194HmfhNtUVQ4zP16p2MXym',
        content: '{"output":"@  uyntpwtv (no email set) 2026-03-19 09:17:41 5d317252\\r\\n│  (empty) (no description set)\\r\\nā—‹  ypsoummp test@example.com 2026-03-11 12:10:51 main 14d944a2\\r\\n│  Initial commit\\r\\nā—†  zzzzzzzz root() 00000000\\r\\n","isTruncated":false}'
      },
      {
        role: 'assistant',
        content: "The working copy change (`@`) is on top of the `main` branch. Now I'll create the `feature-x` bookmark pointing to the current working copy change:",
        tool_calls: [
          {
            id: 'toolu_01Bqso2WjCh52bGNmUGaHTFv',
            type: 'function',
            function: {
              name: 'executeCommand',
              arguments: '{"command":"cd /home/user/my-project && jj bookmark create feature-x -r @"}'
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_01Bqso2WjCh52bGNmUGaHTFv',
        content: `{"output":"Warning: Target revision is empty.\\r\\nCreated 1 bookmarks pointing to uyntpwtv 5d317252 feature-x | (empty) (no description set)\\r\\nWarning: Name and email not configured. Until configured, your commits will be created with the empty identity, and can't be pushed to remotes.\\r\\nHint: To configure, run:\\r\\n  jj config set --user user.name \\"Some One\\"\\r\\n  jj config set --user user.email \\"someone@example.com\\"\\r\\n","isTruncated":false}`
      }
    ],
    tools: [
      {
        type: 'function',
        function: {
          name: 'applyDiff',
          description: "This is a tool for editing files. For moving or renaming files, you should generally use the executeCommand tool with the 'mv' command instead. For larger edits, use the writeFile tool to overwrite files.\n" +
            '\n' +
            "Before using this tool, use the readFile tool to understand the file's contents and context\n" +
            '\n' +
            'To make a file edit, provide the following:\n' +
            '1. path: The path to the file to modify (relative to the current working directory, or an absolute path)\n' +
            '2. searchContent: The text to replace (must match the file contents exactly, including all whitespace and indentation)\n' +
            '3. replaceContent: The edited text to replace the searchContent (must be different from searchContent)\n' +
            '4. expectedReplacements: The number of replacements you expect to make. Defaults to 1 if not specified.\n' +
            '\n' +
            'By default, the tool will replace ONE occurrence of searchContent with replaceContent in the specified file. If you want to replace multiple occurrences, provide the expectedReplacements parameter with the exact number of occurrences you expect.\n' +
            '\n' +
            'CRITICAL REQUIREMENTS FOR USING THIS TOOL:\n' +
            '\n' +
            '1. UNIQUENESS (when expectedReplacements is not specified): The searchContent MUST uniquely identify the specific instance you want to change. This means:\n' +
            '   - Include AT LEAST 3-5 lines of context BEFORE the change point\n' +
            '   - Include AT LEAST 3-5 lines of context AFTER the change point\n' +
            '   - Include all whitespace, indentation, and surrounding code exactly as it appears in the file\n' +
            '\n' +
            '2. EXPECTED MATCHES: If you want to replace multiple instances:\n' +
            '   - Use the expectedReplacements parameter with the exact number of occurrences you expect to replace\n' +
            '   - This will replace ALL occurrences of the searchContent with the replaceContent\n' +
            "   - If the actual number of matches doesn't equal expectedReplacements, the edit will fail\n" +
            '   - This is a safety feature to prevent unintended replacements\n' +
            '\n' +
            '3. VERIFICATION: Before using this tool:\n' +
            '   - Check how many instances of the target text exist in the file\n' +
            '   - If multiple instances exist, either:\n' +
            '     a) Gather enough context to uniquely identify each one and make separate calls, OR\n' +
            '     b) Use expectedReplacements parameter with the exact count of instances you expect to replace\n' +
            '\n' +
            'WARNING:\n' +
            "- The tool will fail if searchContent matches multiple locations and expectedReplacements isn't specified\n" +
            "- The tool will fail if the number of matches doesn't equal expectedReplacements when it's specified\n" +
            "- The tool will fail if searchContent doesn't match the file contents exactly (including whitespace)\n" +
            '- The tool will fail if searchContent and replaceContent are the same\n' +
            '\n' +
            'When making edits:\n' +
            '   - Ensure the edit results in idiomatic, correct code\n' +
            '   - Do not add trailing whitespace to lines (a newline at the end of a file is fine)\n' +
            '   - Do not leave the code in a broken state\n' +
            '\n' +
            'If you want to create a new file, use:\n' +
            '   - A new file path, including dir name if needed\n' +
            '   - An empty searchContent\n' +
            "   - The new file's contents as replaceContent\n" +
            '\n' +
            'Remember: when making multiple file edits in a row to the same file, you should prefer to send all edits in a single message with multiple calls to this tool, rather than multiple messages with a single call each.\n' +
            '\n' +
            'You may see the following fields in the result:\n' +
            '- autoFormattingEdits: If the auto-formatter makes any changes, this field will contain a diff against the file content after your edits and any user edits have been applied.\n' +
            '- newProblems: If any new problems are found after the edit, this field will contain information about them.',
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path of the file to modify (relative to the current working directory, or an absolute path).'
              },
              searchContent: {
                type: 'string',
                description: 'The text to replace.'
              },
              replaceContent: {
                type: 'string',
                description: 'The text to replace it with.'
              },
              expectedReplacements: {
                type: 'number',
                description: 'The expected number of replacements to perform. Defaults to 1 if not specified.'
              }
            },
            required: [
              'path',
              'searchContent',
              'replaceContent'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'askFollowupQuestion',
          description: 'Ask the user a question to gather additional information needed to complete the task. \n' +
            '\n' +
            '## When to Use This Tool\n' +
            'Use this tool in the following scenarios:\n' +
            "1. The user's request is ambiguous or unclear and requires clarification.\n" +
            '2. You need more details to proceed effectively.\n' +
            '3. You have made several unsuccessful attempts to solve the issue and need user guidance to move forward.\n' +
            '4. Offer choices to the user about what direction to take.\n' +
            '\n' +
            '## Usage Notes\n' +
            '- Users will always be able to select "Other" to provide custom text input\n' +
            '- Use multiSelect: true to allow multiple answers to be selected for a question\n' +
            '- If you recommend a specific option, make that the first option in the list and add "(Recommended)" at the end of the label\n' +
            '- Provide 1-4 questions per call\n' +
            '\n' +
            'IMPORTANT: This tool CANNOT be used in combination with other tools (except todoWrite) in a single step. If you need to use other tools, you must do so in a separate step before calling this tool.',
          parameters: {
            type: 'object',
            properties: {
              questions: {
                type: 'array',
                items: {
                  type: 'object',
                  properties: {
                    question: {
                      type: 'string',
                      description: 'The complete question to ask the user. Should be clear, specific, and end with a question mark.'
                    },
                    header: {
                      type: 'string',
                      maxLength: 12,
                      description: 'Very short label displayed as a chip/tag (max 12 chars). Examples: "Auth method", "Library", "Approach".'
                    },
                    options: {
                      type: 'array',
                      items: {
                        type: 'object',
                        properties: {
                          label: {
                            type: 'string',
                            description: 'Short button label shown to the user. Should be concise (1-5 words) and clearly describe the choice.'
                          },
                          description: {
                            type: 'string',
                            description: 'Explanation of what this option means or what will happen if chosen. Useful for providing context about trade-offs or implications.'
                          }
                        },
                        required: [
                          'label'
                        ],
                        additionalProperties: false
                      },
                      minItems: 2,
                      maxItems: 4,
                      description: "The available choices for this question. Must have 2-4 options. Each option should be a distinct, mutually exclusive choice (unless multiSelect is enabled). There should be no 'Other' option, that will be provided automatically."
                    },
                    multiSelect: {
                      type: 'boolean',
                      default: false,
                      description: 'Set to true to allow the user to select multiple options instead of just one. Use when choices are not mutually exclusive.'
                    }
                  },
                  required: [
                    'question',
                    'header',
                    'options'
                  ],
                  additionalProperties: false
                },
                minItems: 1,
                maxItems: 4,
                description: 'Questions to ask the user (1-4 questions).'
              }
            },
            required: [
              'questions'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'attemptCompletion',
          description: "Once you've received the results of tool uses and can confirm that the task is complete, use this tool to present the result of your work to the user.\n" +
            '\n' +
            'You MUST NOT generate any text before this tool call. All conclusion text must be included within the result parameter of the attemptCompletion tool.\n' +
            'Never use this tool with a question or request to engage in further conversation! Formulate the end of your result in a way that is final and does not require further input from the user.\n' +
            '\n' +
            'IMPORTANT: This tool CANNOT be used in combination with other tools (except todoWrite) in a single step. If you need to use other tools, you must do so in a separate step before calling this tool.',
          parameters: {
            '$schema': 'http://json-schema.org/draft-07/schema#',
            type: 'object',
            properties: {
              result: {
                description: 'The result of the task. Formulate this result in a way that is final and does not require further input from the user.',
                type: 'string'
              }
            },
            required: [
              'result'
            ],
            additionalProperties: false
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'executeCommand',
          description: 'Executes a given bash command in a persistent shell session with optional timeout, ensuring proper handling and security measures.\n' +
            '\n' +
            'IMPORTANT: This tool is for terminal operations like git, npm, docker, etc. DO NOT use it for file operations (reading, writing, editing, searching, finding files) - use the specialized tools for this instead.\n' +
            '\n' +
            'Before executing the command, please follow these steps:\n' +
            '\n' +
            '1. Directory Verification:\n' +
            '   - If the command will create new directories or files, first use listFiles to verify the parent directory exists and is the correct location\n' +
            '   - For example, before running "mkdir foo/bar", first use listFiles to check that "foo" exists and is the intended parent directory\n' +
            '\n' +
            '2. Command Execution:\n' +
            '   - Always quote file paths that contain spaces with double quotes (e.g., cd "path with spaces/file.txt")\n' +
            '   - Examples of proper quoting:\n' +
            '     - cd "/Users/name/My Documents" (correct)\n' +
            '     - cd /Users/name/My Documents (incorrect - will fail)\n' +
            '     - python "/path/with spaces/script.py" (correct)\n' +
            '     - python /path/with spaces/script.py (incorrect - will fail)\n' +
            '   - After ensuring proper quoting, execute the command.\n' +
            '   - Capture the output of the command.\n' +
            '\n' +
            'Usage notes:\n' +
            '- The command argument is required.\n' +
            '- You can specify an optional timeout in seconds (up to 300s / 5 minutes). If not specified, commands will timeout after 60s (1 minute).\n' +
            '- If the output exceeds 30000 characters, output will be truncated before being returned to you.\n' +
            '- When issuing multiple commands:\n' +
            '  - If the commands are independent and can run in parallel, make multiple executeCommand tool calls in a single message. For example, if you need to run "git status" and "git diff", send a single message with two executeCommand tool calls in parallel.\n' +
            '  - If the commands depend on each other and must run sequentially, use a single executeCommand call with \'&&\' to chain them together (e.g., `git add . && git commit -m "message" && git push`). For instance, if one operation must complete before another starts (like mkdir before cp, Write before executeCommand for git operations, or git add before git commit), run these operations sequentially instead.\n' +
            "  - Use ';' only when you need to run commands sequentially but don't care if earlier commands fail\n" +
            '  - DO NOT use newlines to separate commands (newlines are ok in quoted strings)\n' +
            "- You shall avoid use the markdown code block syntax (backtick, '`') in your command, as it will be interpreted as a command substitution.\n" +
            "- Before using this tool, you must first think about the context provided in <system-reminder> to understand the user's environment and tailor your commands to ensure they are compatible with their system. You must also consider if the command you need to run should be executed in a specific directory rather than the current working directory, and properly set the `cwd` if necessary.\n" +
            '\n' +
            '# Committing changes with git\n' +
            '\n' +
            'Only create commits when requested by the user. If unclear, ask first. When the user asks you to create a new git commit, follow these steps carefully:\n' +
            '\n' +
            'Git Safety Protocol:\n' +
            '- NEVER update the git config\n' +
            "- NEVER run destructive git commands (push --force, reset --hard, checkout ., restore ., clean -f, branch -D) unless the user explicitly requests these actions. Taking unauthorized destructive actions is unhelpful and can result in lost work, so it's best to ONLY run these commands when given direct instructions \n" +
            '- NEVER skip hooks (--no-verify, --no-gpg-sign, etc) unless the user explicitly requests it\n' +
            '- NEVER run force push to main/master, warn the user if they request it\n' +
            '- CRITICAL: Always create NEW commits rather than amending, unless the user explicitly requests a git amend. When a pre-commit hook fails, the commit did NOT happen  — so --amend would modify the PREVIOUS commit, which may result in destroying work or losing previous changes. Instead, after hook failure, fix the issue, re-stage, and create a NEW commit\n' +
            '- When staging files, prefer adding specific files by name rather than using "git add -A" or "git add .", which can accidentally include sensitive files (.env, credentials) or large binaries\n' +
            '- NEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked, otherwise the user will feel that you are being too proactive\n' +
            '\n' +
            '1. You can call multiple tools in a single response. When multiple independent pieces of information are requested and all commands are likely to succeed, run multiple tool calls in parallel for optimal performance. run the following bash commands in parallel, each using the executeCommand tool:\n' +
            '  - Run a git status command to see all untracked files. IMPORTANT: Never use the -uall flag as it can cause memory issues on large repos.\n' +
            '  - Run a git diff command to see both staged and unstaged changes that will be committed.\n' +
            "  - Run a git log command to see recent commit messages, so that you can follow this repository's commit message style.\n" +
            '2. Analyze all staged changes (both previously staged and newly added) and draft a commit message:\n' +
            '  - Summarize the nature of the changes (eg. new feature, enhancement to an existing feature, bug fix, refactoring, test, docs, etc.). Ensure the message accurately reflects the changes and their purpose (i.e. "add" means a wholly new feature, "update" means an enhancement to an existing feature, "fix" means a bug fix, etc.).\n' +
            '  - Do not commit files that likely contain secrets (.env, credentials.json, etc). Warn the user if they specifically request to commit those files\n' +
            '  - Draft a concise (1-2 sentences) commit message that focuses on the "why" rather than the "what"\n' +
            '  - Ensure it accurately reflects the changes and their purpose\n' +
            '3. You can call multiple tools in a single response. When multiple independent pieces of information are requested and all commands are likely to succeed, run multiple tool calls in parallel for optimal performance. run the following commands:\n' +
            '   - Add relevant untracked files to the staging area.\n' +
            '   - Create the commit with a message ending with:\n' +
            '   šŸ¤– Generated with [Pochi](https://getpochi.com) | [Task](<Share URL>)\n' +
            '\n' +
            '   Co-Authored-By: Pochi <noreply@getpochi.com>\n' +
            '\n' +
            '   Note: Replace <Share URL> with the Share URL from system information if available. If not available, omit the " | [Task](...)" part.\n' +
            '\n' +
            '   - Run git status after the commit completes to verify success.\n' +
            '   Note: git status depends on the commit completing, so run it sequentially after the commit.\n' +
            '4. If the commit fails due to pre-commit hook changes, retry the commit ONCE to include these automated changes. If it fails again, it usually means a pre-commit hook is preventing the commit. If the commit succeeds but you notice that files were modified by the pre-commit hook, you MUST amend your commit to include them.\n' +
            '\n' +
            'Important notes:\n' +
            '- NEVER update the git config\n' +
            '- NEVER run additional commands to read or explore code, besides git bash commands\n' +
            '- DO NOT push to the remote repository unless the user explicitly asks you to do so\n' +
            '- IMPORTANT: Never use git commands with the -i flag (like git rebase -i or git add -i) since they require interactive input which is not supported.\n' +
            '- IMPORTANT: Do not use --no-edit with git rebase commands, as the --no-edit flag is not a valid option for git rebase.\n' +
            '- If there are no changes to commit (i.e., no untracked files and no modifications), do not create an empty commit\n' +
            '- In order to ensure good formatting, ALWAYS pass the commit message via a HEREDOC, a la this example:\n' +
            '<example>\n' +
            `git commit -m "$(cat <<'EOF'\n` +
            'Commit message here.\n' +
            '\n' +
            'šŸ¤– Generated with [Pochi](https://getpochi.com) | [Task](<Share URL>)\n' +
            '\n' +
            'Co-Authored-By: Pochi <noreply@getpochi.com>\n' +
            'EOF\n' +
            ')"\n' +
            '</example>\n' +
            '\n' +
            '# Creating pull requests\n' +
            'Use the gh command via the executeCommand tool for ALL GitHub-related tasks including working with issues, pull requests, checks, and releases. If given a Github URL use the gh command to get the information needed.\n' +
            '\n' +
            'IMPORTANT: When the user asks you to create a pull request, follow these steps carefully:\n' +
            '\n' +
            '1. You can call multiple tools in a single response. When multiple independent pieces of information are requested and all commands are likely to succeed, run multiple tool calls in parallel for optimal performance. run the following bash commands in parallel using the executeCommand tool, in order to understand the current state of the branch since it diverged from the main branch:\n' +
            '   - Run a git status command to see all untracked files (never use -uall flag)\n' +
            '   - Run a git diff command to see both staged and unstaged changes that will be committed\n' +
            '   - Check if the current branch tracks a remote branch and is up to date with the remote, so you know if you need to push to the remote\n' +
            '   - Run a git log command and `git diff [base-branch]...HEAD` to understand the full commit history for the current branch (from the time it diverged from the base branch)\n' +
            '2. Analyze all changes that will be included in the pull request, making sure to look at all relevant commits (NOT just the latest commit, but ALL commits that will be included in the pull request!!!), and draft a pull request title and summary:\n' +
            '   - Keep the PR title short (under 70 characters)\n' +
            '   - Use the description/body for details, not the title\n' +
            '3. You can call multiple tools in a single response. When multiple independent pieces of information are requested and all commands are likely to succeed, run multiple tool calls in parallel for optimal performance. run the following commands in parallel:\n' +
            '   - Create new branch if needed\n' +
            '   - Push to remote with -u flag if needed\n' +
            '   - Create PR using gh pr create with the format below. Use a HEREDOC to pass the body to ensure correct formatting.\n' +
            '<example>\n' +
            `gh pr create --title "the pr title" --body "$(cat <<'EOF'\n` +
            '## Summary\n' +
            '<1-3 bullet points>\n' +
            '\n' +
            '## Test plan\n' +
            '[Checklist of TODOs for testing the pull request...]\n' +
            '\n' +
            'šŸ¤– Generated with [Pochi](https://getpochi.com) | [Task](<Share URL>)\n' +
            'EOF\n' +
            ')"\n' +
            '</example>\n' +
            '\n' +
            'Important:\n' +
            '- NEVER update the git confi'... 355 more characters,
          parameters: {
            type: 'object',
            properties: {
              command: {
                type: 'string',
                description: 'The CLI command to execute. This should be valid for the current operating system.'
              },
              cwd: {
                type: 'string',
                description: 'The working directory to execute the command in.'
              },
              timeout: {
                type: 'number',
                minimum: 1,
                maximum: 300,
                description: 'Optional timeout in seconds, max 300 seconds. By default the timeout is 120 seconds.'
              }
            },
            required: [
              'command'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'globFiles',
          description: 'Request to find files matching a glob pattern within a specified directory. Use this to get a list of files based on a pattern.',
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path of the directory to search in (relative to the current working directory, or an absolute path)'
              },
              globPattern: {
                type: 'string',
                description: "The glob pattern to match files against (e.g., '*.ts', '**/*.js')"
              }
            },
            required: [
              'path',
              'globPattern'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'listFiles',
          description: 'Request to list files and directories within the specified directory. If recursive is true, it will list all files and directories recursively. If recursive is false or not provided, it will only list the top-level contents. Do not use this tool to confirm the existence of files you may have created, as the user will let you know if the files were created successfully or not.',
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path of the directory to list contents for (relative to the current working directory, or an absolute path)'
              },
              recursive: {
                type: 'boolean',
                description: 'Whether to list files and directories recursively.'
              }
            },
            required: [
              'path'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'readFile',
          description: 'Request to read the contents of a file at the specified path. Use this when you need to examine the contents of an existing file you do not know the contents of, for example to analyze code, review text files, extract information from configuration files.\n' +
            '',
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path of the file to read (relative to the current working directory, or an absolute path)'
              },
              startLine: {
                type: 'number',
                description: 'The starting line number to read from (1-based). If not provided, it starts from the beginning of the file.'
              },
              endLine: {
                type: 'number',
                description: 'The ending line number to read to (1-based, inclusive). If not provided, it reads to the end of the file.'
              }
            },
            required: [
              'path'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'useSkill',
          description: 'Execute a skill within the main conversation\n' +
            '\n' +
            'When users ask you to perform tasks, check if any of the available skills below can help complete the task more effectively. Skills provide specialized capabilities and domain knowledge.\n' +
            '\n' +
            'When users ask about a SPECIFIC skill (e.g., "How does the pdf skill work?", "What does the commit skill do?"), you must call this tool to get detailed information about that skill.\n' +
            '\n' +
            'When users ask general questions like "What skills are available?" or "List all skills", simply refer to the "Available skills" section below - do NOT call this tool.\n' +
            '\n' +
            "This tool returns the skill's detailed instructions which you must then follow to complete the task. The instructions contain step-by-step guidance on how to perform the specific task or workflow.\n" +
            '\n' +
            'How to invoke:\n' +
            '- Use this tool with the skill name\n' +
            '- Example: `skill: "pdf-processing"` - invoke the pdf-processing skill\n' +
            "- The tool will return the skill's instructions\n" +
            '- Follow the returned instructions carefully to complete the task\n' +
            '\n' +
            'Important:\n' +
            '- When a skill is relevant for a task OR when users ask about a SPECIFIC skill, you must invoke this tool IMMEDIATELY as your first action\n' +
            '- For general questions about available skills, simply refer to the "Available skills" list below without calling this tool\n' +
            '- NEVER just announce or mention a skill in your text response without actually calling this tool (except for general skill listing requests)\n' +
            '- This is a BLOCKING REQUIREMENT: invoke the relevant Skill tool BEFORE generating any other response about a specific skill or task\n' +
            '- Only use skills listed in "Available skills" below\n' +
            '- Check compatibility requirements before using a skill - ensure the skill is compatible with the current OS/environment\n' +
            '- After calling this tool, follow the returned instructions step by step\n' +
            '- The skill file location is shown in the [Location: filepath] section of each skill listing below - use this information to understand where the skill is defined\n' +
            "- Use the directory containing the skill's source file as the base directory for resolving any resource files mentioned in the instructions\n" +
            '- Proactively explore the skill directory for optional resources that enhance task completion:\n' +
            '  * scripts/ - executable code that agents can run (Python, Bash, JavaScript, etc.)\n' +
            '  * references/ - on-demand documentation (REFERENCE.md, FORMS.md, domain-specific files)\n' +
            '  * assets/ - static resources (templates, images, data files, schemas)\n' +
            '  Use these resources when they exist and are relevant to the current task\n' +
            '\n' +
            'Available skills:\n' +
            '\n' +
            '- **find-skills**: Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill. [Location: _builtIn_]\n' +
            '- **create-skill**: Helps users create new custom agent skills. Use when the user wants to create a new skill, automate a workflow, or package specialized knowledge for reuse. [Location: _builtIn_]',
          parameters: {
            type: 'object',
            properties: {
              skill: {
                type: 'string',
                description: 'The name of the skill to use.'
              }
            },
            required: [
              'skill'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'searchFiles',
          description: '- Fast content search tool that works with any codebase size\n' +
            '- Searches file contents using regular expressions\n' +
            '- Supports Rust regex syntax (eg. "log.*Error", "functions+w+", etc.)\n' +
            '- Filter files by pattern with the include parameter (eg. "*.js", "*.{ts,tsx}")\n' +
            '- Returns file paths with at least one match sorted by modification time\n' +
            '- Use this tool when you need to find files containing specific patterns\n' +
            '- Craft your regex patterns carefully to balance specificity and flexibility.\n' +
            "- Based on the user's task you may use it to find code patterns, TODO comments, function definitions, or any text-based information across the project. The results include context, so analyze the surrounding code to better understand the matches. Leverage the this tool in combination with other tools for more comprehensive analysis. For example, use it to find specific code patterns, then use readFile to examine the full context of interesting matches before using applyDiff or writeToFile to make informed changes.",
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path of the directory to search in (relative to the current working directory, or an absolute path).'
              },
              regex: {
                type: 'string',
                description: 'The regular expression pattern to search for in file contents. Uses Rust regex syntax.'
              },
              filePattern: {
                type: 'string',
                description: 'File pattern to include in the search (e.g. "*.js", "*.{ts,tsx}"). If not provided, it will search all files.'
              }
            },
            required: [
              'path',
              'regex'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'todoWrite',
          description: 'Use this tool to create and manage a structured task list for your current coding session. This helps you track progress, organize complex tasks, and demonstrate thoroughness to the user.\n' +
            'It also helps the user understand the progress of the task and overall progress of their requests.\n' +
            '\n' +
            '## When to Use This Tool\n' +
            'Use this tool proactively in these scenarios:\n' +
            '\n' +
            '1. Complex multi-step tasks - When a task requires 3 or more distinct steps or actions\n' +
            '2. Non-trivial and complex tasks - Tasks that require careful planning or multiple operations\n' +
            '3. User explicitly requests todo list - When the user directly asks you to use the todo list\n' +
            '4. User provides multiple tasks - When users provide a list of things to be done (numbered or comma-separated)\n' +
            '5. After receiving new instructions - Immediately capture user requirements as todos. Feel free to edit the todo list based on new information.\n' +
            '6. After completing a task - Mark it complete and add any new follow-up tasks\n' +
            '7. When you start working on a new task, mark the todo as in-progress. Ideally you should only have one todo as in-progress at a time. Complete existing tasks before starting new ones.\n' +
            '\n' +
            '## When NOT to Use This Tool\n' +
            '\n' +
            'Skip using this tool when:\n' +
            '1. There is only a single, straightforward task\n' +
            '2. The task is trivial and tracking it provides no organizational benefit\n' +
            '3. The task can be completed in less than 3 trivial steps\n' +
            '4. The task is purely conversational or informational\n' +
            '\n' +
            'NOTE that you should use should not use this tool if there is only one trivial task to do. In this case you are better off just doing the task directly.\n' +
            '\n' +
            '## Examples of When to Use the Todo List\n' +
            '\n' +
            '<example>\n' +
            "User: I want to add a dark mode toggle to the application settings. Make sure you run the tests and build when you're done!\n" +
            "Assistant: I'll help add a dark mode toggle to your application settings. Let me create a todo list to track this implementation.\n" +
            '*Creates todo list with the following items:*\n' +
            '1. Create dark mode toggle component in Settings page\n' +
            '2. Add dark mode state management (context/store)\n' +
            '3. Implement CSS-in-JS styles for dark theme\n' +
            '4. Update existing components to support theme switching\n' +
            '5. Run tests and build process, addressing any failures or errors that occur\n' +
            '*Begins working on the first task*\n' +
            '\n' +
            '<reasoning>\n' +
            'The assistant used the todo list because:\n' +
            '1. Adding dark mode is a multi-step feature requiring UI, state management, and styling changes\n' +
            '2. The user explicitly requested tests and build be run afterward\n' +
            '3. The assistant inferred that tests and build need to pass by adding "Ensure tests and build succeed" as the final task\n' +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '<example>\n' +
            'User: Help me rename the function getCwd to getCurrentWorkingDirectory across my project\n' +
            "Assistant: Let me first search through your codebase to find all occurrences of 'getCwd'.\n" +
            '*Uses grep or search tools to locate all instances of getCwd in the codebase*\n' +
            "Assistant: I've found 15 instances of 'getCwd' across 8 different files. Let me create a todo list to track these changes.\n" +
            '*Creates todo list with specific items for each file that needs updating*\n' +
            '\n' +
            '<reasoning>\n' +
            'The assistant used the todo list because:\n' +
            '1. First, the assistant searched to understand the scope of the task\n' +
            '2. Upon finding multiple occurrences across different files, it determined this was a complex task with multiple steps\n' +
            '3. The todo list helps ensure every instance is tracked and updated systematically\n' +
            '4. This approach prevents missing any occurrences and maintains code consistency\n' +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '\n' +
            '<example>\n' +
            'User: I need to implement these features for my e-commerce site: user registration, product catalog, shopping cart, and checkout flow.\n' +
            "Assistant: I'll help implement these features. First, let's add all the features to the todo list.\n" +
            '*Creates a todo list breaking down each feature into specific tasks based on the project architecture*\n' +
            "Assistant: Let's start with user registration. This will involve creating database models, API endpoints, and frontend forms that integrate with your existing authentication system.\n" +
            '\n' +
            '<reasoning>\n' +
            'The assistant used the todo list because:\n' +
            '1. The user provided multiple complex features to implement in a comma separated list\n' +
            '2. The todo list helps organize these large features into manageable tasks\n' +
            '3. This approach allows for tracking progress across the entire implementation\n' +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '<example>\n' +
            "User: Can you help optimize my React application? It's rendering slowly and has performance issues.</user>\n" +
            "Assistant: I'll help optimize your React application. First, let me examine your codebase to identify potential performance bottlenecks.\n" +
            '*Reviews component structure, render patterns, state management, and data fetching*\n' +
            "Assistant: After analyzing your codebase, I've identified several performance issues. Let me create a todo list to track our optimization efforts.\n" +
            '*Creates todo list with items like: 1) Implement memoization for expensive calculations in ProductList, 2) Add virtualization for long lists in Dashboard, 3) Optimize image loading in Gallery component, 4) Fix state update loops in ShoppingCart, 5) Review bundle size and implement code splitting*\n' +
            "Let's start by implementing memoization for the expensive calculations in your ProductList component.</assistant>\n" +
            '\n' +
            '<reasoning>\n' +
            'The assistant used the todo list because:\n' +
            '1. First, the assistant examined the codebase to identify specific performance issues\n' +
            '2. Based on this analysis, it identified multiple optimization opportunities\n' +
            '3. Performance optimization is a non-trivial task requiring multiple steps\n' +
            '4. The todo list helps methodically track improvements across different components\n' +
            '5. This systematic approach ensures all performance bottlenecks are addressed\n' +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '## Examples of When NOT to Use the Todo List\n' +
            '\n' +
            '<example>\n' +
            "User: How do I print 'Hello World' in Python?\n" +
            'Assistant: In Python, you can print "Hello World" with this simple code:\n' +
            '\n' +
            'python\n' +
            'print("Hello World")\n' +
            '\n' +
            'This will output the text "Hello World" to the console when executed.</assistant>\n' +
            '\n' +
            '<reasoning>\n' +
            "The assistant did not use the todo list because this is a single, trivial task that can be completed in one step. There's no need to track multiple tasks or steps for such a straightforward request.\n" +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '<example>\n' +
            'User: What does the git status command do?\n' +
            "Assistant: The git status command shows the current state of your working directory and staging area. It displays which changes have been staged, which haven't, and which files aren't being tracked by Git. This is a fundamental command for understanding the current state of your repository before making commits.\n" +
            '\n' +
            '<reasoning>\n' +
            'The assistant did not use the todo list because this is an informational request with no actual coding task to complete. The user is simply asking for an explanation, not for the assistant to perform multiple steps or tasks.\n' +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '<example>\n' +
            'User: Can you add a comment to the calculateTotal function to explain what it does?\n' +
            'Assistant: Sure, let me add a comment to the calculateTotal function to explain what it does.\n' +
            '* Uses the Edit tool to add a comment to the calculateTotal function *\n' +
            '\n' +
            '<reasoning>\n' +
            "The assistant did not use the todo list because this is a single, straightforward task confined to one location in the code. Adding a comment doesn't require tracking multiple steps or systematic organization.\n" +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '<example>\n' +
            'User: Run npm install for me and tell me what happens.\n' +
            "Assistant: I'll run the npm install command for you.\n" +
            '\n' +
            '*Executes: npm install*\n' +
            '\n' +
            "The command completed successfully. Here's the output:\n" +
            '[Output of npm install command]\n' +
            '\n' +
            'All dependencies have been installed according to your package.json file.\n' +
            '\n' +
            '<reasoning>\n' +
            'The assistant did not use the todo list because this is a single command execution with immediate results. There are no multiple steps to track or organize, making the todo list unnecessary for this straightforward task.\n' +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '## Task States and Management\n' +
            '\n' +
            '1. **Task States**: Use these states to track progress:\n' +
            '   - pending: Task not yet started\n' +
            '   - in-progress: Currently working on (limit to ONE task at a time)\n' +
            '   - completed: Task finished successfully\n' +
            '   - cancelled: Task no longer needed\n' +
            '\n' +
            '2. **Task Management**:\n' +
            '   - Update task status in real-time as you work\n' +
            "   - Mark tasks complete IMMEDIATELY after finishing (don't batch completions)\n" +
            '   - Only have ONE task in-progress at any time\n' +
            '   - Complete current tasks before starting new ones\n' +
            '   - Cancel tasks that become irrelevant\n' +
            '\n' +
            '3. **Task Breakdown**:\n' +
            '   - Create specific, actionable items\n' +
            '   - Break complex tasks into smaller, manageable steps\n' +
            '   - Use clear, descriptive task names\n' +
            '\n' +
            'When in doubt, use this tool. Being proactive with task management demonstrates attentiveness and ensures you complete all requirements successfully.',
          parameters: {
            type: 'object',
            properties: {
              todos: {
                type: 'array',
                items: {
                  type: 'object',
                  properties: {
                    id: {
                      type: 'string',
                      description: 'The unique identifier of the task, e.g "collect-information".'
                    },
                    content: {
                      type: 'string',
                      description: 'The content of the task.'
                    },
                    status: {
                      type: 'string',
                      enum: [
                        'pending',
                        'in-progress',
                        'completed',
                        'cancelled'
                      ],
                      description: 'The status of the task.'
                    },
                    priority: {
                      type: 'string',
                      enum: [
                        'low',
                        'medium',
                        'high'
                      ],
                      description: 'The priority of the task.'
                    }
                  },
                  required: [
                    'id',
                    'content',
                    'status',
                    'priority'
                  ],
                  additionalProperties: false
                }
              }
            },
            required: [
              'todos'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'writeToFile',
          description: 'Request to write full content to a file at the specified path.\n' +
            'If the file exists, it will be overwritten with the provided content.\n' +
            "If the file doesn't exist, it will be created. This tool will automatically create any directories needed to write the file.\n" +
            '\n' +
            'You may see the following fields in the result:\n' +
            '- autoFormattingEdits: If the auto-formatter makes any changes, this field will contain a diff against the file content after your edits and any user edits have been applied.\n' +
            '- newProblems: If any new problems are found after the edit, this field will contain information about them.',
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path of the file to write to (relative to the current working directory, or an absolute path).'
              },
              content: {
                type: 'string',
                description: 'The content to write to the file.'
              }
            },
            required: [
              'path',
              'content'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'editNotebook',
          description: 'Edit a specific cell in a Jupyter notebook (.ipynb file) by its cell ID',
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path to the notebook file (relative to the current working directory, or an absolute path)'
              },
              cellId: {
                type: 'string',
                description: 'The ID of the cell to edit'
              },
              content: {
                type: 'string',
                description: 'The new content of the cell'
              }
            },
            required: [
              'path',
              'cellId',
              'content'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'newTask',
          description: 'Launch a new agent to handle complex, multi-step tasks autonomously.\n' +
            'When using the newTask tool, you may specify a agentType parameter to select which agent type to use.\n' +
            'Available agent types and the tools they have access to:\n' +
            '\n' +
            '### planner\n' +
            'Engage this agent to formulate comprehensive, technical implementation strategies for feature development, system refactoring, or defect resolution.\n' +
            'This agent is strictly limited to planning and architectural design; it DOES NOT execute code modifications.\n' +
            '\n' +
            'Examples of user requests this agent shall trigger:\n' +
            '- "create a plan to implement the user authentication feature"\n' +
            '- "how should we refactor the database schema"\n' +
            '- "design a solution for the memory leak issue"\n' +
            '\n' +
            '### browser\n' +
            'Web browser automation agent for navigating websites, interacting with pages, and extracting information. Uses agent-browser CLI for headless browser control.\n' +
            '\n' +
            '### reviewer\n' +
            'Engage this agent to perform code reviews and leave inline comments.\n' +
            'This agent can analyze code and create review comments on specific lines.\n' +
            '\n' +
            'Examples of user requests this agent shall trigger:\n' +
            '- "review the code in src/auth"\n' +
            '- "add review comments to this file"\n' +
            '- "check this code and leave feedback"\n' +
            '\n' +
            '### walkthrough\n' +
            'Engage this agent to create a summary of the changes made in the current task.\n' +
            'This agent is strictly limited to documentation and explanation; it DOES NOT execute code modifications.\n' +
            '\n' +
            'Examples of user requests this agent shall trigger:\n' +
            '- "summarize what we have done"\n' +
            '- "create a walkthrough for the changes"\n' +
            '- "explain the changes made in this task"\n' +
            '\n' +
            '### explore\n' +
            'Use this agent to explore the codebase when you need to: understand project structure, find where features are implemented, locate specific functions or classes, analyze code patterns, investigate how something works, search for examples or usage, or gather information before making changes.\n' +
            '\n' +
            'Examples of questions this agent shall trigger:\n' +
            '- "where is the authentication logic implemented"\n' +
            '- "find all usages of the config parser"\n' +
            '- "how does the ignore-walk module work"\n' +
            '\n' +
            '\n' +
            'Always include a reminder in your prompt to ensure the result will be submitted through the `attemptCompletion` tool.\n' +
            'If the task stops without submitting the result, it will return an error message.\n' +
            '\n' +
            'You can optionally run agents in the background using the runAsync parameter. You can continue working while background agents run.\n' +
            '\n' +
            'When NOT to use the newTask tool:\n' +
            '- If you want to read a specific file path, use the readFile or globFiles tool instead of the newTask tool, to find the match more quickly\n' +
            '- If you are searching for a specific class definition like "class Foo", use the globFiles tool instead, to find the match more quickly\n' +
            '- If you are searching for code within a specific file or set of 2-3 files, use the readFile tool instead of the newTask tool, to find the match more quickly\n' +
            '- Other tasks that are not related to the agent descriptions above\n' +
            '\n' +
            'Usage notes:\n' +
            '1. Launch multiple agents tools concurrently whenever possible to maximize performance; to do that, use a single message with multiple tool uses\n' +
            '2. When the agent is done, it will return a single message back to you. The result returned by the agent is not visible to the user. To show the user the result, you should send a text message back to the user with a concise summary of the result.\n' +
            '3. Each agent invocation is stateless. You will not be able to send additional messages to the agent, nor will the agent be able to communicate with you outside of its final report. Therefore, your prompt should contain a highly detailed task description for the agent to perform autonomously and you should specify exactly what information the agent should return back to you in its final and only message to you.\n' +
            "4. The agent's outputs should generally be trusted\n" +
            "5. Clearly tell the agent whether you expect it to write code or just to do research (search, file reads, web fetches, etc.), since it is not aware of the user's intent\n" +
            '6. If the agent description mentions that it should be used proactively, then you should try your best to use it without the user having to ask for it first. Use your judgement.',
          parameters: {
            type: 'object',
            properties: {
              description: {
                type: 'string',
                description: 'A short description of the task.'
              },
              prompt: {
                type: 'string',
                description: 'The detailed prompt for the task to be performed.'
              },
              agentType: {
                type: 'string',
                description: 'The type of the specialized agent to use for the task.'
              },
              runAsync: {
                type: 'boolean',
                description: 'Set to true to run this agent in the background.'
              }
            },
            required: [
              'description',
              'prompt'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'startBackgroundJob',
          description: 'Start a background job to execute a bash command, which allows you to continue working while the job runs.\n' +
            '\n' +
            'Before starting the background job, please follow these steps:\n' +
            '\n' +
            '1. Directory Verification:\n' +
            '   - If the command will create new directories or files, first use the listFiles tool to verify the parent directory exists and is the correct location\n' +
            '   - For example, before running "mkdir foo/bar", first use listFiles to check that "foo" exists and is the intended parent directory\n' +
            '\n' +
            '2. Job Execution:\n' +
            '   - After ensuring proper quoting, start the background job.\n' +
            '\n' +
            'Usage notes:\n' +
            '- The command argument is required.\n' +
            '- Use readBackgroundJobOutput to monitor the output and status of the job.\n' +
            '- Use killBackgroundJob to terminate the job if needed.\n' +
            '- If the output exceeds 30000 characters, output will be truncated before being returned to you.\n' +
            '\n' +
            'Common use cases and examples:\n' +
            '- Development servers: `npm run dev`, `yarn start`, `bun run dev`\n' +
            '- Build processes: `npm run build`, `make`, `cargo build`\n' +
            '- File watchers: `npm run watch`, `tsc --watch`\n' +
            '- Testing: `npm run test:watch`, `jest --watch`\n' +
            '- Database services: `docker run -p 5432:5432 postgres`\n' +
            '\n' +
            'Command execution rules:\n' +
            "- Never run 'sleep' as it will return immediately.\n" +
            "- You do not need to use '&' at the end of the command.\n" +
            "- When issuing multiple commands, use the ';' or '&&' operator to separate them. DO NOT use newlines (newlines are ok in quoted strings).\n" +
            "- You shall avoid use the markdown code block syntax (backtick, '`') in your command, as it will be interpreted as a command substitution.",
          parameters: {
            type: 'object',
            properties: {
              command: {
                type: 'string',
                description: 'The CLI command to execute. This should be valid for the current operating system.'
              },
              cwd: {
                type: 'string',
                description: 'The working directory to execute the command in.'
              }
            },
            required: [
              'command'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'readBackgroundJobOutput',
          description: '- Retrieves output from a running or completed background job or async task\n' +
            '- Takes a backgroundJobId parameter identifying the job or task\n' +
            '- For terminal jobs, returns only new output since the last check\n' +
            '- For task IDs, returns the latest attemptCompletion result once completed\n' +
            '- Returns stdout and stderr output along with job status\n' +
            '- Supports optional regex filtering to show only lines matching a pattern\n' +
            '- Use this tool when you need to monitor or check the output of a long-running background job',
          parameters: {
            type: 'object',
            properties: {
              backgroundJobId: {
                type: 'string',
                description: 'The ID of the background job to get output from'
              },
              regex: {
                type: 'string',
                description: 'Optional regular expression to filter the output lines. Only lines matching this regex will be included in the result. Any lines that do not match will no longer be available to read.'
              }
            },
            required: [
              'backgroundJobId'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'killBackgroundJob',
          description: '- Kills a running background job by its ID\n' +
            '- Takes a backgroundJobId parameter identifying the job to kill\n' +
            '- Returns a success or failure status\n' +
            '- Use this tool when you need to terminate a long-running background job',
          parameters: {
            type: 'object',
            properties: {
              backgroundJobId: {
                type: 'string',
                description: 'The ID of the background job to kill.'
              }
            },
            required: [
              'backgroundJobId'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'webFetch',
          description: '- Fetches content from a specified URL and converts HTML to markdown\n' +
            '- Use this tool when you need to retrieve and analyze web content\n' +
            '\n' +
            'Usage notes:\n' +
            '  - IMPORTANT: If an MCP-provided web fetch tool is available, prefer using that tool instead of this one, as it may have fewer restrictions.\n' +
            '  - The URL must be a fully-formed valid URL\n' +
            '  - The prompt should describe what information you want to extract from the page\n' +
            '  - This tool is read-only and does not modify any files\n' +
            '  - Includes a self-cleaning 10-minute cache for faster responses when repeatedly accessing the same URL',
          parameters: {
            '$schema': 'https://json-schema.org/draft/2020-12/schema',
            type: 'object',
            properties: {
              url: {
                type: 'string',
                format: 'uri'
              }
            },
            required: [
              'url'
            ],
            additionalProperties: false
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'webSearch',
          description: '- Allows Pochi to search the web and use the results to inform responses\n' +
            '- Provides up-to-date information for current events and recent data\n' +
            '- Returns search result information formatted as search result blocks, including links as markdown hyperlinks\n' +
            '- Searches are performed automatically within a single API call\n' +
            '\n' +
            'CRITICAL REQUIREMENT - You MUST follow this:\n' +
            `  - After answering the user's question, you MUST include a "Sources:" section at the end of your response\n` +
            '  - In the Sources section, list all relevant URLs from the search results as markdown hyperlinks: [Title](URL)\n' +
            '  - This is MANDATORY - never skip including sources in your response\n' +
            '  - Example format:\n' +
            '\n' +
            '    [Your answer here]\n' +
            '\n' +
            '    Sources:\n' +
            '    - [Source Title 1](https://example.com/1)\n' +
            '    - [Source Title 2](https://example.com/2)\n' +
            '\n' +
            'Usage notes:\n' +
            `  - Account for "Today's date" in <system-reminder>. For example, if <system-reminder> says "Today's date: 2025-07-01", and the user wants the latest docs, do not use 2024 in the search query. Use 2025.`,
          parameters: {
            '$schema': 'https://json-schema.org/draft/2020-12/schema',
            type: 'object',
            properties: {
              query: {
                description: 'The search query to perform',
                type: 'string'
              },
              country: {
                description: "Country code to filter search results by, e.g. 'US', 'GB', 'JP'",
                type: 'string'
              }
            },
            required: [
              'query'
            ],
            additionalProperties: false
          }
        }
      }
    ],
    tool_choice: 'auto',
    stream: true
  }
}
2026-03-19 09:17:59.408	DEBUG	/$bunfs/pochi:454339	listFiles	Listing workspace files from /root with maxItems 500
2026-03-19 09:17:59.666	ERROR	/$bunfs/pochi:432009	LiveChatKit	onError

 AI_APICallError  This request would exceed your organization's rate limit of 2,000,000 input tokens per minute (org: e70c8d22-9099-49c5-a9af-e059e6515b76, model: claude-opus-4-6). For details, refer to: https://docs.claude.com/en/api/rate-limits. You can see the response headers for current usage. Please reduce the prompt length or the maximum tokens requested, or try again later. You may also contact sales at https://claude.com/contact-sales to discuss your options for a rate limit increase., AI_APICallError, , https://api.anthropic.com/v1/chat/completions, [object Object], 429, [object Object], {"error":{"code":"rate_limit_error","message":"This request would exceed your organization's rate limit of 2,000,000 input tokens per minute (org: e70c8d22-9099-49c5-a9af-e059e6515b76, model: claude-opus-4-6). For details, refer to: https://docs.claude.com/en/api/rate-limits. You can see the response headers for current usage. Please reduce the prompt length or the maximum tokens requested, or try again later. You may also contact sales at https://claude.com/contact-sales to discuss your options for a rate limit increase.","type":"invalid_request_error","param":null}}, true, [object Object], 423231, 30, 423231, 30, /$bunfs/root/pochi
error stack:
  • pochi	<anonymous>
	/$bunfs/pochi:423231
  • pochi	async <anonymous>
	/$bunfs/pochi:423092
  • native	processTicksAndRejections
	native:7
2026-03-19 09:18:05.683	ERROR	/$bunfs/pochi:502749	TaskRunner	Task is failed, trying to resend last message to resume it. {
  kind: 'APICallError',
  isRetryable: true,
  message: "This request would exceed your organization's rate limit of 2,000,000 input tokens per minute (org: e70c8d22-9099-49c5-a9af-e059e6515b76, model: claude-opus-4-6). For details, refer to: https://docs.claude.com/en/api/rate-limits. You can see the response headers for current usage. Please reduce the prompt length or the maximum tokens requested, or try again later. You may also contact sales at https://claude.com/contact-sales to discuss your options for a rate limit increase.",
  requestBodyValues: {
    model: 'claude-opus-4-6',
    max_tokens: 4096,
    messages: [
      {
        role: 'system',
        content: 'You are Pochi, a highly skilled software engineer with extensive knowledge in many programming languages, frameworks, design patterns, and best practices.\n' +
          '\n' +
          'IMPORTANT: You must NEVER generate or guess URLs for the user unless you are confident that the URLs are for helping the user with programming. You may use URLs provided by the user in their messages or local files.\n' +
          '\n' +
          'If the user asks for help or wants to give feedback inform them of the following:\n' +
          '- Join the discord channel at https://getpochi.com/discord to ask questions and get help\n' +
          '- To report bugs, users should report the issue at https://github.com/TabbyML/pochi/issues\n' +
          '\n' +
          "When the user directly asks about Pochi (eg 'can Pochi do...', 'does Pochi have...') or asks in second person (eg 'are you able...', 'can you do...'), first use curl to gather information to answer the question from Pochi docs at https://docs.getpochi.com/llms.txt\n" +
          '\n' +
          '====\n' +
          '\n' +
          'TASK MANAGEMENT\n' +
          '\n' +
          'You have access to the todoWrite tool to help you manage and plan tasks. Use these tools VERY frequently to ensure that you are tracking your tasks and giving the user visibility into your progress.\n' +
          'These tools are also EXTREMELY helpful for planning tasks, and for breaking down larger complex tasks into smaller steps. If you do not use this tool when planning, you may forget to do important tasks - and that is unacceptable.\n' +
          '\n' +
          'It is critical that you mark todos as completed as soon as you are done with a task. Do not batch up multiple tasks before marking them as completed.\n' +
          '\n' +
          '====\n' +
          '\n' +
          'RULES\n' +
          '\n' +
          "- User messages may include <system-reminder> tags. <system-reminder> tags contain useful information and reminders. They are NOT part of the user's provided input or the tool result. You shall pay close attention to information in these tags and use it to inform you actions.\n" +
          "- When the user initially gives you a task, a recursive list of all filepaths in the current working directory will be included in <system-reminder> tag. This provides an overview of the project's file structure, offering key insights into the project from directory/file names (how developers conceptualize and organize their code) and file extensions (the language used). This can also guide decision-making on which files to explore further. If you need to further explore directories such as outside the current working directory, you can use the listFiles tool. If you pass 'true' for the recursive parameter, it will list files recursively.\n" +
          '- All file paths used by tools must be relative to current working directory, do not use the ~ character or $HOME to refer to the home directory in file paths used by tools.\n' +
          "- You can use `pochi://` URI schema to access the Pochi virtual file system. This allows you to read and write files that are stored in Pochi's internal storage.\n" +
          "- Be sure to consider the type of project (e.g. Python, JavaScript, web application) when determining the appropriate structure and files to include. Also consider what files may be most relevant to accomplishing the task, for example looking at a project's manifest file would help you understand the project's dependencies, which you could incorporate into any code you write.\n" +
          "- Do not ask for more information than necessary. Use the tools provided to accomplish the user's request efficiently and effectively. When you've completed your task, you must use the attemptCompletion tool to present the result to the user. The user may provide feedback, which you can use to make improvements and try again.\n" +
          '- You are only allowed to ask the user questions using the askFollowupQuestion tool. Use this tool only when you need additional details to complete a task, and be sure to use a clear and concise question that will help you move forward with the task. However if you can use the available tools to avoid having to ask the user questions, you should do so. For example, if the user mentions a file that may be in an outside directory like the Desktop, you should use the listFiles tool to list the files in the Desktop and check if the file they are talking about is there, rather than asking the user to provide the file path themselves.\n' +
          `- You are STRICTLY FORBIDDEN from starting your messages with "Great", "Certainly", "Okay", "Sure". You should NOT be conversational in your responses, but rather direct and to the point. For example you should NOT say "Great, I've updated the CSS" but instead something like "I've updated the CSS". It is important you be clear and technical in your messages.\n` +
          "- Once you've completed the user's task, you MUST use the attemptCompletion tool to present the result of the task to the user. It is STRICTLY FORBIDDEN to complete the task without using this tool.\n" +
          '- When planning large-scale changes, create a high-level diagram using mermaid in Markdown. This helps explain your plan and allows you to gather user feedback before implementation.'
      },
      {
        role: 'user',
        content: [
          {
            type: 'text',
            text: '<system-reminder># System Information\n' +
              '\n' +
              'Operating System: linux\n' +
              'Default Shell: \n' +
              'Home Directory: /root\n' +
              'Current Working Directory: /root\n' +
              'Current Time: Thu Mar 19 2026 09:17:12 GMT+0000 (Coordinated Universal Time)\n' +
              '\n' +
              '# User Information\n' +
              '- Name: Test User\n' +
              '- Email: test@example.com\n' +
              '\n' +
              '# Current Working Directory (/root) Files\n' +
              '.bashrc\n' +
              '.profile\n' +
              '.daytona\n' +
              '.pochi\n' +
              '.gitconfig\n' +
              '.daytona/sessions\n' +
              '.pochi/config.jsonc\n' +
              '.daytona/sessions/a3777110-8132-47af-b51b-5923306e85aa\n' +
              '.daytona/sessions/693f5c50-112b-4d7e-b770-9650df4dec45\n' +
              '.daytona/sessions/380662f8-8805-47f4-91d4-31c76feba356\n' +
              '.daytona/sessions/9fa6e4a8-0a92-4a65-ac29-ae9e066c28a4\n' +
              '.daytona/sessions/a3777110-8132-47af-b51b-5923306e85aa/b4ba62f8-aee3-4106-9aef-66f6c5df79f2\n' +
              '.daytona/sessions/693f5c50-112b-4d7e-b770-9650df4dec45/ebb5ee05-6f54-4f88-9e78-089e3dc49fda\n' +
              '.daytona/sessions/380662f8-8805-47f4-91d4-31c76feba356/d6e3820d-c720-4dd4-b5a4-372b6a6f4077\n' +
              '.daytona/sessions/9fa6e4a8-0a92-4a65-ac29-ae9e066c28a4/4f04fe80-a746-46a5-b898-0d363239583c\n' +
              '.daytona/sessions/a3777110-8132-47af-b51b-5923306e85aa/b4ba62f8-aee3-4106-9aef-66f6c5df79f2/exit_code\n' +
              '.daytona/sessions/693f5c50-112b-4d7e-b770-9650df4dec45/ebb5ee05-6f54-4f88-9e78-089e3dc49fda/exit_code\n' +
              '.daytona/sessions/380662f8-8805-47f4-91d4-31c76feba356/d6e3820d-c720-4dd4-b5a4-372b6a6f4077/exit_code\n' +
              '\n' +
              '# GIT STATUS\n' +
              'Current branch: \n' +
              'Main branch (you will usually use this for PRs): \n' +
              '\n' +
              'Recent commits:\n' +
              '\n' +
              '\n' +
              '# TODOs\n' +
              'No TODOs yet, if you are working on tasks that would benefit from a todo list please use the todoWrite tool to create one.</system-reminder>'
          },
          {
            type: 'text',
            text: 'You are a developer migrating from Git to Jujutsu (jj). You have an existing local Git repository at `/home/user/my-project`. Your task is to start using jj with this repository without breaking Git compatibility.\\n\\n1. Navigate to `/home/user/my-project`.\\n2. Initialize a colocated jj repository so that jj and Git can be used together.\\n3. Create a new bookmark named `feature-x`.\\n4. Create a new file named `feature.txt` containing the text `Hello jj`.\\n5. Create a new jj commit (or describe the working copy) with the description `Add feature.txt`.\\n\\nWhen finished, the repository should be a valid colocated jj/Git repo, the `feature-x` bookmark should exist and be exported to Git, and the commit should have the specified description and file.'
          }
        ]
      },
      {
        role: 'assistant',
        content: '\n' +
          '\n' +
          "I'll work through this step-by-step, migrating the Git repository to use Jujutsu (jj) in colocated mode.",
        tool_calls: [
          {
            id: 'toolu_011rCkj2REAg3R87c4PHJkcQ',
            type: 'function',
            function: {
              name: 'todoWrite',
              arguments: `{"todos":[{"id":"check-repo","content":"Check if /home/user/my-project exists and has a Git repo","status":"in-progress","priority":"high"},{"id":"init-jj","content":"Initialize colocated jj repository","status":"pending","priority":"high"},{"id":"create-bookmark","content":"Create feature-x bookmark","status":"pending","priority":"high"},{"id":"create-file","content":"Create feature.txt with 'Hello jj'","status":"pending","priority":"high"},{"id":"describe-commit","content":"Describe/create commit with 'Add feature.txt'","status":"pending","priority":"high"},{"id":"verify","content":"Verify colocated repo, bookmark, and commit","status":"pending","priority":"high"}]}`
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_011rCkj2REAg3R87c4PHJkcQ',
        content: '{"success":true}'
      },
      {
        role: 'assistant',
        content: '',
        tool_calls: [
          {
            id: 'toolu_0174ARF4pbW41KSU4HQtRVw4',
            type: 'function',
            function: {
              name: 'executeCommand',
              arguments: '{"command":"ls -la /home/user/my-project 2>/dev/null; echo \\"---\\"; ls -la /home/user/my-project/.git 2>/dev/null"}'
            }
          },
          {
            id: 'toolu_01FmkuNLXYsjxvTsBfVmHFba',
            type: 'function',
            function: {
              name: 'executeCommand',
              arguments: '{"command":"which jj && jj --version"}'
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_0174ARF4pbW41KSU4HQtRVw4',
        content: '{"output":"total 8\\r\\ndrwxr-xr-x 3 root root   47 Mar 11 12:10 .\\r\\ndrwxr-xr-x 1 root root   32 Mar 11 12:10 ..\\r\\ndrwxr-xr-x 8 root root 4096 Mar 11 12:10 .git\\r\\n-rw-r--r-- 1 root root   15 Mar 11 12:10 README.md\\r\\n---\\r\\ntotal 28\\r\\ndrwxr-xr-x 8 root root 4096 Mar 11 12:10 .\\r\\ndrwxr-xr-x 3 root root   47 Mar 11 12:10 ..\\r\\n-rw-r--r-- 1 root root   15 Mar 11 12:10 COMMIT_EDITMSG\\r\\n-rw-r--r-- 1 root root   21 Mar 11 12:10 HEAD\\r\\ndrwxr-xr-x 2 root root    6 Mar 11 12:10 branches\\r\\n-rw-r--r-- 1 root root   92 Mar 11 12:10 config\\r\\n-rw-r--r-- 1 root root   73 Mar 11 12:10 description\\r\\ndrwxr-xr-x 2 root root 4096 Mar 11 12:10 hooks\\r\\n-rw-r--r-- 1 root root  137 Mar 11 12:10 index\\r\\ndrwxr-xr-x 2 root root   29 Mar 11 12:10 info\\r\\ndrwxr-xr-x 3 root root   30 Mar 11 12:10 logs\\r\\ndrwxr-xr-x 7 root root   84 Mar 11 12:10 objects\\r\\ndrwxr-xr-x 4 root root   43 Mar 11 12:10 refs\\r\\n","isTruncated":false}'
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_01FmkuNLXYsjxvTsBfVmHFba',
        content: '{"output":"/usr/local/bin/jj\\r\\njj 0.38.0-2508982cde5c7e4db0933e0b6469f9e778e71e28\\r\\n","isTruncated":false}'
      },
      {
        role: 'assistant',
        content: 'The Git repository exists at `/home/user/my-project` with a `README.md` file, and `jj` v0.38.0 is installed.',
        tool_calls: [
          {
            id: 'toolu_01ULas2uw3TnyRPAHN6aUhhT',
            type: 'function',
            function: {
              name: 'todoWrite',
              arguments: `{"todos":[{"id":"check-repo","content":"Check if /home/user/my-project exists and has a Git repo","status":"completed","priority":"high"},{"id":"init-jj","content":"Initialize colocated jj repository","status":"in-progress","priority":"high"},{"id":"create-bookmark","content":"Create feature-x bookmark","status":"pending","priority":"high"},{"id":"create-file","content":"Create feature.txt with 'Hello jj'","status":"pending","priority":"high"},{"id":"describe-commit","content":"Describe/create commit with 'Add feature.txt'","status":"pending","priority":"high"},{"id":"verify","content":"Verify colocated repo, bookmark, and commit","status":"pending","priority":"high"}]}`
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_01ULas2uw3TnyRPAHN6aUhhT',
        content: '{"success":true}'
      },
      {
        role: 'assistant',
        content: '**Step 1 & 2: Initialize a colocated jj repository.** The `--colocate` flag (or running `jj git init --colocate` inside an existing Git repo) sets up jj to share the `.git` directory, so both tools work together.',
        tool_calls: [
          {
            id: 'toolu_019jY8xFeB1m7PfbXfapjtni',
            type: 'function',
            function: {
              name: 'executeCommand',
              arguments: '{"command":"cd /home/user/my-project && jj git init --colocate"}'
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_019jY8xFeB1m7PfbXfapjtni',
        content: '{"output":"Done importing changes from the underlying Git repo.\\r\\nInitialized repo in \\".\\"\\r\\nHint: Running `git clean -xdf` will remove `.jj/`!\\r\\n","isTruncated":false}'
      },
      {
        role: 'assistant',
        content: 'Colocated jj repository initialized. Let me verify the `.jj` directory was created alongside `.git`:',
        tool_calls: [
          {
            id: 'toolu_017U73gxk7EtcnybfQfMwDDW',
            type: 'function',
            function: {
              name: 'executeCommand',
              arguments: '{"command":"ls -la /home/user/my-project/ | head -20"}'
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_017U73gxk7EtcnybfQfMwDDW',
        content: '{"output":"total 4\\r\\ndrwxr-xr-x 1 root root 41 Mar 19 09:17 .\\r\\ndrwxr-xr-x 1 root root 32 Mar 11 12:10 ..\\r\\ndrwxr-xr-x 1 root root 45 Mar 11 12:10 .git\\r\\ndrwxr-xr-x 4 root root 72 Mar 19 09:17 .jj\\r\\n-rw-r--r-- 1 root root 15 Mar 11 12:10 README.md\\r\\n","isTruncated":false}'
      },
      {
        role: 'assistant',
        content: 'Both `.git` and `.jj` directories exist — the repo is colocated.',
        tool_calls: [
          {
            id: 'toolu_01RbFKbcqvYrAPXMhdewxZNQ',
            type: 'function',
            function: {
              name: 'todoWrite',
              arguments: `{"todos":[{"id":"check-repo","content":"Check if /home/user/my-project exists and has a Git repo","status":"completed","priority":"high"},{"id":"init-jj","content":"Initialize colocated jj repository","status":"completed","priority":"high"},{"id":"create-bookmark","content":"Create feature-x bookmark","status":"in-progress","priority":"high"},{"id":"create-file","content":"Create feature.txt with 'Hello jj'","status":"pending","priority":"high"},{"id":"describe-commit","content":"Describe/create commit with 'Add feature.txt'","status":"pending","priority":"high"},{"id":"verify","content":"Verify colocated repo, bookmark, and commit","status":"pending","priority":"high"}]}`
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_01RbFKbcqvYrAPXMhdewxZNQ',
        content: '{"success":true}'
      },
      {
        role: 'assistant',
        content: '**Step 3: Create the `feature-x` bookmark.** Let me first check the current jj log to understand the state:',
        tool_calls: [
          {
            id: 'toolu_0194HmfhNtUVQ4zP16p2MXym',
            type: 'function',
            function: {
              name: 'executeCommand',
              arguments: '{"command":"cd /home/user/my-project && jj log"}'
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_0194HmfhNtUVQ4zP16p2MXym',
        content: '{"output":"@  uyntpwtv (no email set) 2026-03-19 09:17:41 5d317252\\r\\n│  (empty) (no description set)\\r\\nā—‹  ypsoummp test@example.com 2026-03-11 12:10:51 main 14d944a2\\r\\n│  Initial commit\\r\\nā—†  zzzzzzzz root() 00000000\\r\\n","isTruncated":false}'
      },
      {
        role: 'assistant',
        content: "The working copy change (`@`) is on top of the `main` branch. Now I'll create the `feature-x` bookmark pointing to the current working copy change:",
        tool_calls: [
          {
            id: 'toolu_01Bqso2WjCh52bGNmUGaHTFv',
            type: 'function',
            function: {
              name: 'executeCommand',
              arguments: '{"command":"cd /home/user/my-project && jj bookmark create feature-x -r @"}'
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_01Bqso2WjCh52bGNmUGaHTFv',
        content: `{"output":"Warning: Target revision is empty.\\r\\nCreated 1 bookmarks pointing to uyntpwtv 5d317252 feature-x | (empty) (no description set)\\r\\nWarning: Name and email not configured. Until configured, your commits will be created with the empty identity, and can't be pushed to remotes.\\r\\nHint: To configure, run:\\r\\n  jj config set --user user.name \\"Some One\\"\\r\\n  jj config set --user user.email \\"someone@example.com\\"\\r\\n","isTruncated":false}`
      }
    ],
    tools: [
      {
        type: 'function',
        function: {
          name: 'applyDiff',
          description: "This is a tool for editing files. For moving or renaming files, you should generally use the executeCommand tool with the 'mv' command instead. For larger edits, use the writeFile tool to overwrite files.\n" +
            '\n' +
            "Before using this tool, use the readFile tool to understand the file's contents and context\n" +
            '\n' +
            'To make a file edit, provide the following:\n' +
            '1. path: The path to the file to modify (relative to the current working directory, or an absolute path)\n' +
            '2. searchContent: The text to replace (must match the file contents exactly, including all whitespace and indentation)\n' +
            '3. replaceContent: The edited text to replace the searchContent (must be different from searchContent)\n' +
            '4. expectedReplacements: The number of replacements you expect to make. Defaults to 1 if not specified.\n' +
            '\n' +
            'By default, the tool will replace ONE occurrence of searchContent with replaceContent in the specified file. If you want to replace multiple occurrences, provide the expectedReplacements parameter with the exact number of occurrences you expect.\n' +
            '\n' +
            'CRITICAL REQUIREMENTS FOR USING THIS TOOL:\n' +
            '\n' +
            '1. UNIQUENESS (when expectedReplacements is not specified): The searchContent MUST uniquely identify the specific instance you want to change. This means:\n' +
            '   - Include AT LEAST 3-5 lines of context BEFORE the change point\n' +
            '   - Include AT LEAST 3-5 lines of context AFTER the change point\n' +
            '   - Include all whitespace, indentation, and surrounding code exactly as it appears in the file\n' +
            '\n' +
            '2. EXPECTED MATCHES: If you want to replace multiple instances:\n' +
            '   - Use the expectedReplacements parameter with the exact number of occurrences you expect to replace\n' +
            '   - This will replace ALL occurrences of the searchContent with the replaceContent\n' +
            "   - If the actual number of matches doesn't equal expectedReplacements, the edit will fail\n" +
            '   - This is a safety feature to prevent unintended replacements\n' +
            '\n' +
            '3. VERIFICATION: Before using this tool:\n' +
            '   - Check how many instances of the target text exist in the file\n' +
            '   - If multiple instances exist, either:\n' +
            '     a) Gather enough context to uniquely identify each one and make separate calls, OR\n' +
            '     b) Use expectedReplacements parameter with the exact count of instances you expect to replace\n' +
            '\n' +
            'WARNING:\n' +
            "- The tool will fail if searchContent matches multiple locations and expectedReplacements isn't specified\n" +
            "- The tool will fail if the number of matches doesn't equal expectedReplacements when it's specified\n" +
            "- The tool will fail if searchContent doesn't match the file contents exactly (including whitespace)\n" +
            '- The tool will fail if searchContent and replaceContent are the same\n' +
            '\n' +
            'When making edits:\n' +
            '   - Ensure the edit results in idiomatic, correct code\n' +
            '   - Do not add trailing whitespace to lines (a newline at the end of a file is fine)\n' +
            '   - Do not leave the code in a broken state\n' +
            '\n' +
            'If you want to create a new file, use:\n' +
            '   - A new file path, including dir name if needed\n' +
            '   - An empty searchContent\n' +
            "   - The new file's contents as replaceContent\n" +
            '\n' +
            'Remember: when making multiple file edits in a row to the same file, you should prefer to send all edits in a single message with multiple calls to this tool, rather than multiple messages with a single call each.\n' +
            '\n' +
            'You may see the following fields in the result:\n' +
            '- autoFormattingEdits: If the auto-formatter makes any changes, this field will contain a diff against the file content after your edits and any user edits have been applied.\n' +
            '- newProblems: If any new problems are found after the edit, this field will contain information about them.',
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path of the file to modify (relative to the current working directory, or an absolute path).'
              },
              searchContent: {
                type: 'string',
                description: 'The text to replace.'
              },
              replaceContent: {
                type: 'string',
                description: 'The text to replace it with.'
              },
              expectedReplacements: {
                type: 'number',
                description: 'The expected number of replacements to perform. Defaults to 1 if not specified.'
              }
            },
            required: [
              'path',
              'searchContent',
              'replaceContent'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'askFollowupQuestion',
          description: 'Ask the user a question to gather additional information needed to complete the task. \n' +
            '\n' +
            '## When to Use This Tool\n' +
            'Use this tool in the following scenarios:\n' +
            "1. The user's request is ambiguous or unclear and requires clarification.\n" +
            '2. You need more details to proceed effectively.\n' +
            '3. You have made several unsuccessful attempts to solve the issue and need user guidance to move forward.\n' +
            '4. Offer choices to the user about what direction to take.\n' +
            '\n' +
            '## Usage Notes\n' +
            '- Users will always be able to select "Other" to provide custom text input\n' +
            '- Use multiSelect: true to allow multiple answers to be selected for a question\n' +
            '- If you recommend a specific option, make that the first option in the list and add "(Recommended)" at the end of the label\n' +
            '- Provide 1-4 questions per call\n' +
            '\n' +
            'IMPORTANT: This tool CANNOT be used in combination with other tools (except todoWrite) in a single step. If you need to use other tools, you must do so in a separate step before calling this tool.',
          parameters: {
            type: 'object',
            properties: {
              questions: {
                type: 'array',
                items: {
                  type: 'object',
                  properties: {
                    question: {
                      type: 'string',
                      description: 'The complete question to ask the user. Should be clear, specific, and end with a question mark.'
                    },
                    header: {
                      type: 'string',
                      maxLength: 12,
                      description: 'Very short label displayed as a chip/tag (max 12 chars). Examples: "Auth method", "Library", "Approach".'
                    },
                    options: {
                      type: 'array',
                      items: {
                        type: 'object',
                        properties: {
                          label: {
                            type: 'string',
                            description: 'Short button label shown to the user. Should be concise (1-5 words) and clearly describe the choice.'
                          },
                          description: {
                            type: 'string',
                            description: 'Explanation of what this option means or what will happen if chosen. Useful for providing context about trade-offs or implications.'
                          }
                        },
                        required: [
                          'label'
                        ],
                        additionalProperties: false
                      },
                      minItems: 2,
                      maxItems: 4,
                      description: "The available choices for this question. Must have 2-4 options. Each option should be a distinct, mutually exclusive choice (unless multiSelect is enabled). There should be no 'Other' option, that will be provided automatically."
                    },
                    multiSelect: {
                      type: 'boolean',
                      default: false,
                      description: 'Set to true to allow the user to select multiple options instead of just one. Use when choices are not mutually exclusive.'
                    }
                  },
                  required: [
                    'question',
                    'header',
                    'options'
                  ],
                  additionalProperties: false
                },
                minItems: 1,
                maxItems: 4,
                description: 'Questions to ask the user (1-4 questions).'
              }
            },
            required: [
              'questions'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'attemptCompletion',
          description: "Once you've received the results of tool uses and can confirm that the task is complete, use this tool to present the result of your work to the user.\n" +
            '\n' +
            'You MUST NOT generate any text before this tool call. All conclusion text must be included within the result parameter of the attemptCompletion tool.\n' +
            'Never use this tool with a question or request to engage in further conversation! Formulate the end of your result in a way that is final and does not require further input from the user.\n' +
            '\n' +
            'IMPORTANT: This tool CANNOT be used in combination with other tools (except todoWrite) in a single step. If you need to use other tools, you must do so in a separate step before calling this tool.',
          parameters: {
            '$schema': 'http://json-schema.org/draft-07/schema#',
            type: 'object',
            properties: {
              result: {
                description: 'The result of the task. Formulate this result in a way that is final and does not require further input from the user.',
                type: 'string'
              }
            },
            required: [
              'result'
            ],
            additionalProperties: false
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'executeCommand',
          description: 'Executes a given bash command in a persistent shell session with optional timeout, ensuring proper handling and security measures.\n' +
            '\n' +
            'IMPORTANT: This tool is for terminal operations like git, npm, docker, etc. DO NOT use it for file operations (reading, writing, editing, searching, finding files) - use the specialized tools for this instead.\n' +
            '\n' +
            'Before executing the command, please follow these steps:\n' +
            '\n' +
            '1. Directory Verification:\n' +
            '   - If the command will create new directories or files, first use listFiles to verify the parent directory exists and is the correct location\n' +
            '   - For example, before running "mkdir foo/bar", first use listFiles to check that "foo" exists and is the intended parent directory\n' +
            '\n' +
            '2. Command Execution:\n' +
            '   - Always quote file paths that contain spaces with double quotes (e.g., cd "path with spaces/file.txt")\n' +
            '   - Examples of proper quoting:\n' +
            '     - cd "/Users/name/My Documents" (correct)\n' +
            '     - cd /Users/name/My Documents (incorrect - will fail)\n' +
            '     - python "/path/with spaces/script.py" (correct)\n' +
            '     - python /path/with spaces/script.py (incorrect - will fail)\n' +
            '   - After ensuring proper quoting, execute the command.\n' +
            '   - Capture the output of the command.\n' +
            '\n' +
            'Usage notes:\n' +
            '- The command argument is required.\n' +
            '- You can specify an optional timeout in seconds (up to 300s / 5 minutes). If not specified, commands will timeout after 60s (1 minute).\n' +
            '- If the output exceeds 30000 characters, output will be truncated before being returned to you.\n' +
            '- When issuing multiple commands:\n' +
            '  - If the commands are independent and can run in parallel, make multiple executeCommand tool calls in a single message. For example, if you need to run "git status" and "git diff", send a single message with two executeCommand tool calls in parallel.\n' +
            '  - If the commands depend on each other and must run sequentially, use a single executeCommand call with \'&&\' to chain them together (e.g., `git add . && git commit -m "message" && git push`). For instance, if one operation must complete before another starts (like mkdir before cp, Write before executeCommand for git operations, or git add before git commit), run these operations sequentially instead.\n' +
            "  - Use ';' only when you need to run commands sequentially but don't care if earlier commands fail\n" +
            '  - DO NOT use newlines to separate commands (newlines are ok in quoted strings)\n' +
            "- You shall avoid use the markdown code block syntax (backtick, '`') in your command, as it will be interpreted as a command substitution.\n" +
            "- Before using this tool, you must first think about the context provided in <system-reminder> to understand the user's environment and tailor your commands to ensure they are compatible with their system. You must also consider if the command you need to run should be executed in a specific directory rather than the current working directory, and properly set the `cwd` if necessary.\n" +
            '\n' +
            '# Committing changes with git\n' +
            '\n' +
            'Only create commits when requested by the user. If unclear, ask first. When the user asks you to create a new git commit, follow these steps carefully:\n' +
            '\n' +
            'Git Safety Protocol:\n' +
            '- NEVER update the git config\n' +
            "- NEVER run destructive git commands (push --force, reset --hard, checkout ., restore ., clean -f, branch -D) unless the user explicitly requests these actions. Taking unauthorized destructive actions is unhelpful and can result in lost work, so it's best to ONLY run these commands when given direct instructions \n" +
            '- NEVER skip hooks (--no-verify, --no-gpg-sign, etc) unless the user explicitly requests it\n' +
            '- NEVER run force push to main/master, warn the user if they request it\n' +
            '- CRITICAL: Always create NEW commits rather than amending, unless the user explicitly requests a git amend. When a pre-commit hook fails, the commit did NOT happen  — so --amend would modify the PREVIOUS commit, which may result in destroying work or losing previous changes. Instead, after hook failure, fix the issue, re-stage, and create a NEW commit\n' +
            '- When staging files, prefer adding specific files by name rather than using "git add -A" or "git add .", which can accidentally include sensitive files (.env, credentials) or large binaries\n' +
            '- NEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked, otherwise the user will feel that you are being too proactive\n' +
            '\n' +
            '1. You can call multiple tools in a single response. When multiple independent pieces of information are requested and all commands are likely to succeed, run multiple tool calls in parallel for optimal performance. run the following bash commands in parallel, each using the executeCommand tool:\n' +
            '  - Run a git status command to see all untracked files. IMPORTANT: Never use the -uall flag as it can cause memory issues on large repos.\n' +
            '  - Run a git diff command to see both staged and unstaged changes that will be committed.\n' +
            "  - Run a git log command to see recent commit messages, so that you can follow this repository's commit message style.\n" +
            '2. Analyze all staged changes (both previously staged and newly added) and draft a commit message:\n' +
            '  - Summarize the nature of the changes (eg. new feature, enhancement to an existing feature, bug fix, refactoring, test, docs, etc.). Ensure the message accurately reflects the changes and their purpose (i.e. "add" means a wholly new feature, "update" means an enhancement to an existing feature, "fix" means a bug fix, etc.).\n' +
            '  - Do not commit files that likely contain secrets (.env, credentials.json, etc). Warn the user if they specifically request to commit those files\n' +
            '  - Draft a concise (1-2 sentences) commit message that focuses on the "why" rather than the "what"\n' +
            '  - Ensure it accurately reflects the changes and their purpose\n' +
            '3. You can call multiple tools in a single response. When multiple independent pieces of information are requested and all commands are likely to succeed, run multiple tool calls in parallel for optimal performance. run the following commands:\n' +
            '   - Add relevant untracked files to the staging area.\n' +
            '   - Create the commit with a message ending with:\n' +
            '   šŸ¤– Generated with [Pochi](https://getpochi.com) | [Task](<Share URL>)\n' +
            '\n' +
            '   Co-Authored-By: Pochi <noreply@getpochi.com>\n' +
            '\n' +
            '   Note: Replace <Share URL> with the Share URL from system information if available. If not available, omit the " | [Task](...)" part.\n' +
            '\n' +
            '   - Run git status after the commit completes to verify success.\n' +
            '   Note: git status depends on the commit completing, so run it sequentially after the commit.\n' +
            '4. If the commit fails due to pre-commit hook changes, retry the commit ONCE to include these automated changes. If it fails again, it usually means a pre-commit hook is preventing the commit. If the commit succeeds but you notice that files were modified by the pre-commit hook, you MUST amend your commit to include them.\n' +
            '\n' +
            'Important notes:\n' +
            '- NEVER update the git config\n' +
            '- NEVER run additional commands to read or explore code, besides git bash commands\n' +
            '- DO NOT push to the remote repository unless the user explicitly asks you to do so\n' +
            '- IMPORTANT: Never use git commands with the -i flag (like git rebase -i or git add -i) since they require interactive input which is not supported.\n' +
            '- IMPORTANT: Do not use --no-edit with git rebase commands, as the --no-edit flag is not a valid option for git rebase.\n' +
            '- If there are no changes to commit (i.e., no untracked files and no modifications), do not create an empty commit\n' +
            '- In order to ensure good formatting, ALWAYS pass the commit message via a HEREDOC, a la this example:\n' +
            '<example>\n' +
            `git commit -m "$(cat <<'EOF'\n` +
            'Commit message here.\n' +
            '\n' +
            'šŸ¤– Generated with [Pochi](https://getpochi.com) | [Task](<Share URL>)\n' +
            '\n' +
            'Co-Authored-By: Pochi <noreply@getpochi.com>\n' +
            'EOF\n' +
            ')"\n' +
            '</example>\n' +
            '\n' +
            '# Creating pull requests\n' +
            'Use the gh command via the executeCommand tool for ALL GitHub-related tasks including working with issues, pull requests, checks, and releases. If given a Github URL use the gh command to get the information needed.\n' +
            '\n' +
            'IMPORTANT: When the user asks you to create a pull request, follow these steps carefully:\n' +
            '\n' +
            '1. You can call multiple tools in a single response. When multiple independent pieces of information are requested and all commands are likely to succeed, run multiple tool calls in parallel for optimal performance. run the following bash commands in parallel using the executeCommand tool, in order to understand the current state of the branch since it diverged from the main branch:\n' +
            '   - Run a git status command to see all untracked files (never use -uall flag)\n' +
            '   - Run a git diff command to see both staged and unstaged changes that will be committed\n' +
            '   - Check if the current branch tracks a remote branch and is up to date with the remote, so you know if you need to push to the remote\n' +
            '   - Run a git log command and `git diff [base-branch]...HEAD` to understand the full commit history for the current branch (from the time it diverged from the base branch)\n' +
            '2. Analyze all changes that will be included in the pull request, making sure to look at all relevant commits (NOT just the latest commit, but ALL commits that will be included in the pull request!!!), and draft a pull request title and summary:\n' +
            '   - Keep the PR title short (under 70 characters)\n' +
            '   - Use the description/body for details, not the title\n' +
            '3. You can call multiple tools in a single response. When multiple independent pieces of information are requested and all commands are likely to succeed, run multiple tool calls in parallel for optimal performance. run the following commands in parallel:\n' +
            '   - Create new branch if needed\n' +
            '   - Push to remote with -u flag if needed\n' +
            '   - Create PR using gh pr create with the format below. Use a HEREDOC to pass the body to ensure correct formatting.\n' +
            '<example>\n' +
            `gh pr create --title "the pr title" --body "$(cat <<'EOF'\n` +
            '## Summary\n' +
            '<1-3 bullet points>\n' +
            '\n' +
            '## Test plan\n' +
            '[Checklist of TODOs for testing the pull request...]\n' +
            '\n' +
            'šŸ¤– Generated with [Pochi](https://getpochi.com) | [Task](<Share URL>)\n' +
            'EOF\n' +
            ')"\n' +
            '</example>\n' +
            '\n' +
            'Important:\n' +
            '- NEVER update the git confi'... 355 more characters,
          parameters: {
            type: 'object',
            properties: {
              command: {
                type: 'string',
                description: 'The CLI command to execute. This should be valid for the current operating system.'
              },
              cwd: {
                type: 'string',
                description: 'The working directory to execute the command in.'
              },
              timeout: {
                type: 'number',
                minimum: 1,
                maximum: 300,
                description: 'Optional timeout in seconds, max 300 seconds. By default the timeout is 120 seconds.'
              }
            },
            required: [
              'command'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'globFiles',
          description: 'Request to find files matching a glob pattern within a specified directory. Use this to get a list of files based on a pattern.',
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path of the directory to search in (relative to the current working directory, or an absolute path)'
              },
              globPattern: {
                type: 'string',
                description: "The glob pattern to match files against (e.g., '*.ts', '**/*.js')"
              }
            },
            required: [
              'path',
              'globPattern'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'listFiles',
          description: 'Request to list files and directories within the specified directory. If recursive is true, it will list all files and directories recursively. If recursive is false or not provided, it will only list the top-level contents. Do not use this tool to confirm the existence of files you may have created, as the user will let you know if the files were created successfully or not.',
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path of the directory to list contents for (relative to the current working directory, or an absolute path)'
              },
              recursive: {
                type: 'boolean',
                description: 'Whether to list files and directories recursively.'
              }
            },
            required: [
              'path'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'readFile',
          description: 'Request to read the contents of a file at the specified path. Use this when you need to examine the contents of an existing file you do not know the contents of, for example to analyze code, review text files, extract information from configuration files.\n' +
            '',
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path of the file to read (relative to the current working directory, or an absolute path)'
              },
              startLine: {
                type: 'number',
                description: 'The starting line number to read from (1-based). If not provided, it starts from the beginning of the file.'
              },
              endLine: {
                type: 'number',
                description: 'The ending line number to read to (1-based, inclusive). If not provided, it reads to the end of the file.'
              }
            },
            required: [
              'path'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'useSkill',
          description: 'Execute a skill within the main conversation\n' +
            '\n' +
            'When users ask you to perform tasks, check if any of the available skills below can help complete the task more effectively. Skills provide specialized capabilities and domain knowledge.\n' +
            '\n' +
            'When users ask about a SPECIFIC skill (e.g., "How does the pdf skill work?", "What does the commit skill do?"), you must call this tool to get detailed information about that skill.\n' +
            '\n' +
            'When users ask general questions like "What skills are available?" or "List all skills", simply refer to the "Available skills" section below - do NOT call this tool.\n' +
            '\n' +
            "This tool returns the skill's detailed instructions which you must then follow to complete the task. The instructions contain step-by-step guidance on how to perform the specific task or workflow.\n" +
            '\n' +
            'How to invoke:\n' +
            '- Use this tool with the skill name\n' +
            '- Example: `skill: "pdf-processing"` - invoke the pdf-processing skill\n' +
            "- The tool will return the skill's instructions\n" +
            '- Follow the returned instructions carefully to complete the task\n' +
            '\n' +
            'Important:\n' +
            '- When a skill is relevant for a task OR when users ask about a SPECIFIC skill, you must invoke this tool IMMEDIATELY as your first action\n' +
            '- For general questions about available skills, simply refer to the "Available skills" list below without calling this tool\n' +
            '- NEVER just announce or mention a skill in your text response without actually calling this tool (except for general skill listing requests)\n' +
            '- This is a BLOCKING REQUIREMENT: invoke the relevant Skill tool BEFORE generating any other response about a specific skill or task\n' +
            '- Only use skills listed in "Available skills" below\n' +
            '- Check compatibility requirements before using a skill - ensure the skill is compatible with the current OS/environment\n' +
            '- After calling this tool, follow the returned instructions step by step\n' +
            '- The skill file location is shown in the [Location: filepath] section of each skill listing below - use this information to understand where the skill is defined\n' +
            "- Use the directory containing the skill's source file as the base directory for resolving any resource files mentioned in the instructions\n" +
            '- Proactively explore the skill directory for optional resources that enhance task completion:\n' +
            '  * scripts/ - executable code that agents can run (Python, Bash, JavaScript, etc.)\n' +
            '  * references/ - on-demand documentation (REFERENCE.md, FORMS.md, domain-specific files)\n' +
            '  * assets/ - static resources (templates, images, data files, schemas)\n' +
            '  Use these resources when they exist and are relevant to the current task\n' +
            '\n' +
            'Available skills:\n' +
            '\n' +
            '- **find-skills**: Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill. [Location: _builtIn_]\n' +
            '- **create-skill**: Helps users create new custom agent skills. Use when the user wants to create a new skill, automate a workflow, or package specialized knowledge for reuse. [Location: _builtIn_]',
          parameters: {
            type: 'object',
            properties: {
              skill: {
                type: 'string',
                description: 'The name of the skill to use.'
              }
            },
            required: [
              'skill'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'searchFiles',
          description: '- Fast content search tool that works with any codebase size\n' +
            '- Searches file contents using regular expressions\n' +
            '- Supports Rust regex syntax (eg. "log.*Error", "functions+w+", etc.)\n' +
            '- Filter files by pattern with the include parameter (eg. "*.js", "*.{ts,tsx}")\n' +
            '- Returns file paths with at least one match sorted by modification time\n' +
            '- Use this tool when you need to find files containing specific patterns\n' +
            '- Craft your regex patterns carefully to balance specificity and flexibility.\n' +
            "- Based on the user's task you may use it to find code patterns, TODO comments, function definitions, or any text-based information across the project. The results include context, so analyze the surrounding code to better understand the matches. Leverage the this tool in combination with other tools for more comprehensive analysis. For example, use it to find specific code patterns, then use readFile to examine the full context of interesting matches before using applyDiff or writeToFile to make informed changes.",
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path of the directory to search in (relative to the current working directory, or an absolute path).'
              },
              regex: {
                type: 'string',
                description: 'The regular expression pattern to search for in file contents. Uses Rust regex syntax.'
              },
              filePattern: {
                type: 'string',
                description: 'File pattern to include in the search (e.g. "*.js", "*.{ts,tsx}"). If not provided, it will search all files.'
              }
            },
            required: [
              'path',
              'regex'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'todoWrite',
          description: 'Use this tool to create and manage a structured task list for your current coding session. This helps you track progress, organize complex tasks, and demonstrate thoroughness to the user.\n' +
            'It also helps the user understand the progress of the task and overall progress of their requests.\n' +
            '\n' +
            '## When to Use This Tool\n' +
            'Use this tool proactively in these scenarios:\n' +
            '\n' +
            '1. Complex multi-step tasks - When a task requires 3 or more distinct steps or actions\n' +
            '2. Non-trivial and complex tasks - Tasks that require careful planning or multiple operations\n' +
            '3. User explicitly requests todo list - When the user directly asks you to use the todo list\n' +
            '4. User provides multiple tasks - When users provide a list of things to be done (numbered or comma-separated)\n' +
            '5. After receiving new instructions - Immediately capture user requirements as todos. Feel free to edit the todo list based on new information.\n' +
            '6. After completing a task - Mark it complete and add any new follow-up tasks\n' +
            '7. When you start working on a new task, mark the todo as in-progress. Ideally you should only have one todo as in-progress at a time. Complete existing tasks before starting new ones.\n' +
            '\n' +
            '## When NOT to Use This Tool\n' +
            '\n' +
            'Skip using this tool when:\n' +
            '1. There is only a single, straightforward task\n' +
            '2. The task is trivial and tracking it provides no organizational benefit\n' +
            '3. The task can be completed in less than 3 trivial steps\n' +
            '4. The task is purely conversational or informational\n' +
            '\n' +
            'NOTE that you should use should not use this tool if there is only one trivial task to do. In this case you are better off just doing the task directly.\n' +
            '\n' +
            '## Examples of When to Use the Todo List\n' +
            '\n' +
            '<example>\n' +
            "User: I want to add a dark mode toggle to the application settings. Make sure you run the tests and build when you're done!\n" +
            "Assistant: I'll help add a dark mode toggle to your application settings. Let me create a todo list to track this implementation.\n" +
            '*Creates todo list with the following items:*\n' +
            '1. Create dark mode toggle component in Settings page\n' +
            '2. Add dark mode state management (context/store)\n' +
            '3. Implement CSS-in-JS styles for dark theme\n' +
            '4. Update existing components to support theme switching\n' +
            '5. Run tests and build process, addressing any failures or errors that occur\n' +
            '*Begins working on the first task*\n' +
            '\n' +
            '<reasoning>\n' +
            'The assistant used the todo list because:\n' +
            '1. Adding dark mode is a multi-step feature requiring UI, state management, and styling changes\n' +
            '2. The user explicitly requested tests and build be run afterward\n' +
            '3. The assistant inferred that tests and build need to pass by adding "Ensure tests and build succeed" as the final task\n' +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '<example>\n' +
            'User: Help me rename the function getCwd to getCurrentWorkingDirectory across my project\n' +
            "Assistant: Let me first search through your codebase to find all occurrences of 'getCwd'.\n" +
            '*Uses grep or search tools to locate all instances of getCwd in the codebase*\n' +
            "Assistant: I've found 15 instances of 'getCwd' across 8 different files. Let me create a todo list to track these changes.\n" +
            '*Creates todo list with specific items for each file that needs updating*\n' +
            '\n' +
            '<reasoning>\n' +
            'The assistant used the todo list because:\n' +
            '1. First, the assistant searched to understand the scope of the task\n' +
            '2. Upon finding multiple occurrences across different files, it determined this was a complex task with multiple steps\n' +
            '3. The todo list helps ensure every instance is tracked and updated systematically\n' +
            '4. This approach prevents missing any occurrences and maintains code consistency\n' +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '\n' +
            '<example>\n' +
            'User: I need to implement these features for my e-commerce site: user registration, product catalog, shopping cart, and checkout flow.\n' +
            "Assistant: I'll help implement these features. First, let's add all the features to the todo list.\n" +
            '*Creates a todo list breaking down each feature into specific tasks based on the project architecture*\n' +
            "Assistant: Let's start with user registration. This will involve creating database models, API endpoints, and frontend forms that integrate with your existing authentication system.\n" +
            '\n' +
            '<reasoning>\n' +
            'The assistant used the todo list because:\n' +
            '1. The user provided multiple complex features to implement in a comma separated list\n' +
            '2. The todo list helps organize these large features into manageable tasks\n' +
            '3. This approach allows for tracking progress across the entire implementation\n' +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '<example>\n' +
            "User: Can you help optimize my React application? It's rendering slowly and has performance issues.</user>\n" +
            "Assistant: I'll help optimize your React application. First, let me examine your codebase to identify potential performance bottlenecks.\n" +
            '*Reviews component structure, render patterns, state management, and data fetching*\n' +
            "Assistant: After analyzing your codebase, I've identified several performance issues. Let me create a todo list to track our optimization efforts.\n" +
            '*Creates todo list with items like: 1) Implement memoization for expensive calculations in ProductList, 2) Add virtualization for long lists in Dashboard, 3) Optimize image loading in Gallery component, 4) Fix state update loops in ShoppingCart, 5) Review bundle size and implement code splitting*\n' +
            "Let's start by implementing memoization for the expensive calculations in your ProductList component.</assistant>\n" +
            '\n' +
            '<reasoning>\n' +
            'The assistant used the todo list because:\n' +
            '1. First, the assistant examined the codebase to identify specific performance issues\n' +
            '2. Based on this analysis, it identified multiple optimization opportunities\n' +
            '3. Performance optimization is a non-trivial task requiring multiple steps\n' +
            '4. The todo list helps methodically track improvements across different components\n' +
            '5. This systematic approach ensures all performance bottlenecks are addressed\n' +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '## Examples of When NOT to Use the Todo List\n' +
            '\n' +
            '<example>\n' +
            "User: How do I print 'Hello World' in Python?\n" +
            'Assistant: In Python, you can print "Hello World" with this simple code:\n' +
            '\n' +
            'python\n' +
            'print("Hello World")\n' +
            '\n' +
            'This will output the text "Hello World" to the console when executed.</assistant>\n' +
            '\n' +
            '<reasoning>\n' +
            "The assistant did not use the todo list because this is a single, trivial task that can be completed in one step. There's no need to track multiple tasks or steps for such a straightforward request.\n" +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '<example>\n' +
            'User: What does the git status command do?\n' +
            "Assistant: The git status command shows the current state of your working directory and staging area. It displays which changes have been staged, which haven't, and which files aren't being tracked by Git. This is a fundamental command for understanding the current state of your repository before making commits.\n" +
            '\n' +
            '<reasoning>\n' +
            'The assistant did not use the todo list because this is an informational request with no actual coding task to complete. The user is simply asking for an explanation, not for the assistant to perform multiple steps or tasks.\n' +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '<example>\n' +
            'User: Can you add a comment to the calculateTotal function to explain what it does?\n' +
            'Assistant: Sure, let me add a comment to the calculateTotal function to explain what it does.\n' +
            '* Uses the Edit tool to add a comment to the calculateTotal function *\n' +
            '\n' +
            '<reasoning>\n' +
            "The assistant did not use the todo list because this is a single, straightforward task confined to one location in the code. Adding a comment doesn't require tracking multiple steps or systematic organization.\n" +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '<example>\n' +
            'User: Run npm install for me and tell me what happens.\n' +
            "Assistant: I'll run the npm install command for you.\n" +
            '\n' +
            '*Executes: npm install*\n' +
            '\n' +
            "The command completed successfully. Here's the output:\n" +
            '[Output of npm install command]\n' +
            '\n' +
            'All dependencies have been installed according to your package.json file.\n' +
            '\n' +
            '<reasoning>\n' +
            'The assistant did not use the todo list because this is a single command execution with immediate results. There are no multiple steps to track or organize, making the todo list unnecessary for this straightforward task.\n' +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '## Task States and Management\n' +
            '\n' +
            '1. **Task States**: Use these states to track progress:\n' +
            '   - pending: Task not yet started\n' +
            '   - in-progress: Currently working on (limit to ONE task at a time)\n' +
            '   - completed: Task finished successfully\n' +
            '   - cancelled: Task no longer needed\n' +
            '\n' +
            '2. **Task Management**:\n' +
            '   - Update task status in real-time as you work\n' +
            "   - Mark tasks complete IMMEDIATELY after finishing (don't batch completions)\n" +
            '   - Only have ONE task in-progress at any time\n' +
            '   - Complete current tasks before starting new ones\n' +
            '   - Cancel tasks that become irrelevant\n' +
            '\n' +
            '3. **Task Breakdown**:\n' +
            '   - Create specific, actionable items\n' +
            '   - Break complex tasks into smaller, manageable steps\n' +
            '   - Use clear, descriptive task names\n' +
            '\n' +
            'When in doubt, use this tool. Being proactive with task management demonstrates attentiveness and ensures you complete all requirements successfully.',
          parameters: {
            type: 'object',
            properties: {
              todos: {
                type: 'array',
                items: {
                  type: 'object',
                  properties: {
                    id: {
                      type: 'string',
                      description: 'The unique identifier of the task, e.g "collect-information".'
                    },
                    content: {
                      type: 'string',
                      description: 'The content of the task.'
                    },
                    status: {
                      type: 'string',
                      enum: [
                        'pending',
                        'in-progress',
                        'completed',
                        'cancelled'
                      ],
                      description: 'The status of the task.'
                    },
                    priority: {
                      type: 'string',
                      enum: [
                        'low',
                        'medium',
                        'high'
                      ],
                      description: 'The priority of the task.'
                    }
                  },
                  required: [
                    'id',
                    'content',
                    'status',
                    'priority'
                  ],
                  additionalProperties: false
                }
              }
            },
            required: [
              'todos'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'writeToFile',
          description: 'Request to write full content to a file at the specified path.\n' +
            'If the file exists, it will be overwritten with the provided content.\n' +
            "If the file doesn't exist, it will be created. This tool will automatically create any directories needed to write the file.\n" +
            '\n' +
            'You may see the following fields in the result:\n' +
            '- autoFormattingEdits: If the auto-formatter makes any changes, this field will contain a diff against the file content after your edits and any user edits have been applied.\n' +
            '- newProblems: If any new problems are found after the edit, this field will contain information about them.',
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path of the file to write to (relative to the current working directory, or an absolute path).'
              },
              content: {
                type: 'string',
                description: 'The content to write to the file.'
              }
            },
            required: [
              'path',
              'content'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'editNotebook',
          description: 'Edit a specific cell in a Jupyter notebook (.ipynb file) by its cell ID',
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path to the notebook file (relative to the current working directory, or an absolute path)'
              },
              cellId: {
                type: 'string',
                description: 'The ID of the cell to edit'
              },
              content: {
                type: 'string',
                description: 'The new content of the cell'
              }
            },
            required: [
              'path',
              'cellId',
              'content'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'newTask',
          description: 'Launch a new agent to handle complex, multi-step tasks autonomously.\n' +
            'When using the newTask tool, you may specify a agentType parameter to select which agent type to use.\n' +
            'Available agent types and the tools they have access to:\n' +
            '\n' +
            '### planner\n' +
            'Engage this agent to formulate comprehensive, technical implementation strategies for feature development, system refactoring, or defect resolution.\n' +
            'This agent is strictly limited to planning and architectural design; it DOES NOT execute code modifications.\n' +
            '\n' +
            'Examples of user requests this agent shall trigger:\n' +
            '- "create a plan to implement the user authentication feature"\n' +
            '- "how should we refactor the database schema"\n' +
            '- "design a solution for the memory leak issue"\n' +
            '\n' +
            '### browser\n' +
            'Web browser automation agent for navigating websites, interacting with pages, and extracting information. Uses agent-browser CLI for headless browser control.\n' +
            '\n' +
            '### reviewer\n' +
            'Engage this agent to perform code reviews and leave inline comments.\n' +
            'This agent can analyze code and create review comments on specific lines.\n' +
            '\n' +
            'Examples of user requests this agent shall trigger:\n' +
            '- "review the code in src/auth"\n' +
            '- "add review comments to this file"\n' +
            '- "check this code and leave feedback"\n' +
            '\n' +
            '### walkthrough\n' +
            'Engage this agent to create a summary of the changes made in the current task.\n' +
            'This agent is strictly limited to documentation and explanation; it DOES NOT execute code modifications.\n' +
            '\n' +
            'Examples of user requests this agent shall trigger:\n' +
            '- "summarize what we have done"\n' +
            '- "create a walkthrough for the changes"\n' +
            '- "explain the changes made in this task"\n' +
            '\n' +
            '### explore\n' +
            'Use this agent to explore the codebase when you need to: understand project structure, find where features are implemented, locate specific functions or classes, analyze code patterns, investigate how something works, search for examples or usage, or gather information before making changes.\n' +
            '\n' +
            'Examples of questions this agent shall trigger:\n' +
            '- "where is the authentication logic implemented"\n' +
            '- "find all usages of the config parser"\n' +
            '- "how does the ignore-walk module work"\n' +
            '\n' +
            '\n' +
            'Always include a reminder in your prompt to ensure the result will be submitted through the `attemptCompletion` tool.\n' +
            'If the task stops without submitting the result, it will return an error message.\n' +
            '\n' +
            'You can optionally run agents in the background using the runAsync parameter. You can continue working while background agents run.\n' +
            '\n' +
            'When NOT to use the newTask tool:\n' +
            '- If you want to read a specific file path, use the readFile or globFiles tool instead of the newTask tool, to find the match more quickly\n' +
            '- If you are searching for a specific class definition like "class Foo", use the globFiles tool instead, to find the match more quickly\n' +
            '- If you are searching for code within a specific file or set of 2-3 files, use the readFile tool instead of the newTask tool, to find the match more quickly\n' +
            '- Other tasks that are not related to the agent descriptions above\n' +
            '\n' +
            'Usage notes:\n' +
            '1. Launch multiple agents tools concurrently whenever possible to maximize performance; to do that, use a single message with multiple tool uses\n' +
            '2. When the agent is done, it will return a single message back to you. The result returned by the agent is not visible to the user. To show the user the result, you should send a text message back to the user with a concise summary of the result.\n' +
            '3. Each agent invocation is stateless. You will not be able to send additional messages to the agent, nor will the agent be able to communicate with you outside of its final report. Therefore, your prompt should contain a highly detailed task description for the agent to perform autonomously and you should specify exactly what information the agent should return back to you in its final and only message to you.\n' +
            "4. The agent's outputs should generally be trusted\n" +
            "5. Clearly tell the agent whether you expect it to write code or just to do research (search, file reads, web fetches, etc.), since it is not aware of the user's intent\n" +
            '6. If the agent description mentions that it should be used proactively, then you should try your best to use it without the user having to ask for it first. Use your judgement.',
          parameters: {
            type: 'object',
            properties: {
              description: {
                type: 'string',
                description: 'A short description of the task.'
              },
              prompt: {
                type: 'string',
                description: 'The detailed prompt for the task to be performed.'
              },
              agentType: {
                type: 'string',
                description: 'The type of the specialized agent to use for the task.'
              },
              runAsync: {
                type: 'boolean',
                description: 'Set to true to run this agent in the background.'
              }
            },
            required: [
              'description',
              'prompt'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'startBackgroundJob',
          description: 'Start a background job to execute a bash command, which allows you to continue working while the job runs.\n' +
            '\n' +
            'Before starting the background job, please follow these steps:\n' +
            '\n' +
            '1. Directory Verification:\n' +
            '   - If the command will create new directories or files, first use the listFiles tool to verify the parent directory exists and is the correct location\n' +
            '   - For example, before running "mkdir foo/bar", first use listFiles to check that "foo" exists and is the intended parent directory\n' +
            '\n' +
            '2. Job Execution:\n' +
            '   - After ensuring proper quoting, start the background job.\n' +
            '\n' +
            'Usage notes:\n' +
            '- The command argument is required.\n' +
            '- Use readBackgroundJobOutput to monitor the output and status of the job.\n' +
            '- Use killBackgroundJob to terminate the job if needed.\n' +
            '- If the output exceeds 30000 characters, output will be truncated before being returned to you.\n' +
            '\n' +
            'Common use cases and examples:\n' +
            '- Development servers: `npm run dev`, `yarn start`, `bun run dev`\n' +
            '- Build processes: `npm run build`, `make`, `cargo build`\n' +
            '- File watchers: `npm run watch`, `tsc --watch`\n' +
            '- Testing: `npm run test:watch`, `jest --watch`\n' +
            '- Database services: `docker run -p 5432:5432 postgres`\n' +
            '\n' +
            'Command execution rules:\n' +
            "- Never run 'sleep' as it will return immediately.\n" +
            "- You do not need to use '&' at the end of the command.\n" +
            "- When issuing multiple commands, use the ';' or '&&' operator to separate them. DO NOT use newlines (newlines are ok in quoted strings).\n" +
            "- You shall avoid use the markdown code block syntax (backtick, '`') in your command, as it will be interpreted as a command substitution.",
          parameters: {
            type: 'object',
            properties: {
              command: {
                type: 'string',
                description: 'The CLI command to execute. This should be valid for the current operating system.'
              },
              cwd: {
                type: 'string',
                description: 'The working directory to execute the command in.'
              }
            },
            required: [
              'command'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'readBackgroundJobOutput',
          description: '- Retrieves output from a running or completed background job or async task\n' +
            '- Takes a backgroundJobId parameter identifying the job or task\n' +
            '- For terminal jobs, returns only new output since the last check\n' +
            '- For task IDs, returns the latest attemptCompletion result once completed\n' +
            '- Returns stdout and stderr output along with job status\n' +
            '- Supports optional regex filtering to show only lines matching a pattern\n' +
            '- Use this tool when you need to monitor or check the output of a long-running background job',
          parameters: {
            type: 'object',
            properties: {
              backgroundJobId: {
                type: 'string',
                description: 'The ID of the background job to get output from'
              },
              regex: {
                type: 'string',
                description: 'Optional regular expression to filter the output lines. Only lines matching this regex will be included in the result. Any lines that do not match will no longer be available to read.'
              }
            },
            required: [
              'backgroundJobId'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'killBackgroundJob',
          description: '- Kills a running background job by its ID\n' +
            '- Takes a backgroundJobId parameter identifying the job to kill\n' +
            '- Returns a success or failure status\n' +
            '- Use this tool when you need to terminate a long-running background job',
          parameters: {
            type: 'object',
            properties: {
              backgroundJobId: {
                type: 'string',
                description: 'The ID of the background job to kill.'
              }
            },
            required: [
              'backgroundJobId'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'webFetch',
          description: '- Fetches content from a specified URL and converts HTML to markdown\n' +
            '- Use this tool when you need to retrieve and analyze web content\n' +
            '\n' +
            'Usage notes:\n' +
            '  - IMPORTANT: If an MCP-provided web fetch tool is available, prefer using that tool instead of this one, as it may have fewer restrictions.\n' +
            '  - The URL must be a fully-formed valid URL\n' +
            '  - The prompt should describe what information you want to extract from the page\n' +
            '  - This tool is read-only and does not modify any files\n' +
            '  - Includes a self-cleaning 10-minute cache for faster responses when repeatedly accessing the same URL',
          parameters: {
            '$schema': 'https://json-schema.org/draft/2020-12/schema',
            type: 'object',
            properties: {
              url: {
                type: 'string',
                format: 'uri'
              }
            },
            required: [
              'url'
            ],
            additionalProperties: false
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'webSearch',
          description: '- Allows Pochi to search the web and use the results to inform responses\n' +
            '- Provides up-to-date information for current events and recent data\n' +
            '- Returns search result information formatted as search result blocks, including links as markdown hyperlinks\n' +
            '- Searches are performed automatically within a single API call\n' +
            '\n' +
            'CRITICAL REQUIREMENT - You MUST follow this:\n' +
            `  - After answering the user's question, you MUST include a "Sources:" section at the end of your response\n` +
            '  - In the Sources section, list all relevant URLs from the search results as markdown hyperlinks: [Title](URL)\n' +
            '  - This is MANDATORY - never skip including sources in your response\n' +
            '  - Example format:\n' +
            '\n' +
            '    [Your answer here]\n' +
            '\n' +
            '    Sources:\n' +
            '    - [Source Title 1](https://example.com/1)\n' +
            '    - [Source Title 2](https://example.com/2)\n' +
            '\n' +
            'Usage notes:\n' +
            `  - Account for "Today's date" in <system-reminder>. For example, if <system-reminder> says "Today's date: 2025-07-01", and the user wants the latest docs, do not use 2024 in the search query. Use 2025.`,
          parameters: {
            '$schema': 'https://json-schema.org/draft/2020-12/schema',
            type: 'object',
            properties: {
              query: {
                description: 'The search query to perform',
                type: 'string'
              },
              country: {
                description: "Country code to filter search results by, e.g. 'US', 'GB', 'JP'",
                type: 'string'
              }
            },
            required: [
              'query'
            ],
            additionalProperties: false
          }
        }
      }
    ],
    tool_choice: 'auto',
    stream: true
  }
}
2026-03-19 09:18:05.707	DEBUG	/$bunfs/pochi:454339	listFiles	Listing workspace files from /root with maxItems 500
2026-03-19 09:18:05.929	ERROR	/$bunfs/pochi:432009	LiveChatKit	onError

 AI_APICallError  This request would exceed your organization's rate limit of 2,000,000 input tokens per minute (org: e70c8d22-9099-49c5-a9af-e059e6515b76, model: claude-opus-4-6). For details, refer to: https://docs.claude.com/en/api/rate-limits. You can see the response headers for current usage. Please reduce the prompt length or the maximum tokens requested, or try again later. You may also contact sales at https://claude.com/contact-sales to discuss your options for a rate limit increase., AI_APICallError, , https://api.anthropic.com/v1/chat/completions, [object Object], 429, [object Object], {"error":{"code":"rate_limit_error","message":"This request would exceed your organization's rate limit of 2,000,000 input tokens per minute (org: e70c8d22-9099-49c5-a9af-e059e6515b76, model: claude-opus-4-6). For details, refer to: https://docs.claude.com/en/api/rate-limits. You can see the response headers for current usage. Please reduce the prompt length or the maximum tokens requested, or try again later. You may also contact sales at https://claude.com/contact-sales to discuss your options for a rate limit increase.","type":"invalid_request_error","param":null}}, true, [object Object], 423231, 30, 423231, 30, /$bunfs/root/pochi
error stack:
  • pochi	<anonymous>
	/$bunfs/pochi:423231
  • pochi	async <anonymous>
	/$bunfs/pochi:423092
  • native	processTicksAndRejections
	native:7
2026-03-19 09:18:17.959	ERROR	/$bunfs/pochi:502749	TaskRunner	Task is failed, trying to resend last message to resume it. {
  kind: 'APICallError',
  isRetryable: true,
  message: "This request would exceed your organization's rate limit of 2,000,000 input tokens per minute (org: e70c8d22-9099-49c5-a9af-e059e6515b76, model: claude-opus-4-6). For details, refer to: https://docs.claude.com/en/api/rate-limits. You can see the response headers for current usage. Please reduce the prompt length or the maximum tokens requested, or try again later. You may also contact sales at https://claude.com/contact-sales to discuss your options for a rate limit increase.",
  requestBodyValues: {
    model: 'claude-opus-4-6',
    max_tokens: 4096,
    messages: [
      {
        role: 'system',
        content: 'You are Pochi, a highly skilled software engineer with extensive knowledge in many programming languages, frameworks, design patterns, and best practices.\n' +
          '\n' +
          'IMPORTANT: You must NEVER generate or guess URLs for the user unless you are confident that the URLs are for helping the user with programming. You may use URLs provided by the user in their messages or local files.\n' +
          '\n' +
          'If the user asks for help or wants to give feedback inform them of the following:\n' +
          '- Join the discord channel at https://getpochi.com/discord to ask questions and get help\n' +
          '- To report bugs, users should report the issue at https://github.com/TabbyML/pochi/issues\n' +
          '\n' +
          "When the user directly asks about Pochi (eg 'can Pochi do...', 'does Pochi have...') or asks in second person (eg 'are you able...', 'can you do...'), first use curl to gather information to answer the question from Pochi docs at https://docs.getpochi.com/llms.txt\n" +
          '\n' +
          '====\n' +
          '\n' +
          'TASK MANAGEMENT\n' +
          '\n' +
          'You have access to the todoWrite tool to help you manage and plan tasks. Use these tools VERY frequently to ensure that you are tracking your tasks and giving the user visibility into your progress.\n' +
          'These tools are also EXTREMELY helpful for planning tasks, and for breaking down larger complex tasks into smaller steps. If you do not use this tool when planning, you may forget to do important tasks - and that is unacceptable.\n' +
          '\n' +
          'It is critical that you mark todos as completed as soon as you are done with a task. Do not batch up multiple tasks before marking them as completed.\n' +
          '\n' +
          '====\n' +
          '\n' +
          'RULES\n' +
          '\n' +
          "- User messages may include <system-reminder> tags. <system-reminder> tags contain useful information and reminders. They are NOT part of the user's provided input or the tool result. You shall pay close attention to information in these tags and use it to inform you actions.\n" +
          "- When the user initially gives you a task, a recursive list of all filepaths in the current working directory will be included in <system-reminder> tag. This provides an overview of the project's file structure, offering key insights into the project from directory/file names (how developers conceptualize and organize their code) and file extensions (the language used). This can also guide decision-making on which files to explore further. If you need to further explore directories such as outside the current working directory, you can use the listFiles tool. If you pass 'true' for the recursive parameter, it will list files recursively.\n" +
          '- All file paths used by tools must be relative to current working directory, do not use the ~ character or $HOME to refer to the home directory in file paths used by tools.\n' +
          "- You can use `pochi://` URI schema to access the Pochi virtual file system. This allows you to read and write files that are stored in Pochi's internal storage.\n" +
          "- Be sure to consider the type of project (e.g. Python, JavaScript, web application) when determining the appropriate structure and files to include. Also consider what files may be most relevant to accomplishing the task, for example looking at a project's manifest file would help you understand the project's dependencies, which you could incorporate into any code you write.\n" +
          "- Do not ask for more information than necessary. Use the tools provided to accomplish the user's request efficiently and effectively. When you've completed your task, you must use the attemptCompletion tool to present the result to the user. The user may provide feedback, which you can use to make improvements and try again.\n" +
          '- You are only allowed to ask the user questions using the askFollowupQuestion tool. Use this tool only when you need additional details to complete a task, and be sure to use a clear and concise question that will help you move forward with the task. However if you can use the available tools to avoid having to ask the user questions, you should do so. For example, if the user mentions a file that may be in an outside directory like the Desktop, you should use the listFiles tool to list the files in the Desktop and check if the file they are talking about is there, rather than asking the user to provide the file path themselves.\n' +
          `- You are STRICTLY FORBIDDEN from starting your messages with "Great", "Certainly", "Okay", "Sure". You should NOT be conversational in your responses, but rather direct and to the point. For example you should NOT say "Great, I've updated the CSS" but instead something like "I've updated the CSS". It is important you be clear and technical in your messages.\n` +
          "- Once you've completed the user's task, you MUST use the attemptCompletion tool to present the result of the task to the user. It is STRICTLY FORBIDDEN to complete the task without using this tool.\n" +
          '- When planning large-scale changes, create a high-level diagram using mermaid in Markdown. This helps explain your plan and allows you to gather user feedback before implementation.'
      },
      {
        role: 'user',
        content: [
          {
            type: 'text',
            text: '<system-reminder># System Information\n' +
              '\n' +
              'Operating System: linux\n' +
              'Default Shell: \n' +
              'Home Directory: /root\n' +
              'Current Working Directory: /root\n' +
              'Current Time: Thu Mar 19 2026 09:17:12 GMT+0000 (Coordinated Universal Time)\n' +
              '\n' +
              '# User Information\n' +
              '- Name: Test User\n' +
              '- Email: test@example.com\n' +
              '\n' +
              '# Current Working Directory (/root) Files\n' +
              '.bashrc\n' +
              '.profile\n' +
              '.daytona\n' +
              '.pochi\n' +
              '.gitconfig\n' +
              '.daytona/sessions\n' +
              '.pochi/config.jsonc\n' +
              '.daytona/sessions/a3777110-8132-47af-b51b-5923306e85aa\n' +
              '.daytona/sessions/693f5c50-112b-4d7e-b770-9650df4dec45\n' +
              '.daytona/sessions/380662f8-8805-47f4-91d4-31c76feba356\n' +
              '.daytona/sessions/9fa6e4a8-0a92-4a65-ac29-ae9e066c28a4\n' +
              '.daytona/sessions/a3777110-8132-47af-b51b-5923306e85aa/b4ba62f8-aee3-4106-9aef-66f6c5df79f2\n' +
              '.daytona/sessions/693f5c50-112b-4d7e-b770-9650df4dec45/ebb5ee05-6f54-4f88-9e78-089e3dc49fda\n' +
              '.daytona/sessions/380662f8-8805-47f4-91d4-31c76feba356/d6e3820d-c720-4dd4-b5a4-372b6a6f4077\n' +
              '.daytona/sessions/9fa6e4a8-0a92-4a65-ac29-ae9e066c28a4/4f04fe80-a746-46a5-b898-0d363239583c\n' +
              '.daytona/sessions/a3777110-8132-47af-b51b-5923306e85aa/b4ba62f8-aee3-4106-9aef-66f6c5df79f2/exit_code\n' +
              '.daytona/sessions/693f5c50-112b-4d7e-b770-9650df4dec45/ebb5ee05-6f54-4f88-9e78-089e3dc49fda/exit_code\n' +
              '.daytona/sessions/380662f8-8805-47f4-91d4-31c76feba356/d6e3820d-c720-4dd4-b5a4-372b6a6f4077/exit_code\n' +
              '\n' +
              '# GIT STATUS\n' +
              'Current branch: \n' +
              'Main branch (you will usually use this for PRs): \n' +
              '\n' +
              'Recent commits:\n' +
              '\n' +
              '\n' +
              '# TODOs\n' +
              'No TODOs yet, if you are working on tasks that would benefit from a todo list please use the todoWrite tool to create one.</system-reminder>'
          },
          {
            type: 'text',
            text: 'You are a developer migrating from Git to Jujutsu (jj). You have an existing local Git repository at `/home/user/my-project`. Your task is to start using jj with this repository without breaking Git compatibility.\\n\\n1. Navigate to `/home/user/my-project`.\\n2. Initialize a colocated jj repository so that jj and Git can be used together.\\n3. Create a new bookmark named `feature-x`.\\n4. Create a new file named `feature.txt` containing the text `Hello jj`.\\n5. Create a new jj commit (or describe the working copy) with the description `Add feature.txt`.\\n\\nWhen finished, the repository should be a valid colocated jj/Git repo, the `feature-x` bookmark should exist and be exported to Git, and the commit should have the specified description and file.'
          }
        ]
      },
      {
        role: 'assistant',
        content: '\n' +
          '\n' +
          "I'll work through this step-by-step, migrating the Git repository to use Jujutsu (jj) in colocated mode.",
        tool_calls: [
          {
            id: 'toolu_011rCkj2REAg3R87c4PHJkcQ',
            type: 'function',
            function: {
              name: 'todoWrite',
              arguments: `{"todos":[{"id":"check-repo","content":"Check if /home/user/my-project exists and has a Git repo","status":"in-progress","priority":"high"},{"id":"init-jj","content":"Initialize colocated jj repository","status":"pending","priority":"high"},{"id":"create-bookmark","content":"Create feature-x bookmark","status":"pending","priority":"high"},{"id":"create-file","content":"Create feature.txt with 'Hello jj'","status":"pending","priority":"high"},{"id":"describe-commit","content":"Describe/create commit with 'Add feature.txt'","status":"pending","priority":"high"},{"id":"verify","content":"Verify colocated repo, bookmark, and commit","status":"pending","priority":"high"}]}`
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_011rCkj2REAg3R87c4PHJkcQ',
        content: '{"success":true}'
      },
      {
        role: 'assistant',
        content: '',
        tool_calls: [
          {
            id: 'toolu_0174ARF4pbW41KSU4HQtRVw4',
            type: 'function',
            function: {
              name: 'executeCommand',
              arguments: '{"command":"ls -la /home/user/my-project 2>/dev/null; echo \\"---\\"; ls -la /home/user/my-project/.git 2>/dev/null"}'
            }
          },
          {
            id: 'toolu_01FmkuNLXYsjxvTsBfVmHFba',
            type: 'function',
            function: {
              name: 'executeCommand',
              arguments: '{"command":"which jj && jj --version"}'
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_0174ARF4pbW41KSU4HQtRVw4',
        content: '{"output":"total 8\\r\\ndrwxr-xr-x 3 root root   47 Mar 11 12:10 .\\r\\ndrwxr-xr-x 1 root root   32 Mar 11 12:10 ..\\r\\ndrwxr-xr-x 8 root root 4096 Mar 11 12:10 .git\\r\\n-rw-r--r-- 1 root root   15 Mar 11 12:10 README.md\\r\\n---\\r\\ntotal 28\\r\\ndrwxr-xr-x 8 root root 4096 Mar 11 12:10 .\\r\\ndrwxr-xr-x 3 root root   47 Mar 11 12:10 ..\\r\\n-rw-r--r-- 1 root root   15 Mar 11 12:10 COMMIT_EDITMSG\\r\\n-rw-r--r-- 1 root root   21 Mar 11 12:10 HEAD\\r\\ndrwxr-xr-x 2 root root    6 Mar 11 12:10 branches\\r\\n-rw-r--r-- 1 root root   92 Mar 11 12:10 config\\r\\n-rw-r--r-- 1 root root   73 Mar 11 12:10 description\\r\\ndrwxr-xr-x 2 root root 4096 Mar 11 12:10 hooks\\r\\n-rw-r--r-- 1 root root  137 Mar 11 12:10 index\\r\\ndrwxr-xr-x 2 root root   29 Mar 11 12:10 info\\r\\ndrwxr-xr-x 3 root root   30 Mar 11 12:10 logs\\r\\ndrwxr-xr-x 7 root root   84 Mar 11 12:10 objects\\r\\ndrwxr-xr-x 4 root root   43 Mar 11 12:10 refs\\r\\n","isTruncated":false}'
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_01FmkuNLXYsjxvTsBfVmHFba',
        content: '{"output":"/usr/local/bin/jj\\r\\njj 0.38.0-2508982cde5c7e4db0933e0b6469f9e778e71e28\\r\\n","isTruncated":false}'
      },
      {
        role: 'assistant',
        content: 'The Git repository exists at `/home/user/my-project` with a `README.md` file, and `jj` v0.38.0 is installed.',
        tool_calls: [
          {
            id: 'toolu_01ULas2uw3TnyRPAHN6aUhhT',
            type: 'function',
            function: {
              name: 'todoWrite',
              arguments: `{"todos":[{"id":"check-repo","content":"Check if /home/user/my-project exists and has a Git repo","status":"completed","priority":"high"},{"id":"init-jj","content":"Initialize colocated jj repository","status":"in-progress","priority":"high"},{"id":"create-bookmark","content":"Create feature-x bookmark","status":"pending","priority":"high"},{"id":"create-file","content":"Create feature.txt with 'Hello jj'","status":"pending","priority":"high"},{"id":"describe-commit","content":"Describe/create commit with 'Add feature.txt'","status":"pending","priority":"high"},{"id":"verify","content":"Verify colocated repo, bookmark, and commit","status":"pending","priority":"high"}]}`
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_01ULas2uw3TnyRPAHN6aUhhT',
        content: '{"success":true}'
      },
      {
        role: 'assistant',
        content: '**Step 1 & 2: Initialize a colocated jj repository.** The `--colocate` flag (or running `jj git init --colocate` inside an existing Git repo) sets up jj to share the `.git` directory, so both tools work together.',
        tool_calls: [
          {
            id: 'toolu_019jY8xFeB1m7PfbXfapjtni',
            type: 'function',
            function: {
              name: 'executeCommand',
              arguments: '{"command":"cd /home/user/my-project && jj git init --colocate"}'
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_019jY8xFeB1m7PfbXfapjtni',
        content: '{"output":"Done importing changes from the underlying Git repo.\\r\\nInitialized repo in \\".\\"\\r\\nHint: Running `git clean -xdf` will remove `.jj/`!\\r\\n","isTruncated":false}'
      },
      {
        role: 'assistant',
        content: 'Colocated jj repository initialized. Let me verify the `.jj` directory was created alongside `.git`:',
        tool_calls: [
          {
            id: 'toolu_017U73gxk7EtcnybfQfMwDDW',
            type: 'function',
            function: {
              name: 'executeCommand',
              arguments: '{"command":"ls -la /home/user/my-project/ | head -20"}'
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_017U73gxk7EtcnybfQfMwDDW',
        content: '{"output":"total 4\\r\\ndrwxr-xr-x 1 root root 41 Mar 19 09:17 .\\r\\ndrwxr-xr-x 1 root root 32 Mar 11 12:10 ..\\r\\ndrwxr-xr-x 1 root root 45 Mar 11 12:10 .git\\r\\ndrwxr-xr-x 4 root root 72 Mar 19 09:17 .jj\\r\\n-rw-r--r-- 1 root root 15 Mar 11 12:10 README.md\\r\\n","isTruncated":false}'
      },
      {
        role: 'assistant',
        content: 'Both `.git` and `.jj` directories exist — the repo is colocated.',
        tool_calls: [
          {
            id: 'toolu_01RbFKbcqvYrAPXMhdewxZNQ',
            type: 'function',
            function: {
              name: 'todoWrite',
              arguments: `{"todos":[{"id":"check-repo","content":"Check if /home/user/my-project exists and has a Git repo","status":"completed","priority":"high"},{"id":"init-jj","content":"Initialize colocated jj repository","status":"completed","priority":"high"},{"id":"create-bookmark","content":"Create feature-x bookmark","status":"in-progress","priority":"high"},{"id":"create-file","content":"Create feature.txt with 'Hello jj'","status":"pending","priority":"high"},{"id":"describe-commit","content":"Describe/create commit with 'Add feature.txt'","status":"pending","priority":"high"},{"id":"verify","content":"Verify colocated repo, bookmark, and commit","status":"pending","priority":"high"}]}`
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_01RbFKbcqvYrAPXMhdewxZNQ',
        content: '{"success":true}'
      },
      {
        role: 'assistant',
        content: '**Step 3: Create the `feature-x` bookmark.** Let me first check the current jj log to understand the state:',
        tool_calls: [
          {
            id: 'toolu_0194HmfhNtUVQ4zP16p2MXym',
            type: 'function',
            function: {
              name: 'executeCommand',
              arguments: '{"command":"cd /home/user/my-project && jj log"}'
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_0194HmfhNtUVQ4zP16p2MXym',
        content: '{"output":"@  uyntpwtv (no email set) 2026-03-19 09:17:41 5d317252\\r\\n│  (empty) (no description set)\\r\\nā—‹  ypsoummp test@example.com 2026-03-11 12:10:51 main 14d944a2\\r\\n│  Initial commit\\r\\nā—†  zzzzzzzz root() 00000000\\r\\n","isTruncated":false}'
      },
      {
        role: 'assistant',
        content: "The working copy change (`@`) is on top of the `main` branch. Now I'll create the `feature-x` bookmark pointing to the current working copy change:",
        tool_calls: [
          {
            id: 'toolu_01Bqso2WjCh52bGNmUGaHTFv',
            type: 'function',
            function: {
              name: 'executeCommand',
              arguments: '{"command":"cd /home/user/my-project && jj bookmark create feature-x -r @"}'
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_01Bqso2WjCh52bGNmUGaHTFv',
        content: `{"output":"Warning: Target revision is empty.\\r\\nCreated 1 bookmarks pointing to uyntpwtv 5d317252 feature-x | (empty) (no description set)\\r\\nWarning: Name and email not configured. Until configured, your commits will be created with the empty identity, and can't be pushed to remotes.\\r\\nHint: To configure, run:\\r\\n  jj config set --user user.name \\"Some One\\"\\r\\n  jj config set --user user.email \\"someone@example.com\\"\\r\\n","isTruncated":false}`
      }
    ],
    tools: [
      {
        type: 'function',
        function: {
          name: 'applyDiff',
          description: "This is a tool for editing files. For moving or renaming files, you should generally use the executeCommand tool with the 'mv' command instead. For larger edits, use the writeFile tool to overwrite files.\n" +
            '\n' +
            "Before using this tool, use the readFile tool to understand the file's contents and context\n" +
            '\n' +
            'To make a file edit, provide the following:\n' +
            '1. path: The path to the file to modify (relative to the current working directory, or an absolute path)\n' +
            '2. searchContent: The text to replace (must match the file contents exactly, including all whitespace and indentation)\n' +
            '3. replaceContent: The edited text to replace the searchContent (must be different from searchContent)\n' +
            '4. expectedReplacements: The number of replacements you expect to make. Defaults to 1 if not specified.\n' +
            '\n' +
            'By default, the tool will replace ONE occurrence of searchContent with replaceContent in the specified file. If you want to replace multiple occurrences, provide the expectedReplacements parameter with the exact number of occurrences you expect.\n' +
            '\n' +
            'CRITICAL REQUIREMENTS FOR USING THIS TOOL:\n' +
            '\n' +
            '1. UNIQUENESS (when expectedReplacements is not specified): The searchContent MUST uniquely identify the specific instance you want to change. This means:\n' +
            '   - Include AT LEAST 3-5 lines of context BEFORE the change point\n' +
            '   - Include AT LEAST 3-5 lines of context AFTER the change point\n' +
            '   - Include all whitespace, indentation, and surrounding code exactly as it appears in the file\n' +
            '\n' +
            '2. EXPECTED MATCHES: If you want to replace multiple instances:\n' +
            '   - Use the expectedReplacements parameter with the exact number of occurrences you expect to replace\n' +
            '   - This will replace ALL occurrences of the searchContent with the replaceContent\n' +
            "   - If the actual number of matches doesn't equal expectedReplacements, the edit will fail\n" +
            '   - This is a safety feature to prevent unintended replacements\n' +
            '\n' +
            '3. VERIFICATION: Before using this tool:\n' +
            '   - Check how many instances of the target text exist in the file\n' +
            '   - If multiple instances exist, either:\n' +
            '     a) Gather enough context to uniquely identify each one and make separate calls, OR\n' +
            '     b) Use expectedReplacements parameter with the exact count of instances you expect to replace\n' +
            '\n' +
            'WARNING:\n' +
            "- The tool will fail if searchContent matches multiple locations and expectedReplacements isn't specified\n" +
            "- The tool will fail if the number of matches doesn't equal expectedReplacements when it's specified\n" +
            "- The tool will fail if searchContent doesn't match the file contents exactly (including whitespace)\n" +
            '- The tool will fail if searchContent and replaceContent are the same\n' +
            '\n' +
            'When making edits:\n' +
            '   - Ensure the edit results in idiomatic, correct code\n' +
            '   - Do not add trailing whitespace to lines (a newline at the end of a file is fine)\n' +
            '   - Do not leave the code in a broken state\n' +
            '\n' +
            'If you want to create a new file, use:\n' +
            '   - A new file path, including dir name if needed\n' +
            '   - An empty searchContent\n' +
            "   - The new file's contents as replaceContent\n" +
            '\n' +
            'Remember: when making multiple file edits in a row to the same file, you should prefer to send all edits in a single message with multiple calls to this tool, rather than multiple messages with a single call each.\n' +
            '\n' +
            'You may see the following fields in the result:\n' +
            '- autoFormattingEdits: If the auto-formatter makes any changes, this field will contain a diff against the file content after your edits and any user edits have been applied.\n' +
            '- newProblems: If any new problems are found after the edit, this field will contain information about them.',
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path of the file to modify (relative to the current working directory, or an absolute path).'
              },
              searchContent: {
                type: 'string',
                description: 'The text to replace.'
              },
              replaceContent: {
                type: 'string',
                description: 'The text to replace it with.'
              },
              expectedReplacements: {
                type: 'number',
                description: 'The expected number of replacements to perform. Defaults to 1 if not specified.'
              }
            },
            required: [
              'path',
              'searchContent',
              'replaceContent'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'askFollowupQuestion',
          description: 'Ask the user a question to gather additional information needed to complete the task. \n' +
            '\n' +
            '## When to Use This Tool\n' +
            'Use this tool in the following scenarios:\n' +
            "1. The user's request is ambiguous or unclear and requires clarification.\n" +
            '2. You need more details to proceed effectively.\n' +
            '3. You have made several unsuccessful attempts to solve the issue and need user guidance to move forward.\n' +
            '4. Offer choices to the user about what direction to take.\n' +
            '\n' +
            '## Usage Notes\n' +
            '- Users will always be able to select "Other" to provide custom text input\n' +
            '- Use multiSelect: true to allow multiple answers to be selected for a question\n' +
            '- If you recommend a specific option, make that the first option in the list and add "(Recommended)" at the end of the label\n' +
            '- Provide 1-4 questions per call\n' +
            '\n' +
            'IMPORTANT: This tool CANNOT be used in combination with other tools (except todoWrite) in a single step. If you need to use other tools, you must do so in a separate step before calling this tool.',
          parameters: {
            type: 'object',
            properties: {
              questions: {
                type: 'array',
                items: {
                  type: 'object',
                  properties: {
                    question: {
                      type: 'string',
                      description: 'The complete question to ask the user. Should be clear, specific, and end with a question mark.'
                    },
                    header: {
                      type: 'string',
                      maxLength: 12,
                      description: 'Very short label displayed as a chip/tag (max 12 chars). Examples: "Auth method", "Library", "Approach".'
                    },
                    options: {
                      type: 'array',
                      items: {
                        type: 'object',
                        properties: {
                          label: {
                            type: 'string',
                            description: 'Short button label shown to the user. Should be concise (1-5 words) and clearly describe the choice.'
                          },
                          description: {
                            type: 'string',
                            description: 'Explanation of what this option means or what will happen if chosen. Useful for providing context about trade-offs or implications.'
                          }
                        },
                        required: [
                          'label'
                        ],
                        additionalProperties: false
                      },
                      minItems: 2,
                      maxItems: 4,
                      description: "The available choices for this question. Must have 2-4 options. Each option should be a distinct, mutually exclusive choice (unless multiSelect is enabled). There should be no 'Other' option, that will be provided automatically."
                    },
                    multiSelect: {
                      type: 'boolean',
                      default: false,
                      description: 'Set to true to allow the user to select multiple options instead of just one. Use when choices are not mutually exclusive.'
                    }
                  },
                  required: [
                    'question',
                    'header',
                    'options'
                  ],
                  additionalProperties: false
                },
                minItems: 1,
                maxItems: 4,
                description: 'Questions to ask the user (1-4 questions).'
              }
            },
            required: [
              'questions'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'attemptCompletion',
          description: "Once you've received the results of tool uses and can confirm that the task is complete, use this tool to present the result of your work to the user.\n" +
            '\n' +
            'You MUST NOT generate any text before this tool call. All conclusion text must be included within the result parameter of the attemptCompletion tool.\n' +
            'Never use this tool with a question or request to engage in further conversation! Formulate the end of your result in a way that is final and does not require further input from the user.\n' +
            '\n' +
            'IMPORTANT: This tool CANNOT be used in combination with other tools (except todoWrite) in a single step. If you need to use other tools, you must do so in a separate step before calling this tool.',
          parameters: {
            '$schema': 'http://json-schema.org/draft-07/schema#',
            type: 'object',
            properties: {
              result: {
                description: 'The result of the task. Formulate this result in a way that is final and does not require further input from the user.',
                type: 'string'
              }
            },
            required: [
              'result'
            ],
            additionalProperties: false
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'executeCommand',
          description: 'Executes a given bash command in a persistent shell session with optional timeout, ensuring proper handling and security measures.\n' +
            '\n' +
            'IMPORTANT: This tool is for terminal operations like git, npm, docker, etc. DO NOT use it for file operations (reading, writing, editing, searching, finding files) - use the specialized tools for this instead.\n' +
            '\n' +
            'Before executing the command, please follow these steps:\n' +
            '\n' +
            '1. Directory Verification:\n' +
            '   - If the command will create new directories or files, first use listFiles to verify the parent directory exists and is the correct location\n' +
            '   - For example, before running "mkdir foo/bar", first use listFiles to check that "foo" exists and is the intended parent directory\n' +
            '\n' +
            '2. Command Execution:\n' +
            '   - Always quote file paths that contain spaces with double quotes (e.g., cd "path with spaces/file.txt")\n' +
            '   - Examples of proper quoting:\n' +
            '     - cd "/Users/name/My Documents" (correct)\n' +
            '     - cd /Users/name/My Documents (incorrect - will fail)\n' +
            '     - python "/path/with spaces/script.py" (correct)\n' +
            '     - python /path/with spaces/script.py (incorrect - will fail)\n' +
            '   - After ensuring proper quoting, execute the command.\n' +
            '   - Capture the output of the command.\n' +
            '\n' +
            'Usage notes:\n' +
            '- The command argument is required.\n' +
            '- You can specify an optional timeout in seconds (up to 300s / 5 minutes). If not specified, commands will timeout after 60s (1 minute).\n' +
            '- If the output exceeds 30000 characters, output will be truncated before being returned to you.\n' +
            '- When issuing multiple commands:\n' +
            '  - If the commands are independent and can run in parallel, make multiple executeCommand tool calls in a single message. For example, if you need to run "git status" and "git diff", send a single message with two executeCommand tool calls in parallel.\n' +
            '  - If the commands depend on each other and must run sequentially, use a single executeCommand call with \'&&\' to chain them together (e.g., `git add . && git commit -m "message" && git push`). For instance, if one operation must complete before another starts (like mkdir before cp, Write before executeCommand for git operations, or git add before git commit), run these operations sequentially instead.\n' +
            "  - Use ';' only when you need to run commands sequentially but don't care if earlier commands fail\n" +
            '  - DO NOT use newlines to separate commands (newlines are ok in quoted strings)\n' +
            "- You shall avoid use the markdown code block syntax (backtick, '`') in your command, as it will be interpreted as a command substitution.\n" +
            "- Before using this tool, you must first think about the context provided in <system-reminder> to understand the user's environment and tailor your commands to ensure they are compatible with their system. You must also consider if the command you need to run should be executed in a specific directory rather than the current working directory, and properly set the `cwd` if necessary.\n" +
            '\n' +
            '# Committing changes with git\n' +
            '\n' +
            'Only create commits when requested by the user. If unclear, ask first. When the user asks you to create a new git commit, follow these steps carefully:\n' +
            '\n' +
            'Git Safety Protocol:\n' +
            '- NEVER update the git config\n' +
            "- NEVER run destructive git commands (push --force, reset --hard, checkout ., restore ., clean -f, branch -D) unless the user explicitly requests these actions. Taking unauthorized destructive actions is unhelpful and can result in lost work, so it's best to ONLY run these commands when given direct instructions \n" +
            '- NEVER skip hooks (--no-verify, --no-gpg-sign, etc) unless the user explicitly requests it\n' +
            '- NEVER run force push to main/master, warn the user if they request it\n' +
            '- CRITICAL: Always create NEW commits rather than amending, unless the user explicitly requests a git amend. When a pre-commit hook fails, the commit did NOT happen  — so --amend would modify the PREVIOUS commit, which may result in destroying work or losing previous changes. Instead, after hook failure, fix the issue, re-stage, and create a NEW commit\n' +
            '- When staging files, prefer adding specific files by name rather than using "git add -A" or "git add .", which can accidentally include sensitive files (.env, credentials) or large binaries\n' +
            '- NEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked, otherwise the user will feel that you are being too proactive\n' +
            '\n' +
            '1. You can call multiple tools in a single response. When multiple independent pieces of information are requested and all commands are likely to succeed, run multiple tool calls in parallel for optimal performance. run the following bash commands in parallel, each using the executeCommand tool:\n' +
            '  - Run a git status command to see all untracked files. IMPORTANT: Never use the -uall flag as it can cause memory issues on large repos.\n' +
            '  - Run a git diff command to see both staged and unstaged changes that will be committed.\n' +
            "  - Run a git log command to see recent commit messages, so that you can follow this repository's commit message style.\n" +
            '2. Analyze all staged changes (both previously staged and newly added) and draft a commit message:\n' +
            '  - Summarize the nature of the changes (eg. new feature, enhancement to an existing feature, bug fix, refactoring, test, docs, etc.). Ensure the message accurately reflects the changes and their purpose (i.e. "add" means a wholly new feature, "update" means an enhancement to an existing feature, "fix" means a bug fix, etc.).\n' +
            '  - Do not commit files that likely contain secrets (.env, credentials.json, etc). Warn the user if they specifically request to commit those files\n' +
            '  - Draft a concise (1-2 sentences) commit message that focuses on the "why" rather than the "what"\n' +
            '  - Ensure it accurately reflects the changes and their purpose\n' +
            '3. You can call multiple tools in a single response. When multiple independent pieces of information are requested and all commands are likely to succeed, run multiple tool calls in parallel for optimal performance. run the following commands:\n' +
            '   - Add relevant untracked files to the staging area.\n' +
            '   - Create the commit with a message ending with:\n' +
            '   šŸ¤– Generated with [Pochi](https://getpochi.com) | [Task](<Share URL>)\n' +
            '\n' +
            '   Co-Authored-By: Pochi <noreply@getpochi.com>\n' +
            '\n' +
            '   Note: Replace <Share URL> with the Share URL from system information if available. If not available, omit the " | [Task](...)" part.\n' +
            '\n' +
            '   - Run git status after the commit completes to verify success.\n' +
            '   Note: git status depends on the commit completing, so run it sequentially after the commit.\n' +
            '4. If the commit fails due to pre-commit hook changes, retry the commit ONCE to include these automated changes. If it fails again, it usually means a pre-commit hook is preventing the commit. If the commit succeeds but you notice that files were modified by the pre-commit hook, you MUST amend your commit to include them.\n' +
            '\n' +
            'Important notes:\n' +
            '- NEVER update the git config\n' +
            '- NEVER run additional commands to read or explore code, besides git bash commands\n' +
            '- DO NOT push to the remote repository unless the user explicitly asks you to do so\n' +
            '- IMPORTANT: Never use git commands with the -i flag (like git rebase -i or git add -i) since they require interactive input which is not supported.\n' +
            '- IMPORTANT: Do not use --no-edit with git rebase commands, as the --no-edit flag is not a valid option for git rebase.\n' +
            '- If there are no changes to commit (i.e., no untracked files and no modifications), do not create an empty commit\n' +
            '- In order to ensure good formatting, ALWAYS pass the commit message via a HEREDOC, a la this example:\n' +
            '<example>\n' +
            `git commit -m "$(cat <<'EOF'\n` +
            'Commit message here.\n' +
            '\n' +
            'šŸ¤– Generated with [Pochi](https://getpochi.com) | [Task](<Share URL>)\n' +
            '\n' +
            'Co-Authored-By: Pochi <noreply@getpochi.com>\n' +
            'EOF\n' +
            ')"\n' +
            '</example>\n' +
            '\n' +
            '# Creating pull requests\n' +
            'Use the gh command via the executeCommand tool for ALL GitHub-related tasks including working with issues, pull requests, checks, and releases. If given a Github URL use the gh command to get the information needed.\n' +
            '\n' +
            'IMPORTANT: When the user asks you to create a pull request, follow these steps carefully:\n' +
            '\n' +
            '1. You can call multiple tools in a single response. When multiple independent pieces of information are requested and all commands are likely to succeed, run multiple tool calls in parallel for optimal performance. run the following bash commands in parallel using the executeCommand tool, in order to understand the current state of the branch since it diverged from the main branch:\n' +
            '   - Run a git status command to see all untracked files (never use -uall flag)\n' +
            '   - Run a git diff command to see both staged and unstaged changes that will be committed\n' +
            '   - Check if the current branch tracks a remote branch and is up to date with the remote, so you know if you need to push to the remote\n' +
            '   - Run a git log command and `git diff [base-branch]...HEAD` to understand the full commit history for the current branch (from the time it diverged from the base branch)\n' +
            '2. Analyze all changes that will be included in the pull request, making sure to look at all relevant commits (NOT just the latest commit, but ALL commits that will be included in the pull request!!!), and draft a pull request title and summary:\n' +
            '   - Keep the PR title short (under 70 characters)\n' +
            '   - Use the description/body for details, not the title\n' +
            '3. You can call multiple tools in a single response. When multiple independent pieces of information are requested and all commands are likely to succeed, run multiple tool calls in parallel for optimal performance. run the following commands in parallel:\n' +
            '   - Create new branch if needed\n' +
            '   - Push to remote with -u flag if needed\n' +
            '   - Create PR using gh pr create with the format below. Use a HEREDOC to pass the body to ensure correct formatting.\n' +
            '<example>\n' +
            `gh pr create --title "the pr title" --body "$(cat <<'EOF'\n` +
            '## Summary\n' +
            '<1-3 bullet points>\n' +
            '\n' +
            '## Test plan\n' +
            '[Checklist of TODOs for testing the pull request...]\n' +
            '\n' +
            'šŸ¤– Generated with [Pochi](https://getpochi.com) | [Task](<Share URL>)\n' +
            'EOF\n' +
            ')"\n' +
            '</example>\n' +
            '\n' +
            'Important:\n' +
            '- NEVER update the git confi'... 355 more characters,
          parameters: {
            type: 'object',
            properties: {
              command: {
                type: 'string',
                description: 'The CLI command to execute. This should be valid for the current operating system.'
              },
              cwd: {
                type: 'string',
                description: 'The working directory to execute the command in.'
              },
              timeout: {
                type: 'number',
                minimum: 1,
                maximum: 300,
                description: 'Optional timeout in seconds, max 300 seconds. By default the timeout is 120 seconds.'
              }
            },
            required: [
              'command'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'globFiles',
          description: 'Request to find files matching a glob pattern within a specified directory. Use this to get a list of files based on a pattern.',
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path of the directory to search in (relative to the current working directory, or an absolute path)'
              },
              globPattern: {
                type: 'string',
                description: "The glob pattern to match files against (e.g., '*.ts', '**/*.js')"
              }
            },
            required: [
              'path',
              'globPattern'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'listFiles',
          description: 'Request to list files and directories within the specified directory. If recursive is true, it will list all files and directories recursively. If recursive is false or not provided, it will only list the top-level contents. Do not use this tool to confirm the existence of files you may have created, as the user will let you know if the files were created successfully or not.',
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path of the directory to list contents for (relative to the current working directory, or an absolute path)'
              },
              recursive: {
                type: 'boolean',
                description: 'Whether to list files and directories recursively.'
              }
            },
            required: [
              'path'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'readFile',
          description: 'Request to read the contents of a file at the specified path. Use this when you need to examine the contents of an existing file you do not know the contents of, for example to analyze code, review text files, extract information from configuration files.\n' +
            '',
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path of the file to read (relative to the current working directory, or an absolute path)'
              },
              startLine: {
                type: 'number',
                description: 'The starting line number to read from (1-based). If not provided, it starts from the beginning of the file.'
              },
              endLine: {
                type: 'number',
                description: 'The ending line number to read to (1-based, inclusive). If not provided, it reads to the end of the file.'
              }
            },
            required: [
              'path'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'useSkill',
          description: 'Execute a skill within the main conversation\n' +
            '\n' +
            'When users ask you to perform tasks, check if any of the available skills below can help complete the task more effectively. Skills provide specialized capabilities and domain knowledge.\n' +
            '\n' +
            'When users ask about a SPECIFIC skill (e.g., "How does the pdf skill work?", "What does the commit skill do?"), you must call this tool to get detailed information about that skill.\n' +
            '\n' +
            'When users ask general questions like "What skills are available?" or "List all skills", simply refer to the "Available skills" section below - do NOT call this tool.\n' +
            '\n' +
            "This tool returns the skill's detailed instructions which you must then follow to complete the task. The instructions contain step-by-step guidance on how to perform the specific task or workflow.\n" +
            '\n' +
            'How to invoke:\n' +
            '- Use this tool with the skill name\n' +
            '- Example: `skill: "pdf-processing"` - invoke the pdf-processing skill\n' +
            "- The tool will return the skill's instructions\n" +
            '- Follow the returned instructions carefully to complete the task\n' +
            '\n' +
            'Important:\n' +
            '- When a skill is relevant for a task OR when users ask about a SPECIFIC skill, you must invoke this tool IMMEDIATELY as your first action\n' +
            '- For general questions about available skills, simply refer to the "Available skills" list below without calling this tool\n' +
            '- NEVER just announce or mention a skill in your text response without actually calling this tool (except for general skill listing requests)\n' +
            '- This is a BLOCKING REQUIREMENT: invoke the relevant Skill tool BEFORE generating any other response about a specific skill or task\n' +
            '- Only use skills listed in "Available skills" below\n' +
            '- Check compatibility requirements before using a skill - ensure the skill is compatible with the current OS/environment\n' +
            '- After calling this tool, follow the returned instructions step by step\n' +
            '- The skill file location is shown in the [Location: filepath] section of each skill listing below - use this information to understand where the skill is defined\n' +
            "- Use the directory containing the skill's source file as the base directory for resolving any resource files mentioned in the instructions\n" +
            '- Proactively explore the skill directory for optional resources that enhance task completion:\n' +
            '  * scripts/ - executable code that agents can run (Python, Bash, JavaScript, etc.)\n' +
            '  * references/ - on-demand documentation (REFERENCE.md, FORMS.md, domain-specific files)\n' +
            '  * assets/ - static resources (templates, images, data files, schemas)\n' +
            '  Use these resources when they exist and are relevant to the current task\n' +
            '\n' +
            'Available skills:\n' +
            '\n' +
            '- **find-skills**: Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill. [Location: _builtIn_]\n' +
            '- **create-skill**: Helps users create new custom agent skills. Use when the user wants to create a new skill, automate a workflow, or package specialized knowledge for reuse. [Location: _builtIn_]',
          parameters: {
            type: 'object',
            properties: {
              skill: {
                type: 'string',
                description: 'The name of the skill to use.'
              }
            },
            required: [
              'skill'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'searchFiles',
          description: '- Fast content search tool that works with any codebase size\n' +
            '- Searches file contents using regular expressions\n' +
            '- Supports Rust regex syntax (eg. "log.*Error", "functions+w+", etc.)\n' +
            '- Filter files by pattern with the include parameter (eg. "*.js", "*.{ts,tsx}")\n' +
            '- Returns file paths with at least one match sorted by modification time\n' +
            '- Use this tool when you need to find files containing specific patterns\n' +
            '- Craft your regex patterns carefully to balance specificity and flexibility.\n' +
            "- Based on the user's task you may use it to find code patterns, TODO comments, function definitions, or any text-based information across the project. The results include context, so analyze the surrounding code to better understand the matches. Leverage the this tool in combination with other tools for more comprehensive analysis. For example, use it to find specific code patterns, then use readFile to examine the full context of interesting matches before using applyDiff or writeToFile to make informed changes.",
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path of the directory to search in (relative to the current working directory, or an absolute path).'
              },
              regex: {
                type: 'string',
                description: 'The regular expression pattern to search for in file contents. Uses Rust regex syntax.'
              },
              filePattern: {
                type: 'string',
                description: 'File pattern to include in the search (e.g. "*.js", "*.{ts,tsx}"). If not provided, it will search all files.'
              }
            },
            required: [
              'path',
              'regex'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'todoWrite',
          description: 'Use this tool to create and manage a structured task list for your current coding session. This helps you track progress, organize complex tasks, and demonstrate thoroughness to the user.\n' +
            'It also helps the user understand the progress of the task and overall progress of their requests.\n' +
            '\n' +
            '## When to Use This Tool\n' +
            'Use this tool proactively in these scenarios:\n' +
            '\n' +
            '1. Complex multi-step tasks - When a task requires 3 or more distinct steps or actions\n' +
            '2. Non-trivial and complex tasks - Tasks that require careful planning or multiple operations\n' +
            '3. User explicitly requests todo list - When the user directly asks you to use the todo list\n' +
            '4. User provides multiple tasks - When users provide a list of things to be done (numbered or comma-separated)\n' +
            '5. After receiving new instructions - Immediately capture user requirements as todos. Feel free to edit the todo list based on new information.\n' +
            '6. After completing a task - Mark it complete and add any new follow-up tasks\n' +
            '7. When you start working on a new task, mark the todo as in-progress. Ideally you should only have one todo as in-progress at a time. Complete existing tasks before starting new ones.\n' +
            '\n' +
            '## When NOT to Use This Tool\n' +
            '\n' +
            'Skip using this tool when:\n' +
            '1. There is only a single, straightforward task\n' +
            '2. The task is trivial and tracking it provides no organizational benefit\n' +
            '3. The task can be completed in less than 3 trivial steps\n' +
            '4. The task is purely conversational or informational\n' +
            '\n' +
            'NOTE that you should use should not use this tool if there is only one trivial task to do. In this case you are better off just doing the task directly.\n' +
            '\n' +
            '## Examples of When to Use the Todo List\n' +
            '\n' +
            '<example>\n' +
            "User: I want to add a dark mode toggle to the application settings. Make sure you run the tests and build when you're done!\n" +
            "Assistant: I'll help add a dark mode toggle to your application settings. Let me create a todo list to track this implementation.\n" +
            '*Creates todo list with the following items:*\n' +
            '1. Create dark mode toggle component in Settings page\n' +
            '2. Add dark mode state management (context/store)\n' +
            '3. Implement CSS-in-JS styles for dark theme\n' +
            '4. Update existing components to support theme switching\n' +
            '5. Run tests and build process, addressing any failures or errors that occur\n' +
            '*Begins working on the first task*\n' +
            '\n' +
            '<reasoning>\n' +
            'The assistant used the todo list because:\n' +
            '1. Adding dark mode is a multi-step feature requiring UI, state management, and styling changes\n' +
            '2. The user explicitly requested tests and build be run afterward\n' +
            '3. The assistant inferred that tests and build need to pass by adding "Ensure tests and build succeed" as the final task\n' +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '<example>\n' +
            'User: Help me rename the function getCwd to getCurrentWorkingDirectory across my project\n' +
            "Assistant: Let me first search through your codebase to find all occurrences of 'getCwd'.\n" +
            '*Uses grep or search tools to locate all instances of getCwd in the codebase*\n' +
            "Assistant: I've found 15 instances of 'getCwd' across 8 different files. Let me create a todo list to track these changes.\n" +
            '*Creates todo list with specific items for each file that needs updating*\n' +
            '\n' +
            '<reasoning>\n' +
            'The assistant used the todo list because:\n' +
            '1. First, the assistant searched to understand the scope of the task\n' +
            '2. Upon finding multiple occurrences across different files, it determined this was a complex task with multiple steps\n' +
            '3. The todo list helps ensure every instance is tracked and updated systematically\n' +
            '4. This approach prevents missing any occurrences and maintains code consistency\n' +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '\n' +
            '<example>\n' +
            'User: I need to implement these features for my e-commerce site: user registration, product catalog, shopping cart, and checkout flow.\n' +
            "Assistant: I'll help implement these features. First, let's add all the features to the todo list.\n" +
            '*Creates a todo list breaking down each feature into specific tasks based on the project architecture*\n' +
            "Assistant: Let's start with user registration. This will involve creating database models, API endpoints, and frontend forms that integrate with your existing authentication system.\n" +
            '\n' +
            '<reasoning>\n' +
            'The assistant used the todo list because:\n' +
            '1. The user provided multiple complex features to implement in a comma separated list\n' +
            '2. The todo list helps organize these large features into manageable tasks\n' +
            '3. This approach allows for tracking progress across the entire implementation\n' +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '<example>\n' +
            "User: Can you help optimize my React application? It's rendering slowly and has performance issues.</user>\n" +
            "Assistant: I'll help optimize your React application. First, let me examine your codebase to identify potential performance bottlenecks.\n" +
            '*Reviews component structure, render patterns, state management, and data fetching*\n' +
            "Assistant: After analyzing your codebase, I've identified several performance issues. Let me create a todo list to track our optimization efforts.\n" +
            '*Creates todo list with items like: 1) Implement memoization for expensive calculations in ProductList, 2) Add virtualization for long lists in Dashboard, 3) Optimize image loading in Gallery component, 4) Fix state update loops in ShoppingCart, 5) Review bundle size and implement code splitting*\n' +
            "Let's start by implementing memoization for the expensive calculations in your ProductList component.</assistant>\n" +
            '\n' +
            '<reasoning>\n' +
            'The assistant used the todo list because:\n' +
            '1. First, the assistant examined the codebase to identify specific performance issues\n' +
            '2. Based on this analysis, it identified multiple optimization opportunities\n' +
            '3. Performance optimization is a non-trivial task requiring multiple steps\n' +
            '4. The todo list helps methodically track improvements across different components\n' +
            '5. This systematic approach ensures all performance bottlenecks are addressed\n' +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '## Examples of When NOT to Use the Todo List\n' +
            '\n' +
            '<example>\n' +
            "User: How do I print 'Hello World' in Python?\n" +
            'Assistant: In Python, you can print "Hello World" with this simple code:\n' +
            '\n' +
            'python\n' +
            'print("Hello World")\n' +
            '\n' +
            'This will output the text "Hello World" to the console when executed.</assistant>\n' +
            '\n' +
            '<reasoning>\n' +
            "The assistant did not use the todo list because this is a single, trivial task that can be completed in one step. There's no need to track multiple tasks or steps for such a straightforward request.\n" +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '<example>\n' +
            'User: What does the git status command do?\n' +
            "Assistant: The git status command shows the current state of your working directory and staging area. It displays which changes have been staged, which haven't, and which files aren't being tracked by Git. This is a fundamental command for understanding the current state of your repository before making commits.\n" +
            '\n' +
            '<reasoning>\n' +
            'The assistant did not use the todo list because this is an informational request with no actual coding task to complete. The user is simply asking for an explanation, not for the assistant to perform multiple steps or tasks.\n' +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '<example>\n' +
            'User: Can you add a comment to the calculateTotal function to explain what it does?\n' +
            'Assistant: Sure, let me add a comment to the calculateTotal function to explain what it does.\n' +
            '* Uses the Edit tool to add a comment to the calculateTotal function *\n' +
            '\n' +
            '<reasoning>\n' +
            "The assistant did not use the todo list because this is a single, straightforward task confined to one location in the code. Adding a comment doesn't require tracking multiple steps or systematic organization.\n" +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '<example>\n' +
            'User: Run npm install for me and tell me what happens.\n' +
            "Assistant: I'll run the npm install command for you.\n" +
            '\n' +
            '*Executes: npm install*\n' +
            '\n' +
            "The command completed successfully. Here's the output:\n" +
            '[Output of npm install command]\n' +
            '\n' +
            'All dependencies have been installed according to your package.json file.\n' +
            '\n' +
            '<reasoning>\n' +
            'The assistant did not use the todo list because this is a single command execution with immediate results. There are no multiple steps to track or organize, making the todo list unnecessary for this straightforward task.\n' +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '## Task States and Management\n' +
            '\n' +
            '1. **Task States**: Use these states to track progress:\n' +
            '   - pending: Task not yet started\n' +
            '   - in-progress: Currently working on (limit to ONE task at a time)\n' +
            '   - completed: Task finished successfully\n' +
            '   - cancelled: Task no longer needed\n' +
            '\n' +
            '2. **Task Management**:\n' +
            '   - Update task status in real-time as you work\n' +
            "   - Mark tasks complete IMMEDIATELY after finishing (don't batch completions)\n" +
            '   - Only have ONE task in-progress at any time\n' +
            '   - Complete current tasks before starting new ones\n' +
            '   - Cancel tasks that become irrelevant\n' +
            '\n' +
            '3. **Task Breakdown**:\n' +
            '   - Create specific, actionable items\n' +
            '   - Break complex tasks into smaller, manageable steps\n' +
            '   - Use clear, descriptive task names\n' +
            '\n' +
            'When in doubt, use this tool. Being proactive with task management demonstrates attentiveness and ensures you complete all requirements successfully.',
          parameters: {
            type: 'object',
            properties: {
              todos: {
                type: 'array',
                items: {
                  type: 'object',
                  properties: {
                    id: {
                      type: 'string',
                      description: 'The unique identifier of the task, e.g "collect-information".'
                    },
                    content: {
                      type: 'string',
                      description: 'The content of the task.'
                    },
                    status: {
                      type: 'string',
                      enum: [
                        'pending',
                        'in-progress',
                        'completed',
                        'cancelled'
                      ],
                      description: 'The status of the task.'
                    },
                    priority: {
                      type: 'string',
                      enum: [
                        'low',
                        'medium',
                        'high'
                      ],
                      description: 'The priority of the task.'
                    }
                  },
                  required: [
                    'id',
                    'content',
                    'status',
                    'priority'
                  ],
                  additionalProperties: false
                }
              }
            },
            required: [
              'todos'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'writeToFile',
          description: 'Request to write full content to a file at the specified path.\n' +
            'If the file exists, it will be overwritten with the provided content.\n' +
            "If the file doesn't exist, it will be created. This tool will automatically create any directories needed to write the file.\n" +
            '\n' +
            'You may see the following fields in the result:\n' +
            '- autoFormattingEdits: If the auto-formatter makes any changes, this field will contain a diff against the file content after your edits and any user edits have been applied.\n' +
            '- newProblems: If any new problems are found after the edit, this field will contain information about them.',
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path of the file to write to (relative to the current working directory, or an absolute path).'
              },
              content: {
                type: 'string',
                description: 'The content to write to the file.'
              }
            },
            required: [
              'path',
              'content'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'editNotebook',
          description: 'Edit a specific cell in a Jupyter notebook (.ipynb file) by its cell ID',
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path to the notebook file (relative to the current working directory, or an absolute path)'
              },
              cellId: {
                type: 'string',
                description: 'The ID of the cell to edit'
              },
              content: {
                type: 'string',
                description: 'The new content of the cell'
              }
            },
            required: [
              'path',
              'cellId',
              'content'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'newTask',
          description: 'Launch a new agent to handle complex, multi-step tasks autonomously.\n' +
            'When using the newTask tool, you may specify a agentType parameter to select which agent type to use.\n' +
            'Available agent types and the tools they have access to:\n' +
            '\n' +
            '### planner\n' +
            'Engage this agent to formulate comprehensive, technical implementation strategies for feature development, system refactoring, or defect resolution.\n' +
            'This agent is strictly limited to planning and architectural design; it DOES NOT execute code modifications.\n' +
            '\n' +
            'Examples of user requests this agent shall trigger:\n' +
            '- "create a plan to implement the user authentication feature"\n' +
            '- "how should we refactor the database schema"\n' +
            '- "design a solution for the memory leak issue"\n' +
            '\n' +
            '### browser\n' +
            'Web browser automation agent for navigating websites, interacting with pages, and extracting information. Uses agent-browser CLI for headless browser control.\n' +
            '\n' +
            '### reviewer\n' +
            'Engage this agent to perform code reviews and leave inline comments.\n' +
            'This agent can analyze code and create review comments on specific lines.\n' +
            '\n' +
            'Examples of user requests this agent shall trigger:\n' +
            '- "review the code in src/auth"\n' +
            '- "add review comments to this file"\n' +
            '- "check this code and leave feedback"\n' +
            '\n' +
            '### walkthrough\n' +
            'Engage this agent to create a summary of the changes made in the current task.\n' +
            'This agent is strictly limited to documentation and explanation; it DOES NOT execute code modifications.\n' +
            '\n' +
            'Examples of user requests this agent shall trigger:\n' +
            '- "summarize what we have done"\n' +
            '- "create a walkthrough for the changes"\n' +
            '- "explain the changes made in this task"\n' +
            '\n' +
            '### explore\n' +
            'Use this agent to explore the codebase when you need to: understand project structure, find where features are implemented, locate specific functions or classes, analyze code patterns, investigate how something works, search for examples or usage, or gather information before making changes.\n' +
            '\n' +
            'Examples of questions this agent shall trigger:\n' +
            '- "where is the authentication logic implemented"\n' +
            '- "find all usages of the config parser"\n' +
            '- "how does the ignore-walk module work"\n' +
            '\n' +
            '\n' +
            'Always include a reminder in your prompt to ensure the result will be submitted through the `attemptCompletion` tool.\n' +
            'If the task stops without submitting the result, it will return an error message.\n' +
            '\n' +
            'You can optionally run agents in the background using the runAsync parameter. You can continue working while background agents run.\n' +
            '\n' +
            'When NOT to use the newTask tool:\n' +
            '- If you want to read a specific file path, use the readFile or globFiles tool instead of the newTask tool, to find the match more quickly\n' +
            '- If you are searching for a specific class definition like "class Foo", use the globFiles tool instead, to find the match more quickly\n' +
            '- If you are searching for code within a specific file or set of 2-3 files, use the readFile tool instead of the newTask tool, to find the match more quickly\n' +
            '- Other tasks that are not related to the agent descriptions above\n' +
            '\n' +
            'Usage notes:\n' +
            '1. Launch multiple agents tools concurrently whenever possible to maximize performance; to do that, use a single message with multiple tool uses\n' +
            '2. When the agent is done, it will return a single message back to you. The result returned by the agent is not visible to the user. To show the user the result, you should send a text message back to the user with a concise summary of the result.\n' +
            '3. Each agent invocation is stateless. You will not be able to send additional messages to the agent, nor will the agent be able to communicate with you outside of its final report. Therefore, your prompt should contain a highly detailed task description for the agent to perform autonomously and you should specify exactly what information the agent should return back to you in its final and only message to you.\n' +
            "4. The agent's outputs should generally be trusted\n" +
            "5. Clearly tell the agent whether you expect it to write code or just to do research (search, file reads, web fetches, etc.), since it is not aware of the user's intent\n" +
            '6. If the agent description mentions that it should be used proactively, then you should try your best to use it without the user having to ask for it first. Use your judgement.',
          parameters: {
            type: 'object',
            properties: {
              description: {
                type: 'string',
                description: 'A short description of the task.'
              },
              prompt: {
                type: 'string',
                description: 'The detailed prompt for the task to be performed.'
              },
              agentType: {
                type: 'string',
                description: 'The type of the specialized agent to use for the task.'
              },
              runAsync: {
                type: 'boolean',
                description: 'Set to true to run this agent in the background.'
              }
            },
            required: [
              'description',
              'prompt'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'startBackgroundJob',
          description: 'Start a background job to execute a bash command, which allows you to continue working while the job runs.\n' +
            '\n' +
            'Before starting the background job, please follow these steps:\n' +
            '\n' +
            '1. Directory Verification:\n' +
            '   - If the command will create new directories or files, first use the listFiles tool to verify the parent directory exists and is the correct location\n' +
            '   - For example, before running "mkdir foo/bar", first use listFiles to check that "foo" exists and is the intended parent directory\n' +
            '\n' +
            '2. Job Execution:\n' +
            '   - After ensuring proper quoting, start the background job.\n' +
            '\n' +
            'Usage notes:\n' +
            '- The command argument is required.\n' +
            '- Use readBackgroundJobOutput to monitor the output and status of the job.\n' +
            '- Use killBackgroundJob to terminate the job if needed.\n' +
            '- If the output exceeds 30000 characters, output will be truncated before being returned to you.\n' +
            '\n' +
            'Common use cases and examples:\n' +
            '- Development servers: `npm run dev`, `yarn start`, `bun run dev`\n' +
            '- Build processes: `npm run build`, `make`, `cargo build`\n' +
            '- File watchers: `npm run watch`, `tsc --watch`\n' +
            '- Testing: `npm run test:watch`, `jest --watch`\n' +
            '- Database services: `docker run -p 5432:5432 postgres`\n' +
            '\n' +
            'Command execution rules:\n' +
            "- Never run 'sleep' as it will return immediately.\n" +
            "- You do not need to use '&' at the end of the command.\n" +
            "- When issuing multiple commands, use the ';' or '&&' operator to separate them. DO NOT use newlines (newlines are ok in quoted strings).\n" +
            "- You shall avoid use the markdown code block syntax (backtick, '`') in your command, as it will be interpreted as a command substitution.",
          parameters: {
            type: 'object',
            properties: {
              command: {
                type: 'string',
                description: 'The CLI command to execute. This should be valid for the current operating system.'
              },
              cwd: {
                type: 'string',
                description: 'The working directory to execute the command in.'
              }
            },
            required: [
              'command'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'readBackgroundJobOutput',
          description: '- Retrieves output from a running or completed background job or async task\n' +
            '- Takes a backgroundJobId parameter identifying the job or task\n' +
            '- For terminal jobs, returns only new output since the last check\n' +
            '- For task IDs, returns the latest attemptCompletion result once completed\n' +
            '- Returns stdout and stderr output along with job status\n' +
            '- Supports optional regex filtering to show only lines matching a pattern\n' +
            '- Use this tool when you need to monitor or check the output of a long-running background job',
          parameters: {
            type: 'object',
            properties: {
              backgroundJobId: {
                type: 'string',
                description: 'The ID of the background job to get output from'
              },
              regex: {
                type: 'string',
                description: 'Optional regular expression to filter the output lines. Only lines matching this regex will be included in the result. Any lines that do not match will no longer be available to read.'
              }
            },
            required: [
              'backgroundJobId'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'killBackgroundJob',
          description: '- Kills a running background job by its ID\n' +
            '- Takes a backgroundJobId parameter identifying the job to kill\n' +
            '- Returns a success or failure status\n' +
            '- Use this tool when you need to terminate a long-running background job',
          parameters: {
            type: 'object',
            properties: {
              backgroundJobId: {
                type: 'string',
                description: 'The ID of the background job to kill.'
              }
            },
            required: [
              'backgroundJobId'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'webFetch',
          description: '- Fetches content from a specified URL and converts HTML to markdown\n' +
            '- Use this tool when you need to retrieve and analyze web content\n' +
            '\n' +
            'Usage notes:\n' +
            '  - IMPORTANT: If an MCP-provided web fetch tool is available, prefer using that tool instead of this one, as it may have fewer restrictions.\n' +
            '  - The URL must be a fully-formed valid URL\n' +
            '  - The prompt should describe what information you want to extract from the page\n' +
            '  - This tool is read-only and does not modify any files\n' +
            '  - Includes a self-cleaning 10-minute cache for faster responses when repeatedly accessing the same URL',
          parameters: {
            '$schema': 'https://json-schema.org/draft/2020-12/schema',
            type: 'object',
            properties: {
              url: {
                type: 'string',
                format: 'uri'
              }
            },
            required: [
              'url'
            ],
            additionalProperties: false
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'webSearch',
          description: '- Allows Pochi to search the web and use the results to inform responses\n' +
            '- Provides up-to-date information for current events and recent data\n' +
            '- Returns search result information formatted as search result blocks, including links as markdown hyperlinks\n' +
            '- Searches are performed automatically within a single API call\n' +
            '\n' +
            'CRITICAL REQUIREMENT - You MUST follow this:\n' +
            `  - After answering the user's question, you MUST include a "Sources:" section at the end of your response\n` +
            '  - In the Sources section, list all relevant URLs from the search results as markdown hyperlinks: [Title](URL)\n' +
            '  - This is MANDATORY - never skip including sources in your response\n' +
            '  - Example format:\n' +
            '\n' +
            '    [Your answer here]\n' +
            '\n' +
            '    Sources:\n' +
            '    - [Source Title 1](https://example.com/1)\n' +
            '    - [Source Title 2](https://example.com/2)\n' +
            '\n' +
            'Usage notes:\n' +
            `  - Account for "Today's date" in <system-reminder>. For example, if <system-reminder> says "Today's date: 2025-07-01", and the user wants the latest docs, do not use 2024 in the search query. Use 2025.`,
          parameters: {
            '$schema': 'https://json-schema.org/draft/2020-12/schema',
            type: 'object',
            properties: {
              query: {
                description: 'The search query to perform',
                type: 'string'
              },
              country: {
                description: "Country code to filter search results by, e.g. 'US', 'GB', 'JP'",
                type: 'string'
              }
            },
            required: [
              'query'
            ],
            additionalProperties: false
          }
        }
      }
    ],
    tool_choice: 'auto',
    stream: true
  }
}
2026-03-19 09:18:17.983	DEBUG	/$bunfs/pochi:454339	listFiles	Listing workspace files from /root with maxItems 500
2026-03-19 09:18:47.222	DEBUG	/$bunfs/pochi:454339	listFiles	Listing workspace files from /root with maxItems 500
2026-03-19 09:18:47.358	ERROR	/$bunfs/pochi:432009	LiveChatKit	onError

 AI_APICallError  This request would exceed your organization's rate limit of 2,000,000 input tokens per minute (org: e70c8d22-9099-49c5-a9af-e059e6515b76, model: claude-opus-4-6). For details, refer to: https://docs.claude.com/en/api/rate-limits. You can see the response headers for current usage. Please reduce the prompt length or the maximum tokens requested, or try again later. You may also contact sales at https://claude.com/contact-sales to discuss your options for a rate limit increase., AI_APICallError, , https://api.anthropic.com/v1/chat/completions, [object Object], 429, [object Object], {"error":{"code":"rate_limit_error","message":"This request would exceed your organization's rate limit of 2,000,000 input tokens per minute (org: e70c8d22-9099-49c5-a9af-e059e6515b76, model: claude-opus-4-6). For details, refer to: https://docs.claude.com/en/api/rate-limits. You can see the response headers for current usage. Please reduce the prompt length or the maximum tokens requested, or try again later. You may also contact sales at https://claude.com/contact-sales to discuss your options for a rate limit increase.","type":"invalid_request_error","param":null}}, true, [object Object], 423231, 30, 423231, 30, /$bunfs/root/pochi
error stack:
  • pochi	<anonymous>
	/$bunfs/pochi:423231
  • pochi	async <anonymous>
	/$bunfs/pochi:423092
  • native	processTicksAndRejections
	native:7
2026-03-19 09:18:47.373	ERROR	/$bunfs/pochi:502749	TaskRunner	Task is failed, trying to resend last message to resume it. {
  kind: 'APICallError',
  isRetryable: true,
  message: "This request would exceed your organization's rate limit of 2,000,000 input tokens per minute (org: e70c8d22-9099-49c5-a9af-e059e6515b76, model: claude-opus-4-6). For details, refer to: https://docs.claude.com/en/api/rate-limits. You can see the response headers for current usage. Please reduce the prompt length or the maximum tokens requested, or try again later. You may also contact sales at https://claude.com/contact-sales to discuss your options for a rate limit increase.",
  requestBodyValues: {
    model: 'claude-opus-4-6',
    max_tokens: 4096,
    messages: [
      {
        role: 'system',
        content: 'You are Pochi, a highly skilled software engineer with extensive knowledge in many programming languages, frameworks, design patterns, and best practices.\n' +
          '\n' +
          'IMPORTANT: You must NEVER generate or guess URLs for the user unless you are confident that the URLs are for helping the user with programming. You may use URLs provided by the user in their messages or local files.\n' +
          '\n' +
          'If the user asks for help or wants to give feedback inform them of the following:\n' +
          '- Join the discord channel at https://getpochi.com/discord to ask questions and get help\n' +
          '- To report bugs, users should report the issue at https://github.com/TabbyML/pochi/issues\n' +
          '\n' +
          "When the user directly asks about Pochi (eg 'can Pochi do...', 'does Pochi have...') or asks in second person (eg 'are you able...', 'can you do...'), first use curl to gather information to answer the question from Pochi docs at https://docs.getpochi.com/llms.txt\n" +
          '\n' +
          '====\n' +
          '\n' +
          'TASK MANAGEMENT\n' +
          '\n' +
          'You have access to the todoWrite tool to help you manage and plan tasks. Use these tools VERY frequently to ensure that you are tracking your tasks and giving the user visibility into your progress.\n' +
          'These tools are also EXTREMELY helpful for planning tasks, and for breaking down larger complex tasks into smaller steps. If you do not use this tool when planning, you may forget to do important tasks - and that is unacceptable.\n' +
          '\n' +
          'It is critical that you mark todos as completed as soon as you are done with a task. Do not batch up multiple tasks before marking them as completed.\n' +
          '\n' +
          '====\n' +
          '\n' +
          'RULES\n' +
          '\n' +
          "- User messages may include <system-reminder> tags. <system-reminder> tags contain useful information and reminders. They are NOT part of the user's provided input or the tool result. You shall pay close attention to information in these tags and use it to inform you actions.\n" +
          "- When the user initially gives you a task, a recursive list of all filepaths in the current working directory will be included in <system-reminder> tag. This provides an overview of the project's file structure, offering key insights into the project from directory/file names (how developers conceptualize and organize their code) and file extensions (the language used). This can also guide decision-making on which files to explore further. If you need to further explore directories such as outside the current working directory, you can use the listFiles tool. If you pass 'true' for the recursive parameter, it will list files recursively.\n" +
          '- All file paths used by tools must be relative to current working directory, do not use the ~ character or $HOME to refer to the home directory in file paths used by tools.\n' +
          "- You can use `pochi://` URI schema to access the Pochi virtual file system. This allows you to read and write files that are stored in Pochi's internal storage.\n" +
          "- Be sure to consider the type of project (e.g. Python, JavaScript, web application) when determining the appropriate structure and files to include. Also consider what files may be most relevant to accomplishing the task, for example looking at a project's manifest file would help you understand the project's dependencies, which you could incorporate into any code you write.\n" +
          "- Do not ask for more information than necessary. Use the tools provided to accomplish the user's request efficiently and effectively. When you've completed your task, you must use the attemptCompletion tool to present the result to the user. The user may provide feedback, which you can use to make improvements and try again.\n" +
          '- You are only allowed to ask the user questions using the askFollowupQuestion tool. Use this tool only when you need additional details to complete a task, and be sure to use a clear and concise question that will help you move forward with the task. However if you can use the available tools to avoid having to ask the user questions, you should do so. For example, if the user mentions a file that may be in an outside directory like the Desktop, you should use the listFiles tool to list the files in the Desktop and check if the file they are talking about is there, rather than asking the user to provide the file path themselves.\n' +
          `- You are STRICTLY FORBIDDEN from starting your messages with "Great", "Certainly", "Okay", "Sure". You should NOT be conversational in your responses, but rather direct and to the point. For example you should NOT say "Great, I've updated the CSS" but instead something like "I've updated the CSS". It is important you be clear and technical in your messages.\n` +
          "- Once you've completed the user's task, you MUST use the attemptCompletion tool to present the result of the task to the user. It is STRICTLY FORBIDDEN to complete the task without using this tool.\n" +
          '- When planning large-scale changes, create a high-level diagram using mermaid in Markdown. This helps explain your plan and allows you to gather user feedback before implementation.'
      },
      {
        role: 'user',
        content: [
          {
            type: 'text',
            text: '<system-reminder># System Information\n' +
              '\n' +
              'Operating System: linux\n' +
              'Default Shell: \n' +
              'Home Directory: /root\n' +
              'Current Working Directory: /root\n' +
              'Current Time: Thu Mar 19 2026 09:17:12 GMT+0000 (Coordinated Universal Time)\n' +
              '\n' +
              '# User Information\n' +
              '- Name: Test User\n' +
              '- Email: test@example.com\n' +
              '\n' +
              '# Current Working Directory (/root) Files\n' +
              '.bashrc\n' +
              '.profile\n' +
              '.daytona\n' +
              '.pochi\n' +
              '.gitconfig\n' +
              '.daytona/sessions\n' +
              '.pochi/config.jsonc\n' +
              '.daytona/sessions/a3777110-8132-47af-b51b-5923306e85aa\n' +
              '.daytona/sessions/693f5c50-112b-4d7e-b770-9650df4dec45\n' +
              '.daytona/sessions/380662f8-8805-47f4-91d4-31c76feba356\n' +
              '.daytona/sessions/9fa6e4a8-0a92-4a65-ac29-ae9e066c28a4\n' +
              '.daytona/sessions/a3777110-8132-47af-b51b-5923306e85aa/b4ba62f8-aee3-4106-9aef-66f6c5df79f2\n' +
              '.daytona/sessions/693f5c50-112b-4d7e-b770-9650df4dec45/ebb5ee05-6f54-4f88-9e78-089e3dc49fda\n' +
              '.daytona/sessions/380662f8-8805-47f4-91d4-31c76feba356/d6e3820d-c720-4dd4-b5a4-372b6a6f4077\n' +
              '.daytona/sessions/9fa6e4a8-0a92-4a65-ac29-ae9e066c28a4/4f04fe80-a746-46a5-b898-0d363239583c\n' +
              '.daytona/sessions/a3777110-8132-47af-b51b-5923306e85aa/b4ba62f8-aee3-4106-9aef-66f6c5df79f2/exit_code\n' +
              '.daytona/sessions/693f5c50-112b-4d7e-b770-9650df4dec45/ebb5ee05-6f54-4f88-9e78-089e3dc49fda/exit_code\n' +
              '.daytona/sessions/380662f8-8805-47f4-91d4-31c76feba356/d6e3820d-c720-4dd4-b5a4-372b6a6f4077/exit_code\n' +
              '\n' +
              '# GIT STATUS\n' +
              'Current branch: \n' +
              'Main branch (you will usually use this for PRs): \n' +
              '\n' +
              'Recent commits:\n' +
              '\n' +
              '\n' +
              '# TODOs\n' +
              'No TODOs yet, if you are working on tasks that would benefit from a todo list please use the todoWrite tool to create one.</system-reminder>'
          },
          {
            type: 'text',
            text: 'You are a developer migrating from Git to Jujutsu (jj). You have an existing local Git repository at `/home/user/my-project`. Your task is to start using jj with this repository without breaking Git compatibility.\\n\\n1. Navigate to `/home/user/my-project`.\\n2. Initialize a colocated jj repository so that jj and Git can be used together.\\n3. Create a new bookmark named `feature-x`.\\n4. Create a new file named `feature.txt` containing the text `Hello jj`.\\n5. Create a new jj commit (or describe the working copy) with the description `Add feature.txt`.\\n\\nWhen finished, the repository should be a valid colocated jj/Git repo, the `feature-x` bookmark should exist and be exported to Git, and the commit should have the specified description and file.'
          }
        ]
      },
      {
        role: 'assistant',
        content: '\n' +
          '\n' +
          "I'll work through this step-by-step, migrating the Git repository to use Jujutsu (jj) in colocated mode.",
        tool_calls: [
          {
            id: 'toolu_011rCkj2REAg3R87c4PHJkcQ',
            type: 'function',
            function: {
              name: 'todoWrite',
              arguments: `{"todos":[{"id":"check-repo","content":"Check if /home/user/my-project exists and has a Git repo","status":"in-progress","priority":"high"},{"id":"init-jj","content":"Initialize colocated jj repository","status":"pending","priority":"high"},{"id":"create-bookmark","content":"Create feature-x bookmark","status":"pending","priority":"high"},{"id":"create-file","content":"Create feature.txt with 'Hello jj'","status":"pending","priority":"high"},{"id":"describe-commit","content":"Describe/create commit with 'Add feature.txt'","status":"pending","priority":"high"},{"id":"verify","content":"Verify colocated repo, bookmark, and commit","status":"pending","priority":"high"}]}`
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_011rCkj2REAg3R87c4PHJkcQ',
        content: '{"success":true}'
      },
      {
        role: 'assistant',
        content: '',
        tool_calls: [
          {
            id: 'toolu_0174ARF4pbW41KSU4HQtRVw4',
            type: 'function',
            function: {
              name: 'executeCommand',
              arguments: '{"command":"ls -la /home/user/my-project 2>/dev/null; echo \\"---\\"; ls -la /home/user/my-project/.git 2>/dev/null"}'
            }
          },
          {
            id: 'toolu_01FmkuNLXYsjxvTsBfVmHFba',
            type: 'function',
            function: {
              name: 'executeCommand',
              arguments: '{"command":"which jj && jj --version"}'
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_0174ARF4pbW41KSU4HQtRVw4',
        content: '{"output":"total 8\\r\\ndrwxr-xr-x 3 root root   47 Mar 11 12:10 .\\r\\ndrwxr-xr-x 1 root root   32 Mar 11 12:10 ..\\r\\ndrwxr-xr-x 8 root root 4096 Mar 11 12:10 .git\\r\\n-rw-r--r-- 1 root root   15 Mar 11 12:10 README.md\\r\\n---\\r\\ntotal 28\\r\\ndrwxr-xr-x 8 root root 4096 Mar 11 12:10 .\\r\\ndrwxr-xr-x 3 root root   47 Mar 11 12:10 ..\\r\\n-rw-r--r-- 1 root root   15 Mar 11 12:10 COMMIT_EDITMSG\\r\\n-rw-r--r-- 1 root root   21 Mar 11 12:10 HEAD\\r\\ndrwxr-xr-x 2 root root    6 Mar 11 12:10 branches\\r\\n-rw-r--r-- 1 root root   92 Mar 11 12:10 config\\r\\n-rw-r--r-- 1 root root   73 Mar 11 12:10 description\\r\\ndrwxr-xr-x 2 root root 4096 Mar 11 12:10 hooks\\r\\n-rw-r--r-- 1 root root  137 Mar 11 12:10 index\\r\\ndrwxr-xr-x 2 root root   29 Mar 11 12:10 info\\r\\ndrwxr-xr-x 3 root root   30 Mar 11 12:10 logs\\r\\ndrwxr-xr-x 7 root root   84 Mar 11 12:10 objects\\r\\ndrwxr-xr-x 4 root root   43 Mar 11 12:10 refs\\r\\n","isTruncated":false}'
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_01FmkuNLXYsjxvTsBfVmHFba',
        content: '{"output":"/usr/local/bin/jj\\r\\njj 0.38.0-2508982cde5c7e4db0933e0b6469f9e778e71e28\\r\\n","isTruncated":false}'
      },
      {
        role: 'assistant',
        content: 'The Git repository exists at `/home/user/my-project` with a `README.md` file, and `jj` v0.38.0 is installed.',
        tool_calls: [
          {
            id: 'toolu_01ULas2uw3TnyRPAHN6aUhhT',
            type: 'function',
            function: {
              name: 'todoWrite',
              arguments: `{"todos":[{"id":"check-repo","content":"Check if /home/user/my-project exists and has a Git repo","status":"completed","priority":"high"},{"id":"init-jj","content":"Initialize colocated jj repository","status":"in-progress","priority":"high"},{"id":"create-bookmark","content":"Create feature-x bookmark","status":"pending","priority":"high"},{"id":"create-file","content":"Create feature.txt with 'Hello jj'","status":"pending","priority":"high"},{"id":"describe-commit","content":"Describe/create commit with 'Add feature.txt'","status":"pending","priority":"high"},{"id":"verify","content":"Verify colocated repo, bookmark, and commit","status":"pending","priority":"high"}]}`
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_01ULas2uw3TnyRPAHN6aUhhT',
        content: '{"success":true}'
      },
      {
        role: 'assistant',
        content: '**Step 1 & 2: Initialize a colocated jj repository.** The `--colocate` flag (or running `jj git init --colocate` inside an existing Git repo) sets up jj to share the `.git` directory, so both tools work together.',
        tool_calls: [
          {
            id: 'toolu_019jY8xFeB1m7PfbXfapjtni',
            type: 'function',
            function: {
              name: 'executeCommand',
              arguments: '{"command":"cd /home/user/my-project && jj git init --colocate"}'
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_019jY8xFeB1m7PfbXfapjtni',
        content: '{"output":"Done importing changes from the underlying Git repo.\\r\\nInitialized repo in \\".\\"\\r\\nHint: Running `git clean -xdf` will remove `.jj/`!\\r\\n","isTruncated":false}'
      },
      {
        role: 'assistant',
        content: 'Colocated jj repository initialized. Let me verify the `.jj` directory was created alongside `.git`:',
        tool_calls: [
          {
            id: 'toolu_017U73gxk7EtcnybfQfMwDDW',
            type: 'function',
            function: {
              name: 'executeCommand',
              arguments: '{"command":"ls -la /home/user/my-project/ | head -20"}'
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_017U73gxk7EtcnybfQfMwDDW',
        content: '{"output":"total 4\\r\\ndrwxr-xr-x 1 root root 41 Mar 19 09:17 .\\r\\ndrwxr-xr-x 1 root root 32 Mar 11 12:10 ..\\r\\ndrwxr-xr-x 1 root root 45 Mar 11 12:10 .git\\r\\ndrwxr-xr-x 4 root root 72 Mar 19 09:17 .jj\\r\\n-rw-r--r-- 1 root root 15 Mar 11 12:10 README.md\\r\\n","isTruncated":false}'
      },
      {
        role: 'assistant',
        content: 'Both `.git` and `.jj` directories exist — the repo is colocated.',
        tool_calls: [
          {
            id: 'toolu_01RbFKbcqvYrAPXMhdewxZNQ',
            type: 'function',
            function: {
              name: 'todoWrite',
              arguments: `{"todos":[{"id":"check-repo","content":"Check if /home/user/my-project exists and has a Git repo","status":"completed","priority":"high"},{"id":"init-jj","content":"Initialize colocated jj repository","status":"completed","priority":"high"},{"id":"create-bookmark","content":"Create feature-x bookmark","status":"in-progress","priority":"high"},{"id":"create-file","content":"Create feature.txt with 'Hello jj'","status":"pending","priority":"high"},{"id":"describe-commit","content":"Describe/create commit with 'Add feature.txt'","status":"pending","priority":"high"},{"id":"verify","content":"Verify colocated repo, bookmark, and commit","status":"pending","priority":"high"}]}`
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_01RbFKbcqvYrAPXMhdewxZNQ',
        content: '{"success":true}'
      },
      {
        role: 'assistant',
        content: '**Step 3: Create the `feature-x` bookmark.** Let me first check the current jj log to understand the state:',
        tool_calls: [
          {
            id: 'toolu_0194HmfhNtUVQ4zP16p2MXym',
            type: 'function',
            function: {
              name: 'executeCommand',
              arguments: '{"command":"cd /home/user/my-project && jj log"}'
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_0194HmfhNtUVQ4zP16p2MXym',
        content: '{"output":"@  uyntpwtv (no email set) 2026-03-19 09:17:41 5d317252\\r\\n│  (empty) (no description set)\\r\\nā—‹  ypsoummp test@example.com 2026-03-11 12:10:51 main 14d944a2\\r\\n│  Initial commit\\r\\nā—†  zzzzzzzz root() 00000000\\r\\n","isTruncated":false}'
      },
      {
        role: 'assistant',
        content: "The working copy change (`@`) is on top of the `main` branch. Now I'll create the `feature-x` bookmark pointing to the current working copy change:",
        tool_calls: [
          {
            id: 'toolu_01Bqso2WjCh52bGNmUGaHTFv',
            type: 'function',
            function: {
              name: 'executeCommand',
              arguments: '{"command":"cd /home/user/my-project && jj bookmark create feature-x -r @"}'
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_01Bqso2WjCh52bGNmUGaHTFv',
        content: `{"output":"Warning: Target revision is empty.\\r\\nCreated 1 bookmarks pointing to uyntpwtv 5d317252 feature-x | (empty) (no description set)\\r\\nWarning: Name and email not configured. Until configured, your commits will be created with the empty identity, and can't be pushed to remotes.\\r\\nHint: To configure, run:\\r\\n  jj config set --user user.name \\"Some One\\"\\r\\n  jj config set --user user.email \\"someone@example.com\\"\\r\\n","isTruncated":false}`
      },
      {
        role: 'assistant',
        content: '',
        tool_calls: [
          {
            id: 'toolu_01L3ZYAHCdqTVwMNgE1PPERS',
            type: 'function',
            function: {
              name: 'todoWrite',
              arguments: `{"todos":[{"id":"check-repo","content":"Check if /home/user/my-project exists and has a Git repo","status":"completed","priority":"high"},{"id":"init-jj","content":"Initialize colocated jj repository","status":"completed","priority":"high"},{"id":"create-bookmark","content":"Create feature-x bookmark","status":"completed","priority":"high"},{"id":"create-file","content":"Create feature.txt with 'Hello jj'","status":"in-progress","priority":"high"},{"id":"describe-commit","content":"Describe/create commit with 'Add feature.txt'","status":"pending","priority":"high"},{"id":"verify","content":"Verify colocated repo, bookmark, and commit","status":"pending","priority":"high"}]}`
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_01L3ZYAHCdqTVwMNgE1PPERS',
        content: '{"success":true}'
      }
    ],
    tools: [
      {
        type: 'function',
        function: {
          name: 'applyDiff',
          description: "This is a tool for editing files. For moving or renaming files, you should generally use the executeCommand tool with the 'mv' command instead. For larger edits, use the writeFile tool to overwrite files.\n" +
            '\n' +
            "Before using this tool, use the readFile tool to understand the file's contents and context\n" +
            '\n' +
            'To make a file edit, provide the following:\n' +
            '1. path: The path to the file to modify (relative to the current working directory, or an absolute path)\n' +
            '2. searchContent: The text to replace (must match the file contents exactly, including all whitespace and indentation)\n' +
            '3. replaceContent: The edited text to replace the searchContent (must be different from searchContent)\n' +
            '4. expectedReplacements: The number of replacements you expect to make. Defaults to 1 if not specified.\n' +
            '\n' +
            'By default, the tool will replace ONE occurrence of searchContent with replaceContent in the specified file. If you want to replace multiple occurrences, provide the expectedReplacements parameter with the exact number of occurrences you expect.\n' +
            '\n' +
            'CRITICAL REQUIREMENTS FOR USING THIS TOOL:\n' +
            '\n' +
            '1. UNIQUENESS (when expectedReplacements is not specified): The searchContent MUST uniquely identify the specific instance you want to change. This means:\n' +
            '   - Include AT LEAST 3-5 lines of context BEFORE the change point\n' +
            '   - Include AT LEAST 3-5 lines of context AFTER the change point\n' +
            '   - Include all whitespace, indentation, and surrounding code exactly as it appears in the file\n' +
            '\n' +
            '2. EXPECTED MATCHES: If you want to replace multiple instances:\n' +
            '   - Use the expectedReplacements parameter with the exact number of occurrences you expect to replace\n' +
            '   - This will replace ALL occurrences of the searchContent with the replaceContent\n' +
            "   - If the actual number of matches doesn't equal expectedReplacements, the edit will fail\n" +
            '   - This is a safety feature to prevent unintended replacements\n' +
            '\n' +
            '3. VERIFICATION: Before using this tool:\n' +
            '   - Check how many instances of the target text exist in the file\n' +
            '   - If multiple instances exist, either:\n' +
            '     a) Gather enough context to uniquely identify each one and make separate calls, OR\n' +
            '     b) Use expectedReplacements parameter with the exact count of instances you expect to replace\n' +
            '\n' +
            'WARNING:\n' +
            "- The tool will fail if searchContent matches multiple locations and expectedReplacements isn't specified\n" +
            "- The tool will fail if the number of matches doesn't equal expectedReplacements when it's specified\n" +
            "- The tool will fail if searchContent doesn't match the file contents exactly (including whitespace)\n" +
            '- The tool will fail if searchContent and replaceContent are the same\n' +
            '\n' +
            'When making edits:\n' +
            '   - Ensure the edit results in idiomatic, correct code\n' +
            '   - Do not add trailing whitespace to lines (a newline at the end of a file is fine)\n' +
            '   - Do not leave the code in a broken state\n' +
            '\n' +
            'If you want to create a new file, use:\n' +
            '   - A new file path, including dir name if needed\n' +
            '   - An empty searchContent\n' +
            "   - The new file's contents as replaceContent\n" +
            '\n' +
            'Remember: when making multiple file edits in a row to the same file, you should prefer to send all edits in a single message with multiple calls to this tool, rather than multiple messages with a single call each.\n' +
            '\n' +
            'You may see the following fields in the result:\n' +
            '- autoFormattingEdits: If the auto-formatter makes any changes, this field will contain a diff against the file content after your edits and any user edits have been applied.\n' +
            '- newProblems: If any new problems are found after the edit, this field will contain information about them.',
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path of the file to modify (relative to the current working directory, or an absolute path).'
              },
              searchContent: {
                type: 'string',
                description: 'The text to replace.'
              },
              replaceContent: {
                type: 'string',
                description: 'The text to replace it with.'
              },
              expectedReplacements: {
                type: 'number',
                description: 'The expected number of replacements to perform. Defaults to 1 if not specified.'
              }
            },
            required: [
              'path',
              'searchContent',
              'replaceContent'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'askFollowupQuestion',
          description: 'Ask the user a question to gather additional information needed to complete the task. \n' +
            '\n' +
            '## When to Use This Tool\n' +
            'Use this tool in the following scenarios:\n' +
            "1. The user's request is ambiguous or unclear and requires clarification.\n" +
            '2. You need more details to proceed effectively.\n' +
            '3. You have made several unsuccessful attempts to solve the issue and need user guidance to move forward.\n' +
            '4. Offer choices to the user about what direction to take.\n' +
            '\n' +
            '## Usage Notes\n' +
            '- Users will always be able to select "Other" to provide custom text input\n' +
            '- Use multiSelect: true to allow multiple answers to be selected for a question\n' +
            '- If you recommend a specific option, make that the first option in the list and add "(Recommended)" at the end of the label\n' +
            '- Provide 1-4 questions per call\n' +
            '\n' +
            'IMPORTANT: This tool CANNOT be used in combination with other tools (except todoWrite) in a single step. If you need to use other tools, you must do so in a separate step before calling this tool.',
          parameters: {
            type: 'object',
            properties: {
              questions: {
                type: 'array',
                items: {
                  type: 'object',
                  properties: {
                    question: {
                      type: 'string',
                      description: 'The complete question to ask the user. Should be clear, specific, and end with a question mark.'
                    },
                    header: {
                      type: 'string',
                      maxLength: 12,
                      description: 'Very short label displayed as a chip/tag (max 12 chars). Examples: "Auth method", "Library", "Approach".'
                    },
                    options: {
                      type: 'array',
                      items: {
                        type: 'object',
                        properties: {
                          label: {
                            type: 'string',
                            description: 'Short button label shown to the user. Should be concise (1-5 words) and clearly describe the choice.'
                          },
                          description: {
                            type: 'string',
                            description: 'Explanation of what this option means or what will happen if chosen. Useful for providing context about trade-offs or implications.'
                          }
                        },
                        required: [
                          'label'
                        ],
                        additionalProperties: false
                      },
                      minItems: 2,
                      maxItems: 4,
                      description: "The available choices for this question. Must have 2-4 options. Each option should be a distinct, mutually exclusive choice (unless multiSelect is enabled). There should be no 'Other' option, that will be provided automatically."
                    },
                    multiSelect: {
                      type: 'boolean',
                      default: false,
                      description: 'Set to true to allow the user to select multiple options instead of just one. Use when choices are not mutually exclusive.'
                    }
                  },
                  required: [
                    'question',
                    'header',
                    'options'
                  ],
                  additionalProperties: false
                },
                minItems: 1,
                maxItems: 4,
                description: 'Questions to ask the user (1-4 questions).'
              }
            },
            required: [
              'questions'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'attemptCompletion',
          description: "Once you've received the results of tool uses and can confirm that the task is complete, use this tool to present the result of your work to the user.\n" +
            '\n' +
            'You MUST NOT generate any text before this tool call. All conclusion text must be included within the result parameter of the attemptCompletion tool.\n' +
            'Never use this tool with a question or request to engage in further conversation! Formulate the end of your result in a way that is final and does not require further input from the user.\n' +
            '\n' +
            'IMPORTANT: This tool CANNOT be used in combination with other tools (except todoWrite) in a single step. If you need to use other tools, you must do so in a separate step before calling this tool.',
          parameters: {
            '$schema': 'http://json-schema.org/draft-07/schema#',
            type: 'object',
            properties: {
              result: {
                description: 'The result of the task. Formulate this result in a way that is final and does not require further input from the user.',
                type: 'string'
              }
            },
            required: [
              'result'
            ],
            additionalProperties: false
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'executeCommand',
          description: 'Executes a given bash command in a persistent shell session with optional timeout, ensuring proper handling and security measures.\n' +
            '\n' +
            'IMPORTANT: This tool is for terminal operations like git, npm, docker, etc. DO NOT use it for file operations (reading, writing, editing, searching, finding files) - use the specialized tools for this instead.\n' +
            '\n' +
            'Before executing the command, please follow these steps:\n' +
            '\n' +
            '1. Directory Verification:\n' +
            '   - If the command will create new directories or files, first use listFiles to verify the parent directory exists and is the correct location\n' +
            '   - For example, before running "mkdir foo/bar", first use listFiles to check that "foo" exists and is the intended parent directory\n' +
            '\n' +
            '2. Command Execution:\n' +
            '   - Always quote file paths that contain spaces with double quotes (e.g., cd "path with spaces/file.txt")\n' +
            '   - Examples of proper quoting:\n' +
            '     - cd "/Users/name/My Documents" (correct)\n' +
            '     - cd /Users/name/My Documents (incorrect - will fail)\n' +
            '     - python "/path/with spaces/script.py" (correct)\n' +
            '     - python /path/with spaces/script.py (incorrect - will fail)\n' +
            '   - After ensuring proper quoting, execute the command.\n' +
            '   - Capture the output of the command.\n' +
            '\n' +
            'Usage notes:\n' +
            '- The command argument is required.\n' +
            '- You can specify an optional timeout in seconds (up to 300s / 5 minutes). If not specified, commands will timeout after 60s (1 minute).\n' +
            '- If the output exceeds 30000 characters, output will be truncated before being returned to you.\n' +
            '- When issuing multiple commands:\n' +
            '  - If the commands are independent and can run in parallel, make multiple executeCommand tool calls in a single message. For example, if you need to run "git status" and "git diff", send a single message with two executeCommand tool calls in parallel.\n' +
            '  - If the commands depend on each other and must run sequentially, use a single executeCommand call with \'&&\' to chain them together (e.g., `git add . && git commit -m "message" && git push`). For instance, if one operation must complete before another starts (like mkdir before cp, Write before executeCommand for git operations, or git add before git commit), run these operations sequentially instead.\n' +
            "  - Use ';' only when you need to run commands sequentially but don't care if earlier commands fail\n" +
            '  - DO NOT use newlines to separate commands (newlines are ok in quoted strings)\n' +
            "- You shall avoid use the markdown code block syntax (backtick, '`') in your command, as it will be interpreted as a command substitution.\n" +
            "- Before using this tool, you must first think about the context provided in <system-reminder> to understand the user's environment and tailor your commands to ensure they are compatible with their system. You must also consider if the command you need to run should be executed in a specific directory rather than the current working directory, and properly set the `cwd` if necessary.\n" +
            '\n' +
            '# Committing changes with git\n' +
            '\n' +
            'Only create commits when requested by the user. If unclear, ask first. When the user asks you to create a new git commit, follow these steps carefully:\n' +
            '\n' +
            'Git Safety Protocol:\n' +
            '- NEVER update the git config\n' +
            "- NEVER run destructive git commands (push --force, reset --hard, checkout ., restore ., clean -f, branch -D) unless the user explicitly requests these actions. Taking unauthorized destructive actions is unhelpful and can result in lost work, so it's best to ONLY run these commands when given direct instructions \n" +
            '- NEVER skip hooks (--no-verify, --no-gpg-sign, etc) unless the user explicitly requests it\n' +
            '- NEVER run force push to main/master, warn the user if they request it\n' +
            '- CRITICAL: Always create NEW commits rather than amending, unless the user explicitly requests a git amend. When a pre-commit hook fails, the commit did NOT happen  — so --amend would modify the PREVIOUS commit, which may result in destroying work or losing previous changes. Instead, after hook failure, fix the issue, re-stage, and create a NEW commit\n' +
            '- When staging files, prefer adding specific files by name rather than using "git add -A" or "git add .", which can accidentally include sensitive files (.env, credentials) or large binaries\n' +
            '- NEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked, otherwise the user will feel that you are being too proactive\n' +
            '\n' +
            '1. You can call multiple tools in a single response. When multiple independent pieces of information are requested and all commands are likely to succeed, run multiple tool calls in parallel for optimal performance. run the following bash commands in parallel, each using the executeCommand tool:\n' +
            '  - Run a git status command to see all untracked files. IMPORTANT: Never use the -uall flag as it can cause memory issues on large repos.\n' +
            '  - Run a git diff command to see both staged and unstaged changes that will be committed.\n' +
            "  - Run a git log command to see recent commit messages, so that you can follow this repository's commit message style.\n" +
            '2. Analyze all staged changes (both previously staged and newly added) and draft a commit message:\n' +
            '  - Summarize the nature of the changes (eg. new feature, enhancement to an existing feature, bug fix, refactoring, test, docs, etc.). Ensure the message accurately reflects the changes and their purpose (i.e. "add" means a wholly new feature, "update" means an enhancement to an existing feature, "fix" means a bug fix, etc.).\n' +
            '  - Do not commit files that likely contain secrets (.env, credentials.json, etc). Warn the user if they specifically request to commit those files\n' +
            '  - Draft a concise (1-2 sentences) commit message that focuses on the "why" rather than the "what"\n' +
            '  - Ensure it accurately reflects the changes and their purpose\n' +
            '3. You can call multiple tools in a single response. When multiple independent pieces of information are requested and all commands are likely to succeed, run multiple tool calls in parallel for optimal performance. run the following commands:\n' +
            '   - Add relevant untracked files to the staging area.\n' +
            '   - Create the commit with a message ending with:\n' +
            '   šŸ¤– Generated with [Pochi](https://getpochi.com) | [Task](<Share URL>)\n' +
            '\n' +
            '   Co-Authored-By: Pochi <noreply@getpochi.com>\n' +
            '\n' +
            '   Note: Replace <Share URL> with the Share URL from system information if available. If not available, omit the " | [Task](...)" part.\n' +
            '\n' +
            '   - Run git status after the commit completes to verify success.\n' +
            '   Note: git status depends on the commit completing, so run it sequentially after the commit.\n' +
            '4. If the commit fails due to pre-commit hook changes, retry the commit ONCE to include these automated changes. If it fails again, it usually means a pre-commit hook is preventing the commit. If the commit succeeds but you notice that files were modified by the pre-commit hook, you MUST amend your commit to include them.\n' +
            '\n' +
            'Important notes:\n' +
            '- NEVER update the git config\n' +
            '- NEVER run additional commands to read or explore code, besides git bash commands\n' +
            '- DO NOT push to the remote repository unless the user explicitly asks you to do so\n' +
            '- IMPORTANT: Never use git commands with the -i flag (like git rebase -i or git add -i) since they require interactive input which is not supported.\n' +
            '- IMPORTANT: Do not use --no-edit with git rebase commands, as the --no-edit flag is not a valid option for git rebase.\n' +
            '- If there are no changes to commit (i.e., no untracked files and no modifications), do not create an empty commit\n' +
            '- In order to ensure good formatting, ALWAYS pass the commit message via a HEREDOC, a la this example:\n' +
            '<example>\n' +
            `git commit -m "$(cat <<'EOF'\n` +
            'Commit message here.\n' +
            '\n' +
            'šŸ¤– Generated with [Pochi](https://getpochi.com) | [Task](<Share URL>)\n' +
            '\n' +
            'Co-Authored-By: Pochi <noreply@getpochi.com>\n' +
            'EOF\n' +
            ')"\n' +
            '</example>\n' +
            '\n' +
            '# Creating pull requests\n' +
            'Use the gh command via the executeCommand tool for ALL GitHub-related tasks including working with issues, pull requests, checks, and releases. If given a Github URL use the gh command to get the information needed.\n' +
            '\n' +
            'IMPORTANT: When the user asks you to create a pull request, follow these steps carefully:\n' +
            '\n' +
            '1. You can call multiple tools in a single response. When multiple independent pieces of information are requested and all commands are likely to succeed, run multiple tool calls in parallel for optimal performance. run the following bash commands in parallel using the executeCommand tool, in order to understand the current state of the branch since it diverged from the main branch:\n' +
            '   - Run a git status command to see all untracked files (never use -uall flag)\n' +
            '   - Run a git diff command to see both staged and unstaged changes that will be committed\n' +
            '   - Check if the current branch tracks a remote branch and is up to date with the remote, so you know if you need to push to the remote\n' +
            '   - Run a git log command and `git diff [base-branch]...HEAD` to understand the full commit history for the current branch (from the time it diverged from the base branch)\n' +
            '2. Analyze all changes that will be included in the pull request, making sure to look at all relevant commits (NOT just the latest commit, but ALL commits that will be included in the pull request!!!), and draft a pull request title and summary:\n' +
            '   - Keep the PR title short (under 70 characters)\n' +
            '   - Use the description/body for details, not the title\n' +
            '3. You can call multiple tools in a single response. When multiple independent pieces of information are requested and all commands are likely to succeed, run multiple tool calls in parallel for optimal performance. run the following commands in parallel:\n' +
            '   - Create new branch if needed\n' +
            '   - Push to remote with -u flag if needed\n' +
            '   - Create PR using gh pr create with the format below. Use a HEREDOC to pass the body to ensure correct formatting.\n' +
            '<example>\n' +
            `gh pr create --title "the pr title" --body "$(cat <<'EOF'\n` +
            '## Summary\n' +
            '<1-3 bullet points>\n' +
            '\n' +
            '## Test plan\n' +
            '[Checklist of TODOs for testing the pull request...]\n' +
            '\n' +
            'šŸ¤– Generated with [Pochi](https://getpochi.com) | [Task](<Share URL>)\n' +
            'EOF\n' +
            ')"\n' +
            '</example>\n' +
            '\n' +
            'Important:\n' +
            '- NEVER update the git confi'... 355 more characters,
          parameters: {
            type: 'object',
            properties: {
              command: {
                type: 'string',
                description: 'The CLI command to execute. This should be valid for the current operating system.'
              },
              cwd: {
                type: 'string',
                description: 'The working directory to execute the command in.'
              },
              timeout: {
                type: 'number',
                minimum: 1,
                maximum: 300,
                description: 'Optional timeout in seconds, max 300 seconds. By default the timeout is 120 seconds.'
              }
            },
            required: [
              'command'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'globFiles',
          description: 'Request to find files matching a glob pattern within a specified directory. Use this to get a list of files based on a pattern.',
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path of the directory to search in (relative to the current working directory, or an absolute path)'
              },
              globPattern: {
                type: 'string',
                description: "The glob pattern to match files against (e.g., '*.ts', '**/*.js')"
              }
            },
            required: [
              'path',
              'globPattern'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'listFiles',
          description: 'Request to list files and directories within the specified directory. If recursive is true, it will list all files and directories recursively. If recursive is false or not provided, it will only list the top-level contents. Do not use this tool to confirm the existence of files you may have created, as the user will let you know if the files were created successfully or not.',
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path of the directory to list contents for (relative to the current working directory, or an absolute path)'
              },
              recursive: {
                type: 'boolean',
                description: 'Whether to list files and directories recursively.'
              }
            },
            required: [
              'path'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'readFile',
          description: 'Request to read the contents of a file at the specified path. Use this when you need to examine the contents of an existing file you do not know the contents of, for example to analyze code, review text files, extract information from configuration files.\n' +
            '',
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path of the file to read (relative to the current working directory, or an absolute path)'
              },
              startLine: {
                type: 'number',
                description: 'The starting line number to read from (1-based). If not provided, it starts from the beginning of the file.'
              },
              endLine: {
                type: 'number',
                description: 'The ending line number to read to (1-based, inclusive). If not provided, it reads to the end of the file.'
              }
            },
            required: [
              'path'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'useSkill',
          description: 'Execute a skill within the main conversation\n' +
            '\n' +
            'When users ask you to perform tasks, check if any of the available skills below can help complete the task more effectively. Skills provide specialized capabilities and domain knowledge.\n' +
            '\n' +
            'When users ask about a SPECIFIC skill (e.g., "How does the pdf skill work?", "What does the commit skill do?"), you must call this tool to get detailed information about that skill.\n' +
            '\n' +
            'When users ask general questions like "What skills are available?" or "List all skills", simply refer to the "Available skills" section below - do NOT call this tool.\n' +
            '\n' +
            "This tool returns the skill's detailed instructions which you must then follow to complete the task. The instructions contain step-by-step guidance on how to perform the specific task or workflow.\n" +
            '\n' +
            'How to invoke:\n' +
            '- Use this tool with the skill name\n' +
            '- Example: `skill: "pdf-processing"` - invoke the pdf-processing skill\n' +
            "- The tool will return the skill's instructions\n" +
            '- Follow the returned instructions carefully to complete the task\n' +
            '\n' +
            'Important:\n' +
            '- When a skill is relevant for a task OR when users ask about a SPECIFIC skill, you must invoke this tool IMMEDIATELY as your first action\n' +
            '- For general questions about available skills, simply refer to the "Available skills" list below without calling this tool\n' +
            '- NEVER just announce or mention a skill in your text response without actually calling this tool (except for general skill listing requests)\n' +
            '- This is a BLOCKING REQUIREMENT: invoke the relevant Skill tool BEFORE generating any other response about a specific skill or task\n' +
            '- Only use skills listed in "Available skills" below\n' +
            '- Check compatibility requirements before using a skill - ensure the skill is compatible with the current OS/environment\n' +
            '- After calling this tool, follow the returned instructions step by step\n' +
            '- The skill file location is shown in the [Location: filepath] section of each skill listing below - use this information to understand where the skill is defined\n' +
            "- Use the directory containing the skill's source file as the base directory for resolving any resource files mentioned in the instructions\n" +
            '- Proactively explore the skill directory for optional resources that enhance task completion:\n' +
            '  * scripts/ - executable code that agents can run (Python, Bash, JavaScript, etc.)\n' +
            '  * references/ - on-demand documentation (REFERENCE.md, FORMS.md, domain-specific files)\n' +
            '  * assets/ - static resources (templates, images, data files, schemas)\n' +
            '  Use these resources when they exist and are relevant to the current task\n' +
            '\n' +
            'Available skills:\n' +
            '\n' +
            '- **find-skills**: Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill. [Location: _builtIn_]\n' +
            '- **create-skill**: Helps users create new custom agent skills. Use when the user wants to create a new skill, automate a workflow, or package specialized knowledge for reuse. [Location: _builtIn_]',
          parameters: {
            type: 'object',
            properties: {
              skill: {
                type: 'string',
                description: 'The name of the skill to use.'
              }
            },
            required: [
              'skill'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'searchFiles',
          description: '- Fast content search tool that works with any codebase size\n' +
            '- Searches file contents using regular expressions\n' +
            '- Supports Rust regex syntax (eg. "log.*Error", "functions+w+", etc.)\n' +
            '- Filter files by pattern with the include parameter (eg. "*.js", "*.{ts,tsx}")\n' +
            '- Returns file paths with at least one match sorted by modification time\n' +
            '- Use this tool when you need to find files containing specific patterns\n' +
            '- Craft your regex patterns carefully to balance specificity and flexibility.\n' +
            "- Based on the user's task you may use it to find code patterns, TODO comments, function definitions, or any text-based information across the project. The results include context, so analyze the surrounding code to better understand the matches. Leverage the this tool in combination with other tools for more comprehensive analysis. For example, use it to find specific code patterns, then use readFile to examine the full context of interesting matches before using applyDiff or writeToFile to make informed changes.",
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path of the directory to search in (relative to the current working directory, or an absolute path).'
              },
              regex: {
                type: 'string',
                description: 'The regular expression pattern to search for in file contents. Uses Rust regex syntax.'
              },
              filePattern: {
                type: 'string',
                description: 'File pattern to include in the search (e.g. "*.js", "*.{ts,tsx}"). If not provided, it will search all files.'
              }
            },
            required: [
              'path',
              'regex'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'todoWrite',
          description: 'Use this tool to create and manage a structured task list for your current coding session. This helps you track progress, organize complex tasks, and demonstrate thoroughness to the user.\n' +
            'It also helps the user understand the progress of the task and overall progress of their requests.\n' +
            '\n' +
            '## When to Use This Tool\n' +
            'Use this tool proactively in these scenarios:\n' +
            '\n' +
            '1. Complex multi-step tasks - When a task requires 3 or more distinct steps or actions\n' +
            '2. Non-trivial and complex tasks - Tasks that require careful planning or multiple operations\n' +
            '3. User explicitly requests todo list - When the user directly asks you to use the todo list\n' +
            '4. User provides multiple tasks - When users provide a list of things to be done (numbered or comma-separated)\n' +
            '5. After receiving new instructions - Immediately capture user requirements as todos. Feel free to edit the todo list based on new information.\n' +
            '6. After completing a task - Mark it complete and add any new follow-up tasks\n' +
            '7. When you start working on a new task, mark the todo as in-progress. Ideally you should only have one todo as in-progress at a time. Complete existing tasks before starting new ones.\n' +
            '\n' +
            '## When NOT to Use This Tool\n' +
            '\n' +
            'Skip using this tool when:\n' +
            '1. There is only a single, straightforward task\n' +
            '2. The task is trivial and tracking it provides no organizational benefit\n' +
            '3. The task can be completed in less than 3 trivial steps\n' +
            '4. The task is purely conversational or informational\n' +
            '\n' +
            'NOTE that you should use should not use this tool if there is only one trivial task to do. In this case you are better off just doing the task directly.\n' +
            '\n' +
            '## Examples of When to Use the Todo List\n' +
            '\n' +
            '<example>\n' +
            "User: I want to add a dark mode toggle to the application settings. Make sure you run the tests and build when you're done!\n" +
            "Assistant: I'll help add a dark mode toggle to your application settings. Let me create a todo list to track this implementation.\n" +
            '*Creates todo list with the following items:*\n' +
            '1. Create dark mode toggle component in Settings page\n' +
            '2. Add dark mode state management (context/store)\n' +
            '3. Implement CSS-in-JS styles for dark theme\n' +
            '4. Update existing components to support theme switching\n' +
            '5. Run tests and build process, addressing any failures or errors that occur\n' +
            '*Begins working on the first task*\n' +
            '\n' +
            '<reasoning>\n' +
            'The assistant used the todo list because:\n' +
            '1. Adding dark mode is a multi-step feature requiring UI, state management, and styling changes\n' +
            '2. The user explicitly requested tests and build be run afterward\n' +
            '3. The assistant inferred that tests and build need to pass by adding "Ensure tests and build succeed" as the final task\n' +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '<example>\n' +
            'User: Help me rename the function getCwd to getCurrentWorkingDirectory across my project\n' +
            "Assistant: Let me first search through your codebase to find all occurrences of 'getCwd'.\n" +
            '*Uses grep or search tools to locate all instances of getCwd in the codebase*\n' +
            "Assistant: I've found 15 instances of 'getCwd' across 8 different files. Let me create a todo list to track these changes.\n" +
            '*Creates todo list with specific items for each file that needs updating*\n' +
            '\n' +
            '<reasoning>\n' +
            'The assistant used the todo list because:\n' +
            '1. First, the assistant searched to understand the scope of the task\n' +
            '2. Upon finding multiple occurrences across different files, it determined this was a complex task with multiple steps\n' +
            '3. The todo list helps ensure every instance is tracked and updated systematically\n' +
            '4. This approach prevents missing any occurrences and maintains code consistency\n' +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '\n' +
            '<example>\n' +
            'User: I need to implement these features for my e-commerce site: user registration, product catalog, shopping cart, and checkout flow.\n' +
            "Assistant: I'll help implement these features. First, let's add all the features to the todo list.\n" +
            '*Creates a todo list breaking down each feature into specific tasks based on the project architecture*\n' +
            "Assistant: Let's start with user registration. This will involve creating database models, API endpoints, and frontend forms that integrate with your existing authentication system.\n" +
            '\n' +
            '<reasoning>\n' +
            'The assistant used the todo list because:\n' +
            '1. The user provided multiple complex features to implement in a comma separated list\n' +
            '2. The todo list helps organize these large features into manageable tasks\n' +
            '3. This approach allows for tracking progress across the entire implementation\n' +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '<example>\n' +
            "User: Can you help optimize my React application? It's rendering slowly and has performance issues.</user>\n" +
            "Assistant: I'll help optimize your React application. First, let me examine your codebase to identify potential performance bottlenecks.\n" +
            '*Reviews component structure, render patterns, state management, and data fetching*\n' +
            "Assistant: After analyzing your codebase, I've identified several performance issues. Let me create a todo list to track our optimization efforts.\n" +
            '*Creates todo list with items like: 1) Implement memoization for expensive calculations in ProductList, 2) Add virtualization for long lists in Dashboard, 3) Optimize image loading in Gallery component, 4) Fix state update loops in ShoppingCart, 5) Review bundle size and implement code splitting*\n' +
            "Let's start by implementing memoization for the expensive calculations in your ProductList component.</assistant>\n" +
            '\n' +
            '<reasoning>\n' +
            'The assistant used the todo list because:\n' +
            '1. First, the assistant examined the codebase to identify specific performance issues\n' +
            '2. Based on this analysis, it identified multiple optimization opportunities\n' +
            '3. Performance optimization is a non-trivial task requiring multiple steps\n' +
            '4. The todo list helps methodically track improvements across different components\n' +
            '5. This systematic approach ensures all performance bottlenecks are addressed\n' +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '## Examples of When NOT to Use the Todo List\n' +
            '\n' +
            '<example>\n' +
            "User: How do I print 'Hello World' in Python?\n" +
            'Assistant: In Python, you can print "Hello World" with this simple code:\n' +
            '\n' +
            'python\n' +
            'print("Hello World")\n' +
            '\n' +
            'This will output the text "Hello World" to the console when executed.</assistant>\n' +
            '\n' +
            '<reasoning>\n' +
            "The assistant did not use the todo list because this is a single, trivial task that can be completed in one step. There's no need to track multiple tasks or steps for such a straightforward request.\n" +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '<example>\n' +
            'User: What does the git status command do?\n' +
            "Assistant: The git status command shows the current state of your working directory and staging area. It displays which changes have been staged, which haven't, and which files aren't being tracked by Git. This is a fundamental command for understanding the current state of your repository before making commits.\n" +
            '\n' +
            '<reasoning>\n' +
            'The assistant did not use the todo list because this is an informational request with no actual coding task to complete. The user is simply asking for an explanation, not for the assistant to perform multiple steps or tasks.\n' +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '<example>\n' +
            'User: Can you add a comment to the calculateTotal function to explain what it does?\n' +
            'Assistant: Sure, let me add a comment to the calculateTotal function to explain what it does.\n' +
            '* Uses the Edit tool to add a comment to the calculateTotal function *\n' +
            '\n' +
            '<reasoning>\n' +
            "The assistant did not use the todo list because this is a single, straightforward task confined to one location in the code. Adding a comment doesn't require tracking multiple steps or systematic organization.\n" +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '<example>\n' +
            'User: Run npm install for me and tell me what happens.\n' +
            "Assistant: I'll run the npm install command for you.\n" +
            '\n' +
            '*Executes: npm install*\n' +
            '\n' +
            "The command completed successfully. Here's the output:\n" +
            '[Output of npm install command]\n' +
            '\n' +
            'All dependencies have been installed according to your package.json file.\n' +
            '\n' +
            '<reasoning>\n' +
            'The assistant did not use the todo list because this is a single command execution with immediate results. There are no multiple steps to track or organize, making the todo list unnecessary for this straightforward task.\n' +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '## Task States and Management\n' +
            '\n' +
            '1. **Task States**: Use these states to track progress:\n' +
            '   - pending: Task not yet started\n' +
            '   - in-progress: Currently working on (limit to ONE task at a time)\n' +
            '   - completed: Task finished successfully\n' +
            '   - cancelled: Task no longer needed\n' +
            '\n' +
            '2. **Task Management**:\n' +
            '   - Update task status in real-time as you work\n' +
            "   - Mark tasks complete IMMEDIATELY after finishing (don't batch completions)\n" +
            '   - Only have ONE task in-progress at any time\n' +
            '   - Complete current tasks before starting new ones\n' +
            '   - Cancel tasks that become irrelevant\n' +
            '\n' +
            '3. **Task Breakdown**:\n' +
            '   - Create specific, actionable items\n' +
            '   - Break complex tasks into smaller, manageable steps\n' +
            '   - Use clear, descriptive task names\n' +
            '\n' +
            'When in doubt, use this tool. Being proactive with task management demonstrates attentiveness and ensures you complete all requirements successfully.',
          parameters: {
            type: 'object',
            properties: {
              todos: {
                type: 'array',
                items: {
                  type: 'object',
                  properties: {
                    id: {
                      type: 'string',
                      description: 'The unique identifier of the task, e.g "collect-information".'
                    },
                    content: {
                      type: 'string',
                      description: 'The content of the task.'
                    },
                    status: {
                      type: 'string',
                      enum: [
                        'pending',
                        'in-progress',
                        'completed',
                        'cancelled'
                      ],
                      description: 'The status of the task.'
                    },
                    priority: {
                      type: 'string',
                      enum: [
                        'low',
                        'medium',
                        'high'
                      ],
                      description: 'The priority of the task.'
                    }
                  },
                  required: [
                    'id',
                    'content',
                    'status',
                    'priority'
                  ],
                  additionalProperties: false
                }
              }
            },
            required: [
              'todos'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'writeToFile',
          description: 'Request to write full content to a file at the specified path.\n' +
            'If the file exists, it will be overwritten with the provided content.\n' +
            "If the file doesn't exist, it will be created. This tool will automatically create any directories needed to write the file.\n" +
            '\n' +
            'You may see the following fields in the result:\n' +
            '- autoFormattingEdits: If the auto-formatter makes any changes, this field will contain a diff against the file content after your edits and any user edits have been applied.\n' +
            '- newProblems: If any new problems are found after the edit, this field will contain information about them.',
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path of the file to write to (relative to the current working directory, or an absolute path).'
              },
              content: {
                type: 'string',
                description: 'The content to write to the file.'
              }
            },
            required: [
              'path',
              'content'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'editNotebook',
          description: 'Edit a specific cell in a Jupyter notebook (.ipynb file) by its cell ID',
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path to the notebook file (relative to the current working directory, or an absolute path)'
              },
              cellId: {
                type: 'string',
                description: 'The ID of the cell to edit'
              },
              content: {
                type: 'string',
                description: 'The new content of the cell'
              }
            },
            required: [
              'path',
              'cellId',
              'content'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'newTask',
          description: 'Launch a new agent to handle complex, multi-step tasks autonomously.\n' +
            'When using the newTask tool, you may specify a agentType parameter to select which agent type to use.\n' +
            'Available agent types and the tools they have access to:\n' +
            '\n' +
            '### planner\n' +
            'Engage this agent to formulate comprehensive, technical implementation strategies for feature development, system refactoring, or defect resolution.\n' +
            'This agent is strictly limited to planning and architectural design; it DOES NOT execute code modifications.\n' +
            '\n' +
            'Examples of user requests this agent shall trigger:\n' +
            '- "create a plan to implement the user authentication feature"\n' +
            '- "how should we refactor the database schema"\n' +
            '- "design a solution for the memory leak issue"\n' +
            '\n' +
            '### browser\n' +
            'Web browser automation agent for navigating websites, interacting with pages, and extracting information. Uses agent-browser CLI for headless browser control.\n' +
            '\n' +
            '### reviewer\n' +
            'Engage this agent to perform code reviews and leave inline comments.\n' +
            'This agent can analyze code and create review comments on specific lines.\n' +
            '\n' +
            'Examples of user requests this agent shall trigger:\n' +
            '- "review the code in src/auth"\n' +
            '- "add review comments to this file"\n' +
            '- "check this code and leave feedback"\n' +
            '\n' +
            '### walkthrough\n' +
            'Engage this agent to create a summary of the changes made in the current task.\n' +
            'This agent is strictly limited to documentation and explanation; it DOES NOT execute code modifications.\n' +
            '\n' +
            'Examples of user requests this agent shall trigger:\n' +
            '- "summarize what we have done"\n' +
            '- "create a walkthrough for the changes"\n' +
            '- "explain the changes made in this task"\n' +
            '\n' +
            '### explore\n' +
            'Use this agent to explore the codebase when you need to: understand project structure, find where features are implemented, locate specific functions or classes, analyze code patterns, investigate how something works, search for examples or usage, or gather information before making changes.\n' +
            '\n' +
            'Examples of questions this agent shall trigger:\n' +
            '- "where is the authentication logic implemented"\n' +
            '- "find all usages of the config parser"\n' +
            '- "how does the ignore-walk module work"\n' +
            '\n' +
            '\n' +
            'Always include a reminder in your prompt to ensure the result will be submitted through the `attemptCompletion` tool.\n' +
            'If the task stops without submitting the result, it will return an error message.\n' +
            '\n' +
            'You can optionally run agents in the background using the runAsync parameter. You can continue working while background agents run.\n' +
            '\n' +
            'When NOT to use the newTask tool:\n' +
            '- If you want to read a specific file path, use the readFile or globFiles tool instead of the newTask tool, to find the match more quickly\n' +
            '- If you are searching for a specific class definition like "class Foo", use the globFiles tool instead, to find the match more quickly\n' +
            '- If you are searching for code within a specific file or set of 2-3 files, use the readFile tool instead of the newTask tool, to find the match more quickly\n' +
            '- Other tasks that are not related to the agent descriptions above\n' +
            '\n' +
            'Usage notes:\n' +
            '1. Launch multiple agents tools concurrently whenever possible to maximize performance; to do that, use a single message with multiple tool uses\n' +
            '2. When the agent is done, it will return a single message back to you. The result returned by the agent is not visible to the user. To show the user the result, you should send a text message back to the user with a concise summary of the result.\n' +
            '3. Each agent invocation is stateless. You will not be able to send additional messages to the agent, nor will the agent be able to communicate with you outside of its final report. Therefore, your prompt should contain a highly detailed task description for the agent to perform autonomously and you should specify exactly what information the agent should return back to you in its final and only message to you.\n' +
            "4. The agent's outputs should generally be trusted\n" +
            "5. Clearly tell the agent whether you expect it to write code or just to do research (search, file reads, web fetches, etc.), since it is not aware of the user's intent\n" +
            '6. If the agent description mentions that it should be used proactively, then you should try your best to use it without the user having to ask for it first. Use your judgement.',
          parameters: {
            type: 'object',
            properties: {
              description: {
                type: 'string',
                description: 'A short description of the task.'
              },
              prompt: {
                type: 'string',
                description: 'The detailed prompt for the task to be performed.'
              },
              agentType: {
                type: 'string',
                description: 'The type of the specialized agent to use for the task.'
              },
              runAsync: {
                type: 'boolean',
                description: 'Set to true to run this agent in the background.'
              }
            },
            required: [
              'description',
              'prompt'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'startBackgroundJob',
          description: 'Start a background job to execute a bash command, which allows you to continue working while the job runs.\n' +
            '\n' +
            'Before starting the background job, please follow these steps:\n' +
            '\n' +
            '1. Directory Verification:\n' +
            '   - If the command will create new directories or files, first use the listFiles tool to verify the parent directory exists and is the correct location\n' +
            '   - For example, before running "mkdir foo/bar", first use listFiles to check that "foo" exists and is the intended parent directory\n' +
            '\n' +
            '2. Job Execution:\n' +
            '   - After ensuring proper quoting, start the background job.\n' +
            '\n' +
            'Usage notes:\n' +
            '- The command argument is required.\n' +
            '- Use readBackgroundJobOutput to monitor the output and status of the job.\n' +
            '- Use killBackgroundJob to terminate the job if needed.\n' +
            '- If the output exceeds 30000 characters, output will be truncated before being returned to you.\n' +
            '\n' +
            'Common use cases and examples:\n' +
            '- Development servers: `npm run dev`, `yarn start`, `bun run dev`\n' +
            '- Build processes: `npm run build`, `make`, `cargo build`\n' +
            '- File watchers: `npm run watch`, `tsc --watch`\n' +
            '- Testing: `npm run test:watch`, `jest --watch`\n' +
            '- Database services: `docker run -p 5432:5432 postgres`\n' +
            '\n' +
            'Command execution rules:\n' +
            "- Never run 'sleep' as it will return immediately.\n" +
            "- You do not need to use '&' at the end of the command.\n" +
            "- When issuing multiple commands, use the ';' or '&&' operator to separate them. DO NOT use newlines (newlines are ok in quoted strings).\n" +
            "- You shall avoid use the markdown code block syntax (backtick, '`') in your command, as it will be interpreted as a command substitution.",
          parameters: {
            type: 'object',
            properties: {
              command: {
                type: 'string',
                description: 'The CLI command to execute. This should be valid for the current operating system.'
              },
              cwd: {
                type: 'string',
                description: 'The working directory to execute the command in.'
              }
            },
            required: [
              'command'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'readBackgroundJobOutput',
          description: '- Retrieves output from a running or completed background job or async task\n' +
            '- Takes a backgroundJobId parameter identifying the job or task\n' +
            '- For terminal jobs, returns only new output since the last check\n' +
            '- For task IDs, returns the latest attemptCompletion result once completed\n' +
            '- Returns stdout and stderr output along with job status\n' +
            '- Supports optional regex filtering to show only lines matching a pattern\n' +
            '- Use this tool when you need to monitor or check the output of a long-running background job',
          parameters: {
            type: 'object',
            properties: {
              backgroundJobId: {
                type: 'string',
                description: 'The ID of the background job to get output from'
              },
              regex: {
                type: 'string',
                description: 'Optional regular expression to filter the output lines. Only lines matching this regex will be included in the result. Any lines that do not match will no longer be available to read.'
              }
            },
            required: [
              'backgroundJobId'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'killBackgroundJob',
          description: '- Kills a running background job by its ID\n' +
            '- Takes a backgroundJobId parameter identifying the job to kill\n' +
            '- Returns a success or failure status\n' +
            '- Use this tool when you need to terminate a long-running background job',
          parameters: {
            type: 'object',
            properties: {
              backgroundJobId: {
                type: 'string',
                description: 'The ID of the background job to kill.'
              }
            },
            required: [
              'backgroundJobId'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'webFetch',
          description: '- Fetches content from a specified URL and converts HTML to markdown\n' +
            '- Use this tool when you need to retrieve and analyze web content\n' +
            '\n' +
            'Usage notes:\n' +
            '  - IMPORTANT: If an MCP-provided web fetch tool is available, prefer using that tool instead of this one, as it may have fewer restrictions.\n' +
            '  - The URL must be a fully-formed valid URL\n' +
            '  - The prompt should describe what information you want to extract from the page\n' +
            '  - This tool is read-only and does not modify any files\n' +
            '  - Includes a self-cleaning 10-minute cache for faster responses when repeatedly accessing the same URL',
          parameters: {
            '$schema': 'https://json-schema.org/draft/2020-12/schema',
            type: 'object',
            properties: {
              url: {
                type: 'string',
                format: 'uri'
              }
            },
            required: [
              'url'
            ],
            additionalProperties: false
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'webSearch',
          description: '- Allows Pochi to search the web and use the results to inform responses\n' +
            '- Provides up-to-date information for current events and recent data\n' +
            '- Returns search result information formatted as search result blocks, including links as markdown hyperlinks\n' +
            '- Searches are performed automatically within a single API call\n' +
            '\n' +
            'CRITICAL REQUIREMENT - You MUST follow this:\n' +
            `  - After answering the user's question, you MUST include a "Sources:" section at the end of your response\n` +
            '  - In the Sources section, list all relevant URLs from the search results as markdown hyperlinks: [Title](URL)\n' +
            '  - This is MANDATORY - never skip including sources in your response\n' +
            '  - Example format:\n' +
            '\n' +
            '    [Your answer here]\n' +
            '\n' +
            '    Sources:\n' +
            '    - [Source Title 1](https://example.com/1)\n' +
            '    - [Source Title 2](https://example.com/2)\n' +
            '\n' +
            'Usage notes:\n' +
            `  - Account for "Today's date" in <system-reminder>. For example, if <system-reminder> says "Today's date: 2025-07-01", and the user wants the latest docs, do not use 2024 in the search query. Use 2025.`,
          parameters: {
            '$schema': 'https://json-schema.org/draft/2020-12/schema',
            type: 'object',
            properties: {
              query: {
                description: 'The search query to perform',
                type: 'string'
              },
              country: {
                description: "Country code to filter search results by, e.g. 'US', 'GB', 'JP'",
                type: 'string'
              }
            },
            required: [
              'query'
            ],
            additionalProperties: false
          }
        }
      }
    ],
    tool_choice: 'auto',
    stream: true
  }
}
2026-03-19 09:18:47.393	DEBUG	/$bunfs/pochi:454339	listFiles	Listing workspace files from /root with maxItems 500
2026-03-19 09:18:47.571	ERROR	/$bunfs/pochi:432009	LiveChatKit	onError

 AI_APICallError  This request would exceed your organization's rate limit of 2,000,000 input tokens per minute (org: e70c8d22-9099-49c5-a9af-e059e6515b76, model: claude-opus-4-6). For details, refer to: https://docs.claude.com/en/api/rate-limits. You can see the response headers for current usage. Please reduce the prompt length or the maximum tokens requested, or try again later. You may also contact sales at https://claude.com/contact-sales to discuss your options for a rate limit increase., AI_APICallError, , https://api.anthropic.com/v1/chat/completions, [object Object], 429, [object Object], {"error":{"code":"rate_limit_error","message":"This request would exceed your organization's rate limit of 2,000,000 input tokens per minute (org: e70c8d22-9099-49c5-a9af-e059e6515b76, model: claude-opus-4-6). For details, refer to: https://docs.claude.com/en/api/rate-limits. You can see the response headers for current usage. Please reduce the prompt length or the maximum tokens requested, or try again later. You may also contact sales at https://claude.com/contact-sales to discuss your options for a rate limit increase.","type":"invalid_request_error","param":null}}, true, [object Object], 423231, 30, 423231, 30, /$bunfs/root/pochi
error stack:
  • pochi	<anonymous>
	/$bunfs/pochi:423231
  • pochi	async <anonymous>
	/$bunfs/pochi:423092
  • native	processTicksAndRejections
	native:7
2026-03-19 09:18:53.582	ERROR	/$bunfs/pochi:502749	TaskRunner	Task is failed, trying to resend last message to resume it. {
  kind: 'APICallError',
  isRetryable: true,
  message: "This request would exceed your organization's rate limit of 2,000,000 input tokens per minute (org: e70c8d22-9099-49c5-a9af-e059e6515b76, model: claude-opus-4-6). For details, refer to: https://docs.claude.com/en/api/rate-limits. You can see the response headers for current usage. Please reduce the prompt length or the maximum tokens requested, or try again later. You may also contact sales at https://claude.com/contact-sales to discuss your options for a rate limit increase.",
  requestBodyValues: {
    model: 'claude-opus-4-6',
    max_tokens: 4096,
    messages: [
      {
        role: 'system',
        content: 'You are Pochi, a highly skilled software engineer with extensive knowledge in many programming languages, frameworks, design patterns, and best practices.\n' +
          '\n' +
          'IMPORTANT: You must NEVER generate or guess URLs for the user unless you are confident that the URLs are for helping the user with programming. You may use URLs provided by the user in their messages or local files.\n' +
          '\n' +
          'If the user asks for help or wants to give feedback inform them of the following:\n' +
          '- Join the discord channel at https://getpochi.com/discord to ask questions and get help\n' +
          '- To report bugs, users should report the issue at https://github.com/TabbyML/pochi/issues\n' +
          '\n' +
          "When the user directly asks about Pochi (eg 'can Pochi do...', 'does Pochi have...') or asks in second person (eg 'are you able...', 'can you do...'), first use curl to gather information to answer the question from Pochi docs at https://docs.getpochi.com/llms.txt\n" +
          '\n' +
          '====\n' +
          '\n' +
          'TASK MANAGEMENT\n' +
          '\n' +
          'You have access to the todoWrite tool to help you manage and plan tasks. Use these tools VERY frequently to ensure that you are tracking your tasks and giving the user visibility into your progress.\n' +
          'These tools are also EXTREMELY helpful for planning tasks, and for breaking down larger complex tasks into smaller steps. If you do not use this tool when planning, you may forget to do important tasks - and that is unacceptable.\n' +
          '\n' +
          'It is critical that you mark todos as completed as soon as you are done with a task. Do not batch up multiple tasks before marking them as completed.\n' +
          '\n' +
          '====\n' +
          '\n' +
          'RULES\n' +
          '\n' +
          "- User messages may include <system-reminder> tags. <system-reminder> tags contain useful information and reminders. They are NOT part of the user's provided input or the tool result. You shall pay close attention to information in these tags and use it to inform you actions.\n" +
          "- When the user initially gives you a task, a recursive list of all filepaths in the current working directory will be included in <system-reminder> tag. This provides an overview of the project's file structure, offering key insights into the project from directory/file names (how developers conceptualize and organize their code) and file extensions (the language used). This can also guide decision-making on which files to explore further. If you need to further explore directories such as outside the current working directory, you can use the listFiles tool. If you pass 'true' for the recursive parameter, it will list files recursively.\n" +
          '- All file paths used by tools must be relative to current working directory, do not use the ~ character or $HOME to refer to the home directory in file paths used by tools.\n' +
          "- You can use `pochi://` URI schema to access the Pochi virtual file system. This allows you to read and write files that are stored in Pochi's internal storage.\n" +
          "- Be sure to consider the type of project (e.g. Python, JavaScript, web application) when determining the appropriate structure and files to include. Also consider what files may be most relevant to accomplishing the task, for example looking at a project's manifest file would help you understand the project's dependencies, which you could incorporate into any code you write.\n" +
          "- Do not ask for more information than necessary. Use the tools provided to accomplish the user's request efficiently and effectively. When you've completed your task, you must use the attemptCompletion tool to present the result to the user. The user may provide feedback, which you can use to make improvements and try again.\n" +
          '- You are only allowed to ask the user questions using the askFollowupQuestion tool. Use this tool only when you need additional details to complete a task, and be sure to use a clear and concise question that will help you move forward with the task. However if you can use the available tools to avoid having to ask the user questions, you should do so. For example, if the user mentions a file that may be in an outside directory like the Desktop, you should use the listFiles tool to list the files in the Desktop and check if the file they are talking about is there, rather than asking the user to provide the file path themselves.\n' +
          `- You are STRICTLY FORBIDDEN from starting your messages with "Great", "Certainly", "Okay", "Sure". You should NOT be conversational in your responses, but rather direct and to the point. For example you should NOT say "Great, I've updated the CSS" but instead something like "I've updated the CSS". It is important you be clear and technical in your messages.\n` +
          "- Once you've completed the user's task, you MUST use the attemptCompletion tool to present the result of the task to the user. It is STRICTLY FORBIDDEN to complete the task without using this tool.\n" +
          '- When planning large-scale changes, create a high-level diagram using mermaid in Markdown. This helps explain your plan and allows you to gather user feedback before implementation.'
      },
      {
        role: 'user',
        content: [
          {
            type: 'text',
            text: '<system-reminder># System Information\n' +
              '\n' +
              'Operating System: linux\n' +
              'Default Shell: \n' +
              'Home Directory: /root\n' +
              'Current Working Directory: /root\n' +
              'Current Time: Thu Mar 19 2026 09:17:12 GMT+0000 (Coordinated Universal Time)\n' +
              '\n' +
              '# User Information\n' +
              '- Name: Test User\n' +
              '- Email: test@example.com\n' +
              '\n' +
              '# Current Working Directory (/root) Files\n' +
              '.bashrc\n' +
              '.profile\n' +
              '.daytona\n' +
              '.pochi\n' +
              '.gitconfig\n' +
              '.daytona/sessions\n' +
              '.pochi/config.jsonc\n' +
              '.daytona/sessions/a3777110-8132-47af-b51b-5923306e85aa\n' +
              '.daytona/sessions/693f5c50-112b-4d7e-b770-9650df4dec45\n' +
              '.daytona/sessions/380662f8-8805-47f4-91d4-31c76feba356\n' +
              '.daytona/sessions/9fa6e4a8-0a92-4a65-ac29-ae9e066c28a4\n' +
              '.daytona/sessions/a3777110-8132-47af-b51b-5923306e85aa/b4ba62f8-aee3-4106-9aef-66f6c5df79f2\n' +
              '.daytona/sessions/693f5c50-112b-4d7e-b770-9650df4dec45/ebb5ee05-6f54-4f88-9e78-089e3dc49fda\n' +
              '.daytona/sessions/380662f8-8805-47f4-91d4-31c76feba356/d6e3820d-c720-4dd4-b5a4-372b6a6f4077\n' +
              '.daytona/sessions/9fa6e4a8-0a92-4a65-ac29-ae9e066c28a4/4f04fe80-a746-46a5-b898-0d363239583c\n' +
              '.daytona/sessions/a3777110-8132-47af-b51b-5923306e85aa/b4ba62f8-aee3-4106-9aef-66f6c5df79f2/exit_code\n' +
              '.daytona/sessions/693f5c50-112b-4d7e-b770-9650df4dec45/ebb5ee05-6f54-4f88-9e78-089e3dc49fda/exit_code\n' +
              '.daytona/sessions/380662f8-8805-47f4-91d4-31c76feba356/d6e3820d-c720-4dd4-b5a4-372b6a6f4077/exit_code\n' +
              '\n' +
              '# GIT STATUS\n' +
              'Current branch: \n' +
              'Main branch (you will usually use this for PRs): \n' +
              '\n' +
              'Recent commits:\n' +
              '\n' +
              '\n' +
              '# TODOs\n' +
              'No TODOs yet, if you are working on tasks that would benefit from a todo list please use the todoWrite tool to create one.</system-reminder>'
          },
          {
            type: 'text',
            text: 'You are a developer migrating from Git to Jujutsu (jj). You have an existing local Git repository at `/home/user/my-project`. Your task is to start using jj with this repository without breaking Git compatibility.\\n\\n1. Navigate to `/home/user/my-project`.\\n2. Initialize a colocated jj repository so that jj and Git can be used together.\\n3. Create a new bookmark named `feature-x`.\\n4. Create a new file named `feature.txt` containing the text `Hello jj`.\\n5. Create a new jj commit (or describe the working copy) with the description `Add feature.txt`.\\n\\nWhen finished, the repository should be a valid colocated jj/Git repo, the `feature-x` bookmark should exist and be exported to Git, and the commit should have the specified description and file.'
          }
        ]
      },
      {
        role: 'assistant',
        content: '\n' +
          '\n' +
          "I'll work through this step-by-step, migrating the Git repository to use Jujutsu (jj) in colocated mode.",
        tool_calls: [
          {
            id: 'toolu_011rCkj2REAg3R87c4PHJkcQ',
            type: 'function',
            function: {
              name: 'todoWrite',
              arguments: `{"todos":[{"id":"check-repo","content":"Check if /home/user/my-project exists and has a Git repo","status":"in-progress","priority":"high"},{"id":"init-jj","content":"Initialize colocated jj repository","status":"pending","priority":"high"},{"id":"create-bookmark","content":"Create feature-x bookmark","status":"pending","priority":"high"},{"id":"create-file","content":"Create feature.txt with 'Hello jj'","status":"pending","priority":"high"},{"id":"describe-commit","content":"Describe/create commit with 'Add feature.txt'","status":"pending","priority":"high"},{"id":"verify","content":"Verify colocated repo, bookmark, and commit","status":"pending","priority":"high"}]}`
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_011rCkj2REAg3R87c4PHJkcQ',
        content: '{"success":true}'
      },
      {
        role: 'assistant',
        content: '',
        tool_calls: [
          {
            id: 'toolu_0174ARF4pbW41KSU4HQtRVw4',
            type: 'function',
            function: {
              name: 'executeCommand',
              arguments: '{"command":"ls -la /home/user/my-project 2>/dev/null; echo \\"---\\"; ls -la /home/user/my-project/.git 2>/dev/null"}'
            }
          },
          {
            id: 'toolu_01FmkuNLXYsjxvTsBfVmHFba',
            type: 'function',
            function: {
              name: 'executeCommand',
              arguments: '{"command":"which jj && jj --version"}'
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_0174ARF4pbW41KSU4HQtRVw4',
        content: '{"output":"total 8\\r\\ndrwxr-xr-x 3 root root   47 Mar 11 12:10 .\\r\\ndrwxr-xr-x 1 root root   32 Mar 11 12:10 ..\\r\\ndrwxr-xr-x 8 root root 4096 Mar 11 12:10 .git\\r\\n-rw-r--r-- 1 root root   15 Mar 11 12:10 README.md\\r\\n---\\r\\ntotal 28\\r\\ndrwxr-xr-x 8 root root 4096 Mar 11 12:10 .\\r\\ndrwxr-xr-x 3 root root   47 Mar 11 12:10 ..\\r\\n-rw-r--r-- 1 root root   15 Mar 11 12:10 COMMIT_EDITMSG\\r\\n-rw-r--r-- 1 root root   21 Mar 11 12:10 HEAD\\r\\ndrwxr-xr-x 2 root root    6 Mar 11 12:10 branches\\r\\n-rw-r--r-- 1 root root   92 Mar 11 12:10 config\\r\\n-rw-r--r-- 1 root root   73 Mar 11 12:10 description\\r\\ndrwxr-xr-x 2 root root 4096 Mar 11 12:10 hooks\\r\\n-rw-r--r-- 1 root root  137 Mar 11 12:10 index\\r\\ndrwxr-xr-x 2 root root   29 Mar 11 12:10 info\\r\\ndrwxr-xr-x 3 root root   30 Mar 11 12:10 logs\\r\\ndrwxr-xr-x 7 root root   84 Mar 11 12:10 objects\\r\\ndrwxr-xr-x 4 root root   43 Mar 11 12:10 refs\\r\\n","isTruncated":false}'
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_01FmkuNLXYsjxvTsBfVmHFba',
        content: '{"output":"/usr/local/bin/jj\\r\\njj 0.38.0-2508982cde5c7e4db0933e0b6469f9e778e71e28\\r\\n","isTruncated":false}'
      },
      {
        role: 'assistant',
        content: 'The Git repository exists at `/home/user/my-project` with a `README.md` file, and `jj` v0.38.0 is installed.',
        tool_calls: [
          {
            id: 'toolu_01ULas2uw3TnyRPAHN6aUhhT',
            type: 'function',
            function: {
              name: 'todoWrite',
              arguments: `{"todos":[{"id":"check-repo","content":"Check if /home/user/my-project exists and has a Git repo","status":"completed","priority":"high"},{"id":"init-jj","content":"Initialize colocated jj repository","status":"in-progress","priority":"high"},{"id":"create-bookmark","content":"Create feature-x bookmark","status":"pending","priority":"high"},{"id":"create-file","content":"Create feature.txt with 'Hello jj'","status":"pending","priority":"high"},{"id":"describe-commit","content":"Describe/create commit with 'Add feature.txt'","status":"pending","priority":"high"},{"id":"verify","content":"Verify colocated repo, bookmark, and commit","status":"pending","priority":"high"}]}`
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_01ULas2uw3TnyRPAHN6aUhhT',
        content: '{"success":true}'
      },
      {
        role: 'assistant',
        content: '**Step 1 & 2: Initialize a colocated jj repository.** The `--colocate` flag (or running `jj git init --colocate` inside an existing Git repo) sets up jj to share the `.git` directory, so both tools work together.',
        tool_calls: [
          {
            id: 'toolu_019jY8xFeB1m7PfbXfapjtni',
            type: 'function',
            function: {
              name: 'executeCommand',
              arguments: '{"command":"cd /home/user/my-project && jj git init --colocate"}'
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_019jY8xFeB1m7PfbXfapjtni',
        content: '{"output":"Done importing changes from the underlying Git repo.\\r\\nInitialized repo in \\".\\"\\r\\nHint: Running `git clean -xdf` will remove `.jj/`!\\r\\n","isTruncated":false}'
      },
      {
        role: 'assistant',
        content: 'Colocated jj repository initialized. Let me verify the `.jj` directory was created alongside `.git`:',
        tool_calls: [
          {
            id: 'toolu_017U73gxk7EtcnybfQfMwDDW',
            type: 'function',
            function: {
              name: 'executeCommand',
              arguments: '{"command":"ls -la /home/user/my-project/ | head -20"}'
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_017U73gxk7EtcnybfQfMwDDW',
        content: '{"output":"total 4\\r\\ndrwxr-xr-x 1 root root 41 Mar 19 09:17 .\\r\\ndrwxr-xr-x 1 root root 32 Mar 11 12:10 ..\\r\\ndrwxr-xr-x 1 root root 45 Mar 11 12:10 .git\\r\\ndrwxr-xr-x 4 root root 72 Mar 19 09:17 .jj\\r\\n-rw-r--r-- 1 root root 15 Mar 11 12:10 README.md\\r\\n","isTruncated":false}'
      },
      {
        role: 'assistant',
        content: 'Both `.git` and `.jj` directories exist — the repo is colocated.',
        tool_calls: [
          {
            id: 'toolu_01RbFKbcqvYrAPXMhdewxZNQ',
            type: 'function',
            function: {
              name: 'todoWrite',
              arguments: `{"todos":[{"id":"check-repo","content":"Check if /home/user/my-project exists and has a Git repo","status":"completed","priority":"high"},{"id":"init-jj","content":"Initialize colocated jj repository","status":"completed","priority":"high"},{"id":"create-bookmark","content":"Create feature-x bookmark","status":"in-progress","priority":"high"},{"id":"create-file","content":"Create feature.txt with 'Hello jj'","status":"pending","priority":"high"},{"id":"describe-commit","content":"Describe/create commit with 'Add feature.txt'","status":"pending","priority":"high"},{"id":"verify","content":"Verify colocated repo, bookmark, and commit","status":"pending","priority":"high"}]}`
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_01RbFKbcqvYrAPXMhdewxZNQ',
        content: '{"success":true}'
      },
      {
        role: 'assistant',
        content: '**Step 3: Create the `feature-x` bookmark.** Let me first check the current jj log to understand the state:',
        tool_calls: [
          {
            id: 'toolu_0194HmfhNtUVQ4zP16p2MXym',
            type: 'function',
            function: {
              name: 'executeCommand',
              arguments: '{"command":"cd /home/user/my-project && jj log"}'
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_0194HmfhNtUVQ4zP16p2MXym',
        content: '{"output":"@  uyntpwtv (no email set) 2026-03-19 09:17:41 5d317252\\r\\n│  (empty) (no description set)\\r\\nā—‹  ypsoummp test@example.com 2026-03-11 12:10:51 main 14d944a2\\r\\n│  Initial commit\\r\\nā—†  zzzzzzzz root() 00000000\\r\\n","isTruncated":false}'
      },
      {
        role: 'assistant',
        content: "The working copy change (`@`) is on top of the `main` branch. Now I'll create the `feature-x` bookmark pointing to the current working copy change:",
        tool_calls: [
          {
            id: 'toolu_01Bqso2WjCh52bGNmUGaHTFv',
            type: 'function',
            function: {
              name: 'executeCommand',
              arguments: '{"command":"cd /home/user/my-project && jj bookmark create feature-x -r @"}'
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_01Bqso2WjCh52bGNmUGaHTFv',
        content: `{"output":"Warning: Target revision is empty.\\r\\nCreated 1 bookmarks pointing to uyntpwtv 5d317252 feature-x | (empty) (no description set)\\r\\nWarning: Name and email not configured. Until configured, your commits will be created with the empty identity, and can't be pushed to remotes.\\r\\nHint: To configure, run:\\r\\n  jj config set --user user.name \\"Some One\\"\\r\\n  jj config set --user user.email \\"someone@example.com\\"\\r\\n","isTruncated":false}`
      },
      {
        role: 'assistant',
        content: '',
        tool_calls: [
          {
            id: 'toolu_01L3ZYAHCdqTVwMNgE1PPERS',
            type: 'function',
            function: {
              name: 'todoWrite',
              arguments: `{"todos":[{"id":"check-repo","content":"Check if /home/user/my-project exists and has a Git repo","status":"completed","priority":"high"},{"id":"init-jj","content":"Initialize colocated jj repository","status":"completed","priority":"high"},{"id":"create-bookmark","content":"Create feature-x bookmark","status":"completed","priority":"high"},{"id":"create-file","content":"Create feature.txt with 'Hello jj'","status":"in-progress","priority":"high"},{"id":"describe-commit","content":"Describe/create commit with 'Add feature.txt'","status":"pending","priority":"high"},{"id":"verify","content":"Verify colocated repo, bookmark, and commit","status":"pending","priority":"high"}]}`
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_01L3ZYAHCdqTVwMNgE1PPERS',
        content: '{"success":true}'
      }
    ],
    tools: [
      {
        type: 'function',
        function: {
          name: 'applyDiff',
          description: "This is a tool for editing files. For moving or renaming files, you should generally use the executeCommand tool with the 'mv' command instead. For larger edits, use the writeFile tool to overwrite files.\n" +
            '\n' +
            "Before using this tool, use the readFile tool to understand the file's contents and context\n" +
            '\n' +
            'To make a file edit, provide the following:\n' +
            '1. path: The path to the file to modify (relative to the current working directory, or an absolute path)\n' +
            '2. searchContent: The text to replace (must match the file contents exactly, including all whitespace and indentation)\n' +
            '3. replaceContent: The edited text to replace the searchContent (must be different from searchContent)\n' +
            '4. expectedReplacements: The number of replacements you expect to make. Defaults to 1 if not specified.\n' +
            '\n' +
            'By default, the tool will replace ONE occurrence of searchContent with replaceContent in the specified file. If you want to replace multiple occurrences, provide the expectedReplacements parameter with the exact number of occurrences you expect.\n' +
            '\n' +
            'CRITICAL REQUIREMENTS FOR USING THIS TOOL:\n' +
            '\n' +
            '1. UNIQUENESS (when expectedReplacements is not specified): The searchContent MUST uniquely identify the specific instance you want to change. This means:\n' +
            '   - Include AT LEAST 3-5 lines of context BEFORE the change point\n' +
            '   - Include AT LEAST 3-5 lines of context AFTER the change point\n' +
            '   - Include all whitespace, indentation, and surrounding code exactly as it appears in the file\n' +
            '\n' +
            '2. EXPECTED MATCHES: If you want to replace multiple instances:\n' +
            '   - Use the expectedReplacements parameter with the exact number of occurrences you expect to replace\n' +
            '   - This will replace ALL occurrences of the searchContent with the replaceContent\n' +
            "   - If the actual number of matches doesn't equal expectedReplacements, the edit will fail\n" +
            '   - This is a safety feature to prevent unintended replacements\n' +
            '\n' +
            '3. VERIFICATION: Before using this tool:\n' +
            '   - Check how many instances of the target text exist in the file\n' +
            '   - If multiple instances exist, either:\n' +
            '     a) Gather enough context to uniquely identify each one and make separate calls, OR\n' +
            '     b) Use expectedReplacements parameter with the exact count of instances you expect to replace\n' +
            '\n' +
            'WARNING:\n' +
            "- The tool will fail if searchContent matches multiple locations and expectedReplacements isn't specified\n" +
            "- The tool will fail if the number of matches doesn't equal expectedReplacements when it's specified\n" +
            "- The tool will fail if searchContent doesn't match the file contents exactly (including whitespace)\n" +
            '- The tool will fail if searchContent and replaceContent are the same\n' +
            '\n' +
            'When making edits:\n' +
            '   - Ensure the edit results in idiomatic, correct code\n' +
            '   - Do not add trailing whitespace to lines (a newline at the end of a file is fine)\n' +
            '   - Do not leave the code in a broken state\n' +
            '\n' +
            'If you want to create a new file, use:\n' +
            '   - A new file path, including dir name if needed\n' +
            '   - An empty searchContent\n' +
            "   - The new file's contents as replaceContent\n" +
            '\n' +
            'Remember: when making multiple file edits in a row to the same file, you should prefer to send all edits in a single message with multiple calls to this tool, rather than multiple messages with a single call each.\n' +
            '\n' +
            'You may see the following fields in the result:\n' +
            '- autoFormattingEdits: If the auto-formatter makes any changes, this field will contain a diff against the file content after your edits and any user edits have been applied.\n' +
            '- newProblems: If any new problems are found after the edit, this field will contain information about them.',
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path of the file to modify (relative to the current working directory, or an absolute path).'
              },
              searchContent: {
                type: 'string',
                description: 'The text to replace.'
              },
              replaceContent: {
                type: 'string',
                description: 'The text to replace it with.'
              },
              expectedReplacements: {
                type: 'number',
                description: 'The expected number of replacements to perform. Defaults to 1 if not specified.'
              }
            },
            required: [
              'path',
              'searchContent',
              'replaceContent'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'askFollowupQuestion',
          description: 'Ask the user a question to gather additional information needed to complete the task. \n' +
            '\n' +
            '## When to Use This Tool\n' +
            'Use this tool in the following scenarios:\n' +
            "1. The user's request is ambiguous or unclear and requires clarification.\n" +
            '2. You need more details to proceed effectively.\n' +
            '3. You have made several unsuccessful attempts to solve the issue and need user guidance to move forward.\n' +
            '4. Offer choices to the user about what direction to take.\n' +
            '\n' +
            '## Usage Notes\n' +
            '- Users will always be able to select "Other" to provide custom text input\n' +
            '- Use multiSelect: true to allow multiple answers to be selected for a question\n' +
            '- If you recommend a specific option, make that the first option in the list and add "(Recommended)" at the end of the label\n' +
            '- Provide 1-4 questions per call\n' +
            '\n' +
            'IMPORTANT: This tool CANNOT be used in combination with other tools (except todoWrite) in a single step. If you need to use other tools, you must do so in a separate step before calling this tool.',
          parameters: {
            type: 'object',
            properties: {
              questions: {
                type: 'array',
                items: {
                  type: 'object',
                  properties: {
                    question: {
                      type: 'string',
                      description: 'The complete question to ask the user. Should be clear, specific, and end with a question mark.'
                    },
                    header: {
                      type: 'string',
                      maxLength: 12,
                      description: 'Very short label displayed as a chip/tag (max 12 chars). Examples: "Auth method", "Library", "Approach".'
                    },
                    options: {
                      type: 'array',
                      items: {
                        type: 'object',
                        properties: {
                          label: {
                            type: 'string',
                            description: 'Short button label shown to the user. Should be concise (1-5 words) and clearly describe the choice.'
                          },
                          description: {
                            type: 'string',
                            description: 'Explanation of what this option means or what will happen if chosen. Useful for providing context about trade-offs or implications.'
                          }
                        },
                        required: [
                          'label'
                        ],
                        additionalProperties: false
                      },
                      minItems: 2,
                      maxItems: 4,
                      description: "The available choices for this question. Must have 2-4 options. Each option should be a distinct, mutually exclusive choice (unless multiSelect is enabled). There should be no 'Other' option, that will be provided automatically."
                    },
                    multiSelect: {
                      type: 'boolean',
                      default: false,
                      description: 'Set to true to allow the user to select multiple options instead of just one. Use when choices are not mutually exclusive.'
                    }
                  },
                  required: [
                    'question',
                    'header',
                    'options'
                  ],
                  additionalProperties: false
                },
                minItems: 1,
                maxItems: 4,
                description: 'Questions to ask the user (1-4 questions).'
              }
            },
            required: [
              'questions'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'attemptCompletion',
          description: "Once you've received the results of tool uses and can confirm that the task is complete, use this tool to present the result of your work to the user.\n" +
            '\n' +
            'You MUST NOT generate any text before this tool call. All conclusion text must be included within the result parameter of the attemptCompletion tool.\n' +
            'Never use this tool with a question or request to engage in further conversation! Formulate the end of your result in a way that is final and does not require further input from the user.\n' +
            '\n' +
            'IMPORTANT: This tool CANNOT be used in combination with other tools (except todoWrite) in a single step. If you need to use other tools, you must do so in a separate step before calling this tool.',
          parameters: {
            '$schema': 'http://json-schema.org/draft-07/schema#',
            type: 'object',
            properties: {
              result: {
                description: 'The result of the task. Formulate this result in a way that is final and does not require further input from the user.',
                type: 'string'
              }
            },
            required: [
              'result'
            ],
            additionalProperties: false
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'executeCommand',
          description: 'Executes a given bash command in a persistent shell session with optional timeout, ensuring proper handling and security measures.\n' +
            '\n' +
            'IMPORTANT: This tool is for terminal operations like git, npm, docker, etc. DO NOT use it for file operations (reading, writing, editing, searching, finding files) - use the specialized tools for this instead.\n' +
            '\n' +
            'Before executing the command, please follow these steps:\n' +
            '\n' +
            '1. Directory Verification:\n' +
            '   - If the command will create new directories or files, first use listFiles to verify the parent directory exists and is the correct location\n' +
            '   - For example, before running "mkdir foo/bar", first use listFiles to check that "foo" exists and is the intended parent directory\n' +
            '\n' +
            '2. Command Execution:\n' +
            '   - Always quote file paths that contain spaces with double quotes (e.g., cd "path with spaces/file.txt")\n' +
            '   - Examples of proper quoting:\n' +
            '     - cd "/Users/name/My Documents" (correct)\n' +
            '     - cd /Users/name/My Documents (incorrect - will fail)\n' +
            '     - python "/path/with spaces/script.py" (correct)\n' +
            '     - python /path/with spaces/script.py (incorrect - will fail)\n' +
            '   - After ensuring proper quoting, execute the command.\n' +
            '   - Capture the output of the command.\n' +
            '\n' +
            'Usage notes:\n' +
            '- The command argument is required.\n' +
            '- You can specify an optional timeout in seconds (up to 300s / 5 minutes). If not specified, commands will timeout after 60s (1 minute).\n' +
            '- If the output exceeds 30000 characters, output will be truncated before being returned to you.\n' +
            '- When issuing multiple commands:\n' +
            '  - If the commands are independent and can run in parallel, make multiple executeCommand tool calls in a single message. For example, if you need to run "git status" and "git diff", send a single message with two executeCommand tool calls in parallel.\n' +
            '  - If the commands depend on each other and must run sequentially, use a single executeCommand call with \'&&\' to chain them together (e.g., `git add . && git commit -m "message" && git push`). For instance, if one operation must complete before another starts (like mkdir before cp, Write before executeCommand for git operations, or git add before git commit), run these operations sequentially instead.\n' +
            "  - Use ';' only when you need to run commands sequentially but don't care if earlier commands fail\n" +
            '  - DO NOT use newlines to separate commands (newlines are ok in quoted strings)\n' +
            "- You shall avoid use the markdown code block syntax (backtick, '`') in your command, as it will be interpreted as a command substitution.\n" +
            "- Before using this tool, you must first think about the context provided in <system-reminder> to understand the user's environment and tailor your commands to ensure they are compatible with their system. You must also consider if the command you need to run should be executed in a specific directory rather than the current working directory, and properly set the `cwd` if necessary.\n" +
            '\n' +
            '# Committing changes with git\n' +
            '\n' +
            'Only create commits when requested by the user. If unclear, ask first. When the user asks you to create a new git commit, follow these steps carefully:\n' +
            '\n' +
            'Git Safety Protocol:\n' +
            '- NEVER update the git config\n' +
            "- NEVER run destructive git commands (push --force, reset --hard, checkout ., restore ., clean -f, branch -D) unless the user explicitly requests these actions. Taking unauthorized destructive actions is unhelpful and can result in lost work, so it's best to ONLY run these commands when given direct instructions \n" +
            '- NEVER skip hooks (--no-verify, --no-gpg-sign, etc) unless the user explicitly requests it\n' +
            '- NEVER run force push to main/master, warn the user if they request it\n' +
            '- CRITICAL: Always create NEW commits rather than amending, unless the user explicitly requests a git amend. When a pre-commit hook fails, the commit did NOT happen  — so --amend would modify the PREVIOUS commit, which may result in destroying work or losing previous changes. Instead, after hook failure, fix the issue, re-stage, and create a NEW commit\n' +
            '- When staging files, prefer adding specific files by name rather than using "git add -A" or "git add .", which can accidentally include sensitive files (.env, credentials) or large binaries\n' +
            '- NEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked, otherwise the user will feel that you are being too proactive\n' +
            '\n' +
            '1. You can call multiple tools in a single response. When multiple independent pieces of information are requested and all commands are likely to succeed, run multiple tool calls in parallel for optimal performance. run the following bash commands in parallel, each using the executeCommand tool:\n' +
            '  - Run a git status command to see all untracked files. IMPORTANT: Never use the -uall flag as it can cause memory issues on large repos.\n' +
            '  - Run a git diff command to see both staged and unstaged changes that will be committed.\n' +
            "  - Run a git log command to see recent commit messages, so that you can follow this repository's commit message style.\n" +
            '2. Analyze all staged changes (both previously staged and newly added) and draft a commit message:\n' +
            '  - Summarize the nature of the changes (eg. new feature, enhancement to an existing feature, bug fix, refactoring, test, docs, etc.). Ensure the message accurately reflects the changes and their purpose (i.e. "add" means a wholly new feature, "update" means an enhancement to an existing feature, "fix" means a bug fix, etc.).\n' +
            '  - Do not commit files that likely contain secrets (.env, credentials.json, etc). Warn the user if they specifically request to commit those files\n' +
            '  - Draft a concise (1-2 sentences) commit message that focuses on the "why" rather than the "what"\n' +
            '  - Ensure it accurately reflects the changes and their purpose\n' +
            '3. You can call multiple tools in a single response. When multiple independent pieces of information are requested and all commands are likely to succeed, run multiple tool calls in parallel for optimal performance. run the following commands:\n' +
            '   - Add relevant untracked files to the staging area.\n' +
            '   - Create the commit with a message ending with:\n' +
            '   šŸ¤– Generated with [Pochi](https://getpochi.com) | [Task](<Share URL>)\n' +
            '\n' +
            '   Co-Authored-By: Pochi <noreply@getpochi.com>\n' +
            '\n' +
            '   Note: Replace <Share URL> with the Share URL from system information if available. If not available, omit the " | [Task](...)" part.\n' +
            '\n' +
            '   - Run git status after the commit completes to verify success.\n' +
            '   Note: git status depends on the commit completing, so run it sequentially after the commit.\n' +
            '4. If the commit fails due to pre-commit hook changes, retry the commit ONCE to include these automated changes. If it fails again, it usually means a pre-commit hook is preventing the commit. If the commit succeeds but you notice that files were modified by the pre-commit hook, you MUST amend your commit to include them.\n' +
            '\n' +
            'Important notes:\n' +
            '- NEVER update the git config\n' +
            '- NEVER run additional commands to read or explore code, besides git bash commands\n' +
            '- DO NOT push to the remote repository unless the user explicitly asks you to do so\n' +
            '- IMPORTANT: Never use git commands with the -i flag (like git rebase -i or git add -i) since they require interactive input which is not supported.\n' +
            '- IMPORTANT: Do not use --no-edit with git rebase commands, as the --no-edit flag is not a valid option for git rebase.\n' +
            '- If there are no changes to commit (i.e., no untracked files and no modifications), do not create an empty commit\n' +
            '- In order to ensure good formatting, ALWAYS pass the commit message via a HEREDOC, a la this example:\n' +
            '<example>\n' +
            `git commit -m "$(cat <<'EOF'\n` +
            'Commit message here.\n' +
            '\n' +
            'šŸ¤– Generated with [Pochi](https://getpochi.com) | [Task](<Share URL>)\n' +
            '\n' +
            'Co-Authored-By: Pochi <noreply@getpochi.com>\n' +
            'EOF\n' +
            ')"\n' +
            '</example>\n' +
            '\n' +
            '# Creating pull requests\n' +
            'Use the gh command via the executeCommand tool for ALL GitHub-related tasks including working with issues, pull requests, checks, and releases. If given a Github URL use the gh command to get the information needed.\n' +
            '\n' +
            'IMPORTANT: When the user asks you to create a pull request, follow these steps carefully:\n' +
            '\n' +
            '1. You can call multiple tools in a single response. When multiple independent pieces of information are requested and all commands are likely to succeed, run multiple tool calls in parallel for optimal performance. run the following bash commands in parallel using the executeCommand tool, in order to understand the current state of the branch since it diverged from the main branch:\n' +
            '   - Run a git status command to see all untracked files (never use -uall flag)\n' +
            '   - Run a git diff command to see both staged and unstaged changes that will be committed\n' +
            '   - Check if the current branch tracks a remote branch and is up to date with the remote, so you know if you need to push to the remote\n' +
            '   - Run a git log command and `git diff [base-branch]...HEAD` to understand the full commit history for the current branch (from the time it diverged from the base branch)\n' +
            '2. Analyze all changes that will be included in the pull request, making sure to look at all relevant commits (NOT just the latest commit, but ALL commits that will be included in the pull request!!!), and draft a pull request title and summary:\n' +
            '   - Keep the PR title short (under 70 characters)\n' +
            '   - Use the description/body for details, not the title\n' +
            '3. You can call multiple tools in a single response. When multiple independent pieces of information are requested and all commands are likely to succeed, run multiple tool calls in parallel for optimal performance. run the following commands in parallel:\n' +
            '   - Create new branch if needed\n' +
            '   - Push to remote with -u flag if needed\n' +
            '   - Create PR using gh pr create with the format below. Use a HEREDOC to pass the body to ensure correct formatting.\n' +
            '<example>\n' +
            `gh pr create --title "the pr title" --body "$(cat <<'EOF'\n` +
            '## Summary\n' +
            '<1-3 bullet points>\n' +
            '\n' +
            '## Test plan\n' +
            '[Checklist of TODOs for testing the pull request...]\n' +
            '\n' +
            'šŸ¤– Generated with [Pochi](https://getpochi.com) | [Task](<Share URL>)\n' +
            'EOF\n' +
            ')"\n' +
            '</example>\n' +
            '\n' +
            'Important:\n' +
            '- NEVER update the git confi'... 355 more characters,
          parameters: {
            type: 'object',
            properties: {
              command: {
                type: 'string',
                description: 'The CLI command to execute. This should be valid for the current operating system.'
              },
              cwd: {
                type: 'string',
                description: 'The working directory to execute the command in.'
              },
              timeout: {
                type: 'number',
                minimum: 1,
                maximum: 300,
                description: 'Optional timeout in seconds, max 300 seconds. By default the timeout is 120 seconds.'
              }
            },
            required: [
              'command'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'globFiles',
          description: 'Request to find files matching a glob pattern within a specified directory. Use this to get a list of files based on a pattern.',
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path of the directory to search in (relative to the current working directory, or an absolute path)'
              },
              globPattern: {
                type: 'string',
                description: "The glob pattern to match files against (e.g., '*.ts', '**/*.js')"
              }
            },
            required: [
              'path',
              'globPattern'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'listFiles',
          description: 'Request to list files and directories within the specified directory. If recursive is true, it will list all files and directories recursively. If recursive is false or not provided, it will only list the top-level contents. Do not use this tool to confirm the existence of files you may have created, as the user will let you know if the files were created successfully or not.',
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path of the directory to list contents for (relative to the current working directory, or an absolute path)'
              },
              recursive: {
                type: 'boolean',
                description: 'Whether to list files and directories recursively.'
              }
            },
            required: [
              'path'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'readFile',
          description: 'Request to read the contents of a file at the specified path. Use this when you need to examine the contents of an existing file you do not know the contents of, for example to analyze code, review text files, extract information from configuration files.\n' +
            '',
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path of the file to read (relative to the current working directory, or an absolute path)'
              },
              startLine: {
                type: 'number',
                description: 'The starting line number to read from (1-based). If not provided, it starts from the beginning of the file.'
              },
              endLine: {
                type: 'number',
                description: 'The ending line number to read to (1-based, inclusive). If not provided, it reads to the end of the file.'
              }
            },
            required: [
              'path'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'useSkill',
          description: 'Execute a skill within the main conversation\n' +
            '\n' +
            'When users ask you to perform tasks, check if any of the available skills below can help complete the task more effectively. Skills provide specialized capabilities and domain knowledge.\n' +
            '\n' +
            'When users ask about a SPECIFIC skill (e.g., "How does the pdf skill work?", "What does the commit skill do?"), you must call this tool to get detailed information about that skill.\n' +
            '\n' +
            'When users ask general questions like "What skills are available?" or "List all skills", simply refer to the "Available skills" section below - do NOT call this tool.\n' +
            '\n' +
            "This tool returns the skill's detailed instructions which you must then follow to complete the task. The instructions contain step-by-step guidance on how to perform the specific task or workflow.\n" +
            '\n' +
            'How to invoke:\n' +
            '- Use this tool with the skill name\n' +
            '- Example: `skill: "pdf-processing"` - invoke the pdf-processing skill\n' +
            "- The tool will return the skill's instructions\n" +
            '- Follow the returned instructions carefully to complete the task\n' +
            '\n' +
            'Important:\n' +
            '- When a skill is relevant for a task OR when users ask about a SPECIFIC skill, you must invoke this tool IMMEDIATELY as your first action\n' +
            '- For general questions about available skills, simply refer to the "Available skills" list below without calling this tool\n' +
            '- NEVER just announce or mention a skill in your text response without actually calling this tool (except for general skill listing requests)\n' +
            '- This is a BLOCKING REQUIREMENT: invoke the relevant Skill tool BEFORE generating any other response about a specific skill or task\n' +
            '- Only use skills listed in "Available skills" below\n' +
            '- Check compatibility requirements before using a skill - ensure the skill is compatible with the current OS/environment\n' +
            '- After calling this tool, follow the returned instructions step by step\n' +
            '- The skill file location is shown in the [Location: filepath] section of each skill listing below - use this information to understand where the skill is defined\n' +
            "- Use the directory containing the skill's source file as the base directory for resolving any resource files mentioned in the instructions\n" +
            '- Proactively explore the skill directory for optional resources that enhance task completion:\n' +
            '  * scripts/ - executable code that agents can run (Python, Bash, JavaScript, etc.)\n' +
            '  * references/ - on-demand documentation (REFERENCE.md, FORMS.md, domain-specific files)\n' +
            '  * assets/ - static resources (templates, images, data files, schemas)\n' +
            '  Use these resources when they exist and are relevant to the current task\n' +
            '\n' +
            'Available skills:\n' +
            '\n' +
            '- **find-skills**: Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill. [Location: _builtIn_]\n' +
            '- **create-skill**: Helps users create new custom agent skills. Use when the user wants to create a new skill, automate a workflow, or package specialized knowledge for reuse. [Location: _builtIn_]',
          parameters: {
            type: 'object',
            properties: {
              skill: {
                type: 'string',
                description: 'The name of the skill to use.'
              }
            },
            required: [
              'skill'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'searchFiles',
          description: '- Fast content search tool that works with any codebase size\n' +
            '- Searches file contents using regular expressions\n' +
            '- Supports Rust regex syntax (eg. "log.*Error", "functions+w+", etc.)\n' +
            '- Filter files by pattern with the include parameter (eg. "*.js", "*.{ts,tsx}")\n' +
            '- Returns file paths with at least one match sorted by modification time\n' +
            '- Use this tool when you need to find files containing specific patterns\n' +
            '- Craft your regex patterns carefully to balance specificity and flexibility.\n' +
            "- Based on the user's task you may use it to find code patterns, TODO comments, function definitions, or any text-based information across the project. The results include context, so analyze the surrounding code to better understand the matches. Leverage the this tool in combination with other tools for more comprehensive analysis. For example, use it to find specific code patterns, then use readFile to examine the full context of interesting matches before using applyDiff or writeToFile to make informed changes.",
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path of the directory to search in (relative to the current working directory, or an absolute path).'
              },
              regex: {
                type: 'string',
                description: 'The regular expression pattern to search for in file contents. Uses Rust regex syntax.'
              },
              filePattern: {
                type: 'string',
                description: 'File pattern to include in the search (e.g. "*.js", "*.{ts,tsx}"). If not provided, it will search all files.'
              }
            },
            required: [
              'path',
              'regex'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'todoWrite',
          description: 'Use this tool to create and manage a structured task list for your current coding session. This helps you track progress, organize complex tasks, and demonstrate thoroughness to the user.\n' +
            'It also helps the user understand the progress of the task and overall progress of their requests.\n' +
            '\n' +
            '## When to Use This Tool\n' +
            'Use this tool proactively in these scenarios:\n' +
            '\n' +
            '1. Complex multi-step tasks - When a task requires 3 or more distinct steps or actions\n' +
            '2. Non-trivial and complex tasks - Tasks that require careful planning or multiple operations\n' +
            '3. User explicitly requests todo list - When the user directly asks you to use the todo list\n' +
            '4. User provides multiple tasks - When users provide a list of things to be done (numbered or comma-separated)\n' +
            '5. After receiving new instructions - Immediately capture user requirements as todos. Feel free to edit the todo list based on new information.\n' +
            '6. After completing a task - Mark it complete and add any new follow-up tasks\n' +
            '7. When you start working on a new task, mark the todo as in-progress. Ideally you should only have one todo as in-progress at a time. Complete existing tasks before starting new ones.\n' +
            '\n' +
            '## When NOT to Use This Tool\n' +
            '\n' +
            'Skip using this tool when:\n' +
            '1. There is only a single, straightforward task\n' +
            '2. The task is trivial and tracking it provides no organizational benefit\n' +
            '3. The task can be completed in less than 3 trivial steps\n' +
            '4. The task is purely conversational or informational\n' +
            '\n' +
            'NOTE that you should use should not use this tool if there is only one trivial task to do. In this case you are better off just doing the task directly.\n' +
            '\n' +
            '## Examples of When to Use the Todo List\n' +
            '\n' +
            '<example>\n' +
            "User: I want to add a dark mode toggle to the application settings. Make sure you run the tests and build when you're done!\n" +
            "Assistant: I'll help add a dark mode toggle to your application settings. Let me create a todo list to track this implementation.\n" +
            '*Creates todo list with the following items:*\n' +
            '1. Create dark mode toggle component in Settings page\n' +
            '2. Add dark mode state management (context/store)\n' +
            '3. Implement CSS-in-JS styles for dark theme\n' +
            '4. Update existing components to support theme switching\n' +
            '5. Run tests and build process, addressing any failures or errors that occur\n' +
            '*Begins working on the first task*\n' +
            '\n' +
            '<reasoning>\n' +
            'The assistant used the todo list because:\n' +
            '1. Adding dark mode is a multi-step feature requiring UI, state management, and styling changes\n' +
            '2. The user explicitly requested tests and build be run afterward\n' +
            '3. The assistant inferred that tests and build need to pass by adding "Ensure tests and build succeed" as the final task\n' +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '<example>\n' +
            'User: Help me rename the function getCwd to getCurrentWorkingDirectory across my project\n' +
            "Assistant: Let me first search through your codebase to find all occurrences of 'getCwd'.\n" +
            '*Uses grep or search tools to locate all instances of getCwd in the codebase*\n' +
            "Assistant: I've found 15 instances of 'getCwd' across 8 different files. Let me create a todo list to track these changes.\n" +
            '*Creates todo list with specific items for each file that needs updating*\n' +
            '\n' +
            '<reasoning>\n' +
            'The assistant used the todo list because:\n' +
            '1. First, the assistant searched to understand the scope of the task\n' +
            '2. Upon finding multiple occurrences across different files, it determined this was a complex task with multiple steps\n' +
            '3. The todo list helps ensure every instance is tracked and updated systematically\n' +
            '4. This approach prevents missing any occurrences and maintains code consistency\n' +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '\n' +
            '<example>\n' +
            'User: I need to implement these features for my e-commerce site: user registration, product catalog, shopping cart, and checkout flow.\n' +
            "Assistant: I'll help implement these features. First, let's add all the features to the todo list.\n" +
            '*Creates a todo list breaking down each feature into specific tasks based on the project architecture*\n' +
            "Assistant: Let's start with user registration. This will involve creating database models, API endpoints, and frontend forms that integrate with your existing authentication system.\n" +
            '\n' +
            '<reasoning>\n' +
            'The assistant used the todo list because:\n' +
            '1. The user provided multiple complex features to implement in a comma separated list\n' +
            '2. The todo list helps organize these large features into manageable tasks\n' +
            '3. This approach allows for tracking progress across the entire implementation\n' +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '<example>\n' +
            "User: Can you help optimize my React application? It's rendering slowly and has performance issues.</user>\n" +
            "Assistant: I'll help optimize your React application. First, let me examine your codebase to identify potential performance bottlenecks.\n" +
            '*Reviews component structure, render patterns, state management, and data fetching*\n' +
            "Assistant: After analyzing your codebase, I've identified several performance issues. Let me create a todo list to track our optimization efforts.\n" +
            '*Creates todo list with items like: 1) Implement memoization for expensive calculations in ProductList, 2) Add virtualization for long lists in Dashboard, 3) Optimize image loading in Gallery component, 4) Fix state update loops in ShoppingCart, 5) Review bundle size and implement code splitting*\n' +
            "Let's start by implementing memoization for the expensive calculations in your ProductList component.</assistant>\n" +
            '\n' +
            '<reasoning>\n' +
            'The assistant used the todo list because:\n' +
            '1. First, the assistant examined the codebase to identify specific performance issues\n' +
            '2. Based on this analysis, it identified multiple optimization opportunities\n' +
            '3. Performance optimization is a non-trivial task requiring multiple steps\n' +
            '4. The todo list helps methodically track improvements across different components\n' +
            '5. This systematic approach ensures all performance bottlenecks are addressed\n' +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '## Examples of When NOT to Use the Todo List\n' +
            '\n' +
            '<example>\n' +
            "User: How do I print 'Hello World' in Python?\n" +
            'Assistant: In Python, you can print "Hello World" with this simple code:\n' +
            '\n' +
            'python\n' +
            'print("Hello World")\n' +
            '\n' +
            'This will output the text "Hello World" to the console when executed.</assistant>\n' +
            '\n' +
            '<reasoning>\n' +
            "The assistant did not use the todo list because this is a single, trivial task that can be completed in one step. There's no need to track multiple tasks or steps for such a straightforward request.\n" +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '<example>\n' +
            'User: What does the git status command do?\n' +
            "Assistant: The git status command shows the current state of your working directory and staging area. It displays which changes have been staged, which haven't, and which files aren't being tracked by Git. This is a fundamental command for understanding the current state of your repository before making commits.\n" +
            '\n' +
            '<reasoning>\n' +
            'The assistant did not use the todo list because this is an informational request with no actual coding task to complete. The user is simply asking for an explanation, not for the assistant to perform multiple steps or tasks.\n' +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '<example>\n' +
            'User: Can you add a comment to the calculateTotal function to explain what it does?\n' +
            'Assistant: Sure, let me add a comment to the calculateTotal function to explain what it does.\n' +
            '* Uses the Edit tool to add a comment to the calculateTotal function *\n' +
            '\n' +
            '<reasoning>\n' +
            "The assistant did not use the todo list because this is a single, straightforward task confined to one location in the code. Adding a comment doesn't require tracking multiple steps or systematic organization.\n" +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '<example>\n' +
            'User: Run npm install for me and tell me what happens.\n' +
            "Assistant: I'll run the npm install command for you.\n" +
            '\n' +
            '*Executes: npm install*\n' +
            '\n' +
            "The command completed successfully. Here's the output:\n" +
            '[Output of npm install command]\n' +
            '\n' +
            'All dependencies have been installed according to your package.json file.\n' +
            '\n' +
            '<reasoning>\n' +
            'The assistant did not use the todo list because this is a single command execution with immediate results. There are no multiple steps to track or organize, making the todo list unnecessary for this straightforward task.\n' +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '## Task States and Management\n' +
            '\n' +
            '1. **Task States**: Use these states to track progress:\n' +
            '   - pending: Task not yet started\n' +
            '   - in-progress: Currently working on (limit to ONE task at a time)\n' +
            '   - completed: Task finished successfully\n' +
            '   - cancelled: Task no longer needed\n' +
            '\n' +
            '2. **Task Management**:\n' +
            '   - Update task status in real-time as you work\n' +
            "   - Mark tasks complete IMMEDIATELY after finishing (don't batch completions)\n" +
            '   - Only have ONE task in-progress at any time\n' +
            '   - Complete current tasks before starting new ones\n' +
            '   - Cancel tasks that become irrelevant\n' +
            '\n' +
            '3. **Task Breakdown**:\n' +
            '   - Create specific, actionable items\n' +
            '   - Break complex tasks into smaller, manageable steps\n' +
            '   - Use clear, descriptive task names\n' +
            '\n' +
            'When in doubt, use this tool. Being proactive with task management demonstrates attentiveness and ensures you complete all requirements successfully.',
          parameters: {
            type: 'object',
            properties: {
              todos: {
                type: 'array',
                items: {
                  type: 'object',
                  properties: {
                    id: {
                      type: 'string',
                      description: 'The unique identifier of the task, e.g "collect-information".'
                    },
                    content: {
                      type: 'string',
                      description: 'The content of the task.'
                    },
                    status: {
                      type: 'string',
                      enum: [
                        'pending',
                        'in-progress',
                        'completed',
                        'cancelled'
                      ],
                      description: 'The status of the task.'
                    },
                    priority: {
                      type: 'string',
                      enum: [
                        'low',
                        'medium',
                        'high'
                      ],
                      description: 'The priority of the task.'
                    }
                  },
                  required: [
                    'id',
                    'content',
                    'status',
                    'priority'
                  ],
                  additionalProperties: false
                }
              }
            },
            required: [
              'todos'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'writeToFile',
          description: 'Request to write full content to a file at the specified path.\n' +
            'If the file exists, it will be overwritten with the provided content.\n' +
            "If the file doesn't exist, it will be created. This tool will automatically create any directories needed to write the file.\n" +
            '\n' +
            'You may see the following fields in the result:\n' +
            '- autoFormattingEdits: If the auto-formatter makes any changes, this field will contain a diff against the file content after your edits and any user edits have been applied.\n' +
            '- newProblems: If any new problems are found after the edit, this field will contain information about them.',
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path of the file to write to (relative to the current working directory, or an absolute path).'
              },
              content: {
                type: 'string',
                description: 'The content to write to the file.'
              }
            },
            required: [
              'path',
              'content'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'editNotebook',
          description: 'Edit a specific cell in a Jupyter notebook (.ipynb file) by its cell ID',
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path to the notebook file (relative to the current working directory, or an absolute path)'
              },
              cellId: {
                type: 'string',
                description: 'The ID of the cell to edit'
              },
              content: {
                type: 'string',
                description: 'The new content of the cell'
              }
            },
            required: [
              'path',
              'cellId',
              'content'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'newTask',
          description: 'Launch a new agent to handle complex, multi-step tasks autonomously.\n' +
            'When using the newTask tool, you may specify a agentType parameter to select which agent type to use.\n' +
            'Available agent types and the tools they have access to:\n' +
            '\n' +
            '### planner\n' +
            'Engage this agent to formulate comprehensive, technical implementation strategies for feature development, system refactoring, or defect resolution.\n' +
            'This agent is strictly limited to planning and architectural design; it DOES NOT execute code modifications.\n' +
            '\n' +
            'Examples of user requests this agent shall trigger:\n' +
            '- "create a plan to implement the user authentication feature"\n' +
            '- "how should we refactor the database schema"\n' +
            '- "design a solution for the memory leak issue"\n' +
            '\n' +
            '### browser\n' +
            'Web browser automation agent for navigating websites, interacting with pages, and extracting information. Uses agent-browser CLI for headless browser control.\n' +
            '\n' +
            '### reviewer\n' +
            'Engage this agent to perform code reviews and leave inline comments.\n' +
            'This agent can analyze code and create review comments on specific lines.\n' +
            '\n' +
            'Examples of user requests this agent shall trigger:\n' +
            '- "review the code in src/auth"\n' +
            '- "add review comments to this file"\n' +
            '- "check this code and leave feedback"\n' +
            '\n' +
            '### walkthrough\n' +
            'Engage this agent to create a summary of the changes made in the current task.\n' +
            'This agent is strictly limited to documentation and explanation; it DOES NOT execute code modifications.\n' +
            '\n' +
            'Examples of user requests this agent shall trigger:\n' +
            '- "summarize what we have done"\n' +
            '- "create a walkthrough for the changes"\n' +
            '- "explain the changes made in this task"\n' +
            '\n' +
            '### explore\n' +
            'Use this agent to explore the codebase when you need to: understand project structure, find where features are implemented, locate specific functions or classes, analyze code patterns, investigate how something works, search for examples or usage, or gather information before making changes.\n' +
            '\n' +
            'Examples of questions this agent shall trigger:\n' +
            '- "where is the authentication logic implemented"\n' +
            '- "find all usages of the config parser"\n' +
            '- "how does the ignore-walk module work"\n' +
            '\n' +
            '\n' +
            'Always include a reminder in your prompt to ensure the result will be submitted through the `attemptCompletion` tool.\n' +
            'If the task stops without submitting the result, it will return an error message.\n' +
            '\n' +
            'You can optionally run agents in the background using the runAsync parameter. You can continue working while background agents run.\n' +
            '\n' +
            'When NOT to use the newTask tool:\n' +
            '- If you want to read a specific file path, use the readFile or globFiles tool instead of the newTask tool, to find the match more quickly\n' +
            '- If you are searching for a specific class definition like "class Foo", use the globFiles tool instead, to find the match more quickly\n' +
            '- If you are searching for code within a specific file or set of 2-3 files, use the readFile tool instead of the newTask tool, to find the match more quickly\n' +
            '- Other tasks that are not related to the agent descriptions above\n' +
            '\n' +
            'Usage notes:\n' +
            '1. Launch multiple agents tools concurrently whenever possible to maximize performance; to do that, use a single message with multiple tool uses\n' +
            '2. When the agent is done, it will return a single message back to you. The result returned by the agent is not visible to the user. To show the user the result, you should send a text message back to the user with a concise summary of the result.\n' +
            '3. Each agent invocation is stateless. You will not be able to send additional messages to the agent, nor will the agent be able to communicate with you outside of its final report. Therefore, your prompt should contain a highly detailed task description for the agent to perform autonomously and you should specify exactly what information the agent should return back to you in its final and only message to you.\n' +
            "4. The agent's outputs should generally be trusted\n" +
            "5. Clearly tell the agent whether you expect it to write code or just to do research (search, file reads, web fetches, etc.), since it is not aware of the user's intent\n" +
            '6. If the agent description mentions that it should be used proactively, then you should try your best to use it without the user having to ask for it first. Use your judgement.',
          parameters: {
            type: 'object',
            properties: {
              description: {
                type: 'string',
                description: 'A short description of the task.'
              },
              prompt: {
                type: 'string',
                description: 'The detailed prompt for the task to be performed.'
              },
              agentType: {
                type: 'string',
                description: 'The type of the specialized agent to use for the task.'
              },
              runAsync: {
                type: 'boolean',
                description: 'Set to true to run this agent in the background.'
              }
            },
            required: [
              'description',
              'prompt'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'startBackgroundJob',
          description: 'Start a background job to execute a bash command, which allows you to continue working while the job runs.\n' +
            '\n' +
            'Before starting the background job, please follow these steps:\n' +
            '\n' +
            '1. Directory Verification:\n' +
            '   - If the command will create new directories or files, first use the listFiles tool to verify the parent directory exists and is the correct location\n' +
            '   - For example, before running "mkdir foo/bar", first use listFiles to check that "foo" exists and is the intended parent directory\n' +
            '\n' +
            '2. Job Execution:\n' +
            '   - After ensuring proper quoting, start the background job.\n' +
            '\n' +
            'Usage notes:\n' +
            '- The command argument is required.\n' +
            '- Use readBackgroundJobOutput to monitor the output and status of the job.\n' +
            '- Use killBackgroundJob to terminate the job if needed.\n' +
            '- If the output exceeds 30000 characters, output will be truncated before being returned to you.\n' +
            '\n' +
            'Common use cases and examples:\n' +
            '- Development servers: `npm run dev`, `yarn start`, `bun run dev`\n' +
            '- Build processes: `npm run build`, `make`, `cargo build`\n' +
            '- File watchers: `npm run watch`, `tsc --watch`\n' +
            '- Testing: `npm run test:watch`, `jest --watch`\n' +
            '- Database services: `docker run -p 5432:5432 postgres`\n' +
            '\n' +
            'Command execution rules:\n' +
            "- Never run 'sleep' as it will return immediately.\n" +
            "- You do not need to use '&' at the end of the command.\n" +
            "- When issuing multiple commands, use the ';' or '&&' operator to separate them. DO NOT use newlines (newlines are ok in quoted strings).\n" +
            "- You shall avoid use the markdown code block syntax (backtick, '`') in your command, as it will be interpreted as a command substitution.",
          parameters: {
            type: 'object',
            properties: {
              command: {
                type: 'string',
                description: 'The CLI command to execute. This should be valid for the current operating system.'
              },
              cwd: {
                type: 'string',
                description: 'The working directory to execute the command in.'
              }
            },
            required: [
              'command'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'readBackgroundJobOutput',
          description: '- Retrieves output from a running or completed background job or async task\n' +
            '- Takes a backgroundJobId parameter identifying the job or task\n' +
            '- For terminal jobs, returns only new output since the last check\n' +
            '- For task IDs, returns the latest attemptCompletion result once completed\n' +
            '- Returns stdout and stderr output along with job status\n' +
            '- Supports optional regex filtering to show only lines matching a pattern\n' +
            '- Use this tool when you need to monitor or check the output of a long-running background job',
          parameters: {
            type: 'object',
            properties: {
              backgroundJobId: {
                type: 'string',
                description: 'The ID of the background job to get output from'
              },
              regex: {
                type: 'string',
                description: 'Optional regular expression to filter the output lines. Only lines matching this regex will be included in the result. Any lines that do not match will no longer be available to read.'
              }
            },
            required: [
              'backgroundJobId'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'killBackgroundJob',
          description: '- Kills a running background job by its ID\n' +
            '- Takes a backgroundJobId parameter identifying the job to kill\n' +
            '- Returns a success or failure status\n' +
            '- Use this tool when you need to terminate a long-running background job',
          parameters: {
            type: 'object',
            properties: {
              backgroundJobId: {
                type: 'string',
                description: 'The ID of the background job to kill.'
              }
            },
            required: [
              'backgroundJobId'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'webFetch',
          description: '- Fetches content from a specified URL and converts HTML to markdown\n' +
            '- Use this tool when you need to retrieve and analyze web content\n' +
            '\n' +
            'Usage notes:\n' +
            '  - IMPORTANT: If an MCP-provided web fetch tool is available, prefer using that tool instead of this one, as it may have fewer restrictions.\n' +
            '  - The URL must be a fully-formed valid URL\n' +
            '  - The prompt should describe what information you want to extract from the page\n' +
            '  - This tool is read-only and does not modify any files\n' +
            '  - Includes a self-cleaning 10-minute cache for faster responses when repeatedly accessing the same URL',
          parameters: {
            '$schema': 'https://json-schema.org/draft/2020-12/schema',
            type: 'object',
            properties: {
              url: {
                type: 'string',
                format: 'uri'
              }
            },
            required: [
              'url'
            ],
            additionalProperties: false
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'webSearch',
          description: '- Allows Pochi to search the web and use the results to inform responses\n' +
            '- Provides up-to-date information for current events and recent data\n' +
            '- Returns search result information formatted as search result blocks, including links as markdown hyperlinks\n' +
            '- Searches are performed automatically within a single API call\n' +
            '\n' +
            'CRITICAL REQUIREMENT - You MUST follow this:\n' +
            `  - After answering the user's question, you MUST include a "Sources:" section at the end of your response\n` +
            '  - In the Sources section, list all relevant URLs from the search results as markdown hyperlinks: [Title](URL)\n' +
            '  - This is MANDATORY - never skip including sources in your response\n' +
            '  - Example format:\n' +
            '\n' +
            '    [Your answer here]\n' +
            '\n' +
            '    Sources:\n' +
            '    - [Source Title 1](https://example.com/1)\n' +
            '    - [Source Title 2](https://example.com/2)\n' +
            '\n' +
            'Usage notes:\n' +
            `  - Account for "Today's date" in <system-reminder>. For example, if <system-reminder> says "Today's date: 2025-07-01", and the user wants the latest docs, do not use 2024 in the search query. Use 2025.`,
          parameters: {
            '$schema': 'https://json-schema.org/draft/2020-12/schema',
            type: 'object',
            properties: {
              query: {
                description: 'The search query to perform',
                type: 'string'
              },
              country: {
                description: "Country code to filter search results by, e.g. 'US', 'GB', 'JP'",
                type: 'string'
              }
            },
            required: [
              'query'
            ],
            additionalProperties: false
          }
        }
      }
    ],
    tool_choice: 'auto',
    stream: true
  }
}
2026-03-19 09:18:53.596	DEBUG	/$bunfs/pochi:454339	listFiles	Listing workspace files from /root with maxItems 500
2026-03-19 09:18:53.763	ERROR	/$bunfs/pochi:432009	LiveChatKit	onError

 AI_APICallError  This request would exceed your organization's rate limit of 2,000,000 input tokens per minute (org: e70c8d22-9099-49c5-a9af-e059e6515b76, model: claude-opus-4-6). For details, refer to: https://docs.claude.com/en/api/rate-limits. You can see the response headers for current usage. Please reduce the prompt length or the maximum tokens requested, or try again later. You may also contact sales at https://claude.com/contact-sales to discuss your options for a rate limit increase., AI_APICallError, , https://api.anthropic.com/v1/chat/completions, [object Object], 429, [object Object], {"error":{"code":"rate_limit_error","message":"This request would exceed your organization's rate limit of 2,000,000 input tokens per minute (org: e70c8d22-9099-49c5-a9af-e059e6515b76, model: claude-opus-4-6). For details, refer to: https://docs.claude.com/en/api/rate-limits. You can see the response headers for current usage. Please reduce the prompt length or the maximum tokens requested, or try again later. You may also contact sales at https://claude.com/contact-sales to discuss your options for a rate limit increase.","type":"invalid_request_error","param":null}}, true, [object Object], 423231, 30, 423231, 30, /$bunfs/root/pochi
error stack:
  • pochi	<anonymous>
	/$bunfs/pochi:423231
  • pochi	async <anonymous>
	/$bunfs/pochi:423092
  • native	processTicksAndRejections
	native:7
2026-03-19 09:19:05.775	ERROR	/$bunfs/pochi:502749	TaskRunner	Task is failed, trying to resend last message to resume it. {
  kind: 'APICallError',
  isRetryable: true,
  message: "This request would exceed your organization's rate limit of 2,000,000 input tokens per minute (org: e70c8d22-9099-49c5-a9af-e059e6515b76, model: claude-opus-4-6). For details, refer to: https://docs.claude.com/en/api/rate-limits. You can see the response headers for current usage. Please reduce the prompt length or the maximum tokens requested, or try again later. You may also contact sales at https://claude.com/contact-sales to discuss your options for a rate limit increase.",
  requestBodyValues: {
    model: 'claude-opus-4-6',
    max_tokens: 4096,
    messages: [
      {
        role: 'system',
        content: 'You are Pochi, a highly skilled software engineer with extensive knowledge in many programming languages, frameworks, design patterns, and best practices.\n' +
          '\n' +
          'IMPORTANT: You must NEVER generate or guess URLs for the user unless you are confident that the URLs are for helping the user with programming. You may use URLs provided by the user in their messages or local files.\n' +
          '\n' +
          'If the user asks for help or wants to give feedback inform them of the following:\n' +
          '- Join the discord channel at https://getpochi.com/discord to ask questions and get help\n' +
          '- To report bugs, users should report the issue at https://github.com/TabbyML/pochi/issues\n' +
          '\n' +
          "When the user directly asks about Pochi (eg 'can Pochi do...', 'does Pochi have...') or asks in second person (eg 'are you able...', 'can you do...'), first use curl to gather information to answer the question from Pochi docs at https://docs.getpochi.com/llms.txt\n" +
          '\n' +
          '====\n' +
          '\n' +
          'TASK MANAGEMENT\n' +
          '\n' +
          'You have access to the todoWrite tool to help you manage and plan tasks. Use these tools VERY frequently to ensure that you are tracking your tasks and giving the user visibility into your progress.\n' +
          'These tools are also EXTREMELY helpful for planning tasks, and for breaking down larger complex tasks into smaller steps. If you do not use this tool when planning, you may forget to do important tasks - and that is unacceptable.\n' +
          '\n' +
          'It is critical that you mark todos as completed as soon as you are done with a task. Do not batch up multiple tasks before marking them as completed.\n' +
          '\n' +
          '====\n' +
          '\n' +
          'RULES\n' +
          '\n' +
          "- User messages may include <system-reminder> tags. <system-reminder> tags contain useful information and reminders. They are NOT part of the user's provided input or the tool result. You shall pay close attention to information in these tags and use it to inform you actions.\n" +
          "- When the user initially gives you a task, a recursive list of all filepaths in the current working directory will be included in <system-reminder> tag. This provides an overview of the project's file structure, offering key insights into the project from directory/file names (how developers conceptualize and organize their code) and file extensions (the language used). This can also guide decision-making on which files to explore further. If you need to further explore directories such as outside the current working directory, you can use the listFiles tool. If you pass 'true' for the recursive parameter, it will list files recursively.\n" +
          '- All file paths used by tools must be relative to current working directory, do not use the ~ character or $HOME to refer to the home directory in file paths used by tools.\n' +
          "- You can use `pochi://` URI schema to access the Pochi virtual file system. This allows you to read and write files that are stored in Pochi's internal storage.\n" +
          "- Be sure to consider the type of project (e.g. Python, JavaScript, web application) when determining the appropriate structure and files to include. Also consider what files may be most relevant to accomplishing the task, for example looking at a project's manifest file would help you understand the project's dependencies, which you could incorporate into any code you write.\n" +
          "- Do not ask for more information than necessary. Use the tools provided to accomplish the user's request efficiently and effectively. When you've completed your task, you must use the attemptCompletion tool to present the result to the user. The user may provide feedback, which you can use to make improvements and try again.\n" +
          '- You are only allowed to ask the user questions using the askFollowupQuestion tool. Use this tool only when you need additional details to complete a task, and be sure to use a clear and concise question that will help you move forward with the task. However if you can use the available tools to avoid having to ask the user questions, you should do so. For example, if the user mentions a file that may be in an outside directory like the Desktop, you should use the listFiles tool to list the files in the Desktop and check if the file they are talking about is there, rather than asking the user to provide the file path themselves.\n' +
          `- You are STRICTLY FORBIDDEN from starting your messages with "Great", "Certainly", "Okay", "Sure". You should NOT be conversational in your responses, but rather direct and to the point. For example you should NOT say "Great, I've updated the CSS" but instead something like "I've updated the CSS". It is important you be clear and technical in your messages.\n` +
          "- Once you've completed the user's task, you MUST use the attemptCompletion tool to present the result of the task to the user. It is STRICTLY FORBIDDEN to complete the task without using this tool.\n" +
          '- When planning large-scale changes, create a high-level diagram using mermaid in Markdown. This helps explain your plan and allows you to gather user feedback before implementation.'
      },
      {
        role: 'user',
        content: [
          {
            type: 'text',
            text: '<system-reminder># System Information\n' +
              '\n' +
              'Operating System: linux\n' +
              'Default Shell: \n' +
              'Home Directory: /root\n' +
              'Current Working Directory: /root\n' +
              'Current Time: Thu Mar 19 2026 09:17:12 GMT+0000 (Coordinated Universal Time)\n' +
              '\n' +
              '# User Information\n' +
              '- Name: Test User\n' +
              '- Email: test@example.com\n' +
              '\n' +
              '# Current Working Directory (/root) Files\n' +
              '.bashrc\n' +
              '.profile\n' +
              '.daytona\n' +
              '.pochi\n' +
              '.gitconfig\n' +
              '.daytona/sessions\n' +
              '.pochi/config.jsonc\n' +
              '.daytona/sessions/a3777110-8132-47af-b51b-5923306e85aa\n' +
              '.daytona/sessions/693f5c50-112b-4d7e-b770-9650df4dec45\n' +
              '.daytona/sessions/380662f8-8805-47f4-91d4-31c76feba356\n' +
              '.daytona/sessions/9fa6e4a8-0a92-4a65-ac29-ae9e066c28a4\n' +
              '.daytona/sessions/a3777110-8132-47af-b51b-5923306e85aa/b4ba62f8-aee3-4106-9aef-66f6c5df79f2\n' +
              '.daytona/sessions/693f5c50-112b-4d7e-b770-9650df4dec45/ebb5ee05-6f54-4f88-9e78-089e3dc49fda\n' +
              '.daytona/sessions/380662f8-8805-47f4-91d4-31c76feba356/d6e3820d-c720-4dd4-b5a4-372b6a6f4077\n' +
              '.daytona/sessions/9fa6e4a8-0a92-4a65-ac29-ae9e066c28a4/4f04fe80-a746-46a5-b898-0d363239583c\n' +
              '.daytona/sessions/a3777110-8132-47af-b51b-5923306e85aa/b4ba62f8-aee3-4106-9aef-66f6c5df79f2/exit_code\n' +
              '.daytona/sessions/693f5c50-112b-4d7e-b770-9650df4dec45/ebb5ee05-6f54-4f88-9e78-089e3dc49fda/exit_code\n' +
              '.daytona/sessions/380662f8-8805-47f4-91d4-31c76feba356/d6e3820d-c720-4dd4-b5a4-372b6a6f4077/exit_code\n' +
              '\n' +
              '# GIT STATUS\n' +
              'Current branch: \n' +
              'Main branch (you will usually use this for PRs): \n' +
              '\n' +
              'Recent commits:\n' +
              '\n' +
              '\n' +
              '# TODOs\n' +
              'No TODOs yet, if you are working on tasks that would benefit from a todo list please use the todoWrite tool to create one.</system-reminder>'
          },
          {
            type: 'text',
            text: 'You are a developer migrating from Git to Jujutsu (jj). You have an existing local Git repository at `/home/user/my-project`. Your task is to start using jj with this repository without breaking Git compatibility.\\n\\n1. Navigate to `/home/user/my-project`.\\n2. Initialize a colocated jj repository so that jj and Git can be used together.\\n3. Create a new bookmark named `feature-x`.\\n4. Create a new file named `feature.txt` containing the text `Hello jj`.\\n5. Create a new jj commit (or describe the working copy) with the description `Add feature.txt`.\\n\\nWhen finished, the repository should be a valid colocated jj/Git repo, the `feature-x` bookmark should exist and be exported to Git, and the commit should have the specified description and file.'
          }
        ]
      },
      {
        role: 'assistant',
        content: '\n' +
          '\n' +
          "I'll work through this step-by-step, migrating the Git repository to use Jujutsu (jj) in colocated mode.",
        tool_calls: [
          {
            id: 'toolu_011rCkj2REAg3R87c4PHJkcQ',
            type: 'function',
            function: {
              name: 'todoWrite',
              arguments: `{"todos":[{"id":"check-repo","content":"Check if /home/user/my-project exists and has a Git repo","status":"in-progress","priority":"high"},{"id":"init-jj","content":"Initialize colocated jj repository","status":"pending","priority":"high"},{"id":"create-bookmark","content":"Create feature-x bookmark","status":"pending","priority":"high"},{"id":"create-file","content":"Create feature.txt with 'Hello jj'","status":"pending","priority":"high"},{"id":"describe-commit","content":"Describe/create commit with 'Add feature.txt'","status":"pending","priority":"high"},{"id":"verify","content":"Verify colocated repo, bookmark, and commit","status":"pending","priority":"high"}]}`
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_011rCkj2REAg3R87c4PHJkcQ',
        content: '{"success":true}'
      },
      {
        role: 'assistant',
        content: '',
        tool_calls: [
          {
            id: 'toolu_0174ARF4pbW41KSU4HQtRVw4',
            type: 'function',
            function: {
              name: 'executeCommand',
              arguments: '{"command":"ls -la /home/user/my-project 2>/dev/null; echo \\"---\\"; ls -la /home/user/my-project/.git 2>/dev/null"}'
            }
          },
          {
            id: 'toolu_01FmkuNLXYsjxvTsBfVmHFba',
            type: 'function',
            function: {
              name: 'executeCommand',
              arguments: '{"command":"which jj && jj --version"}'
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_0174ARF4pbW41KSU4HQtRVw4',
        content: '{"output":"total 8\\r\\ndrwxr-xr-x 3 root root   47 Mar 11 12:10 .\\r\\ndrwxr-xr-x 1 root root   32 Mar 11 12:10 ..\\r\\ndrwxr-xr-x 8 root root 4096 Mar 11 12:10 .git\\r\\n-rw-r--r-- 1 root root   15 Mar 11 12:10 README.md\\r\\n---\\r\\ntotal 28\\r\\ndrwxr-xr-x 8 root root 4096 Mar 11 12:10 .\\r\\ndrwxr-xr-x 3 root root   47 Mar 11 12:10 ..\\r\\n-rw-r--r-- 1 root root   15 Mar 11 12:10 COMMIT_EDITMSG\\r\\n-rw-r--r-- 1 root root   21 Mar 11 12:10 HEAD\\r\\ndrwxr-xr-x 2 root root    6 Mar 11 12:10 branches\\r\\n-rw-r--r-- 1 root root   92 Mar 11 12:10 config\\r\\n-rw-r--r-- 1 root root   73 Mar 11 12:10 description\\r\\ndrwxr-xr-x 2 root root 4096 Mar 11 12:10 hooks\\r\\n-rw-r--r-- 1 root root  137 Mar 11 12:10 index\\r\\ndrwxr-xr-x 2 root root   29 Mar 11 12:10 info\\r\\ndrwxr-xr-x 3 root root   30 Mar 11 12:10 logs\\r\\ndrwxr-xr-x 7 root root   84 Mar 11 12:10 objects\\r\\ndrwxr-xr-x 4 root root   43 Mar 11 12:10 refs\\r\\n","isTruncated":false}'
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_01FmkuNLXYsjxvTsBfVmHFba',
        content: '{"output":"/usr/local/bin/jj\\r\\njj 0.38.0-2508982cde5c7e4db0933e0b6469f9e778e71e28\\r\\n","isTruncated":false}'
      },
      {
        role: 'assistant',
        content: 'The Git repository exists at `/home/user/my-project` with a `README.md` file, and `jj` v0.38.0 is installed.',
        tool_calls: [
          {
            id: 'toolu_01ULas2uw3TnyRPAHN6aUhhT',
            type: 'function',
            function: {
              name: 'todoWrite',
              arguments: `{"todos":[{"id":"check-repo","content":"Check if /home/user/my-project exists and has a Git repo","status":"completed","priority":"high"},{"id":"init-jj","content":"Initialize colocated jj repository","status":"in-progress","priority":"high"},{"id":"create-bookmark","content":"Create feature-x bookmark","status":"pending","priority":"high"},{"id":"create-file","content":"Create feature.txt with 'Hello jj'","status":"pending","priority":"high"},{"id":"describe-commit","content":"Describe/create commit with 'Add feature.txt'","status":"pending","priority":"high"},{"id":"verify","content":"Verify colocated repo, bookmark, and commit","status":"pending","priority":"high"}]}`
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_01ULas2uw3TnyRPAHN6aUhhT',
        content: '{"success":true}'
      },
      {
        role: 'assistant',
        content: '**Step 1 & 2: Initialize a colocated jj repository.** The `--colocate` flag (or running `jj git init --colocate` inside an existing Git repo) sets up jj to share the `.git` directory, so both tools work together.',
        tool_calls: [
          {
            id: 'toolu_019jY8xFeB1m7PfbXfapjtni',
            type: 'function',
            function: {
              name: 'executeCommand',
              arguments: '{"command":"cd /home/user/my-project && jj git init --colocate"}'
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_019jY8xFeB1m7PfbXfapjtni',
        content: '{"output":"Done importing changes from the underlying Git repo.\\r\\nInitialized repo in \\".\\"\\r\\nHint: Running `git clean -xdf` will remove `.jj/`!\\r\\n","isTruncated":false}'
      },
      {
        role: 'assistant',
        content: 'Colocated jj repository initialized. Let me verify the `.jj` directory was created alongside `.git`:',
        tool_calls: [
          {
            id: 'toolu_017U73gxk7EtcnybfQfMwDDW',
            type: 'function',
            function: {
              name: 'executeCommand',
              arguments: '{"command":"ls -la /home/user/my-project/ | head -20"}'
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_017U73gxk7EtcnybfQfMwDDW',
        content: '{"output":"total 4\\r\\ndrwxr-xr-x 1 root root 41 Mar 19 09:17 .\\r\\ndrwxr-xr-x 1 root root 32 Mar 11 12:10 ..\\r\\ndrwxr-xr-x 1 root root 45 Mar 11 12:10 .git\\r\\ndrwxr-xr-x 4 root root 72 Mar 19 09:17 .jj\\r\\n-rw-r--r-- 1 root root 15 Mar 11 12:10 README.md\\r\\n","isTruncated":false}'
      },
      {
        role: 'assistant',
        content: 'Both `.git` and `.jj` directories exist — the repo is colocated.',
        tool_calls: [
          {
            id: 'toolu_01RbFKbcqvYrAPXMhdewxZNQ',
            type: 'function',
            function: {
              name: 'todoWrite',
              arguments: `{"todos":[{"id":"check-repo","content":"Check if /home/user/my-project exists and has a Git repo","status":"completed","priority":"high"},{"id":"init-jj","content":"Initialize colocated jj repository","status":"completed","priority":"high"},{"id":"create-bookmark","content":"Create feature-x bookmark","status":"in-progress","priority":"high"},{"id":"create-file","content":"Create feature.txt with 'Hello jj'","status":"pending","priority":"high"},{"id":"describe-commit","content":"Describe/create commit with 'Add feature.txt'","status":"pending","priority":"high"},{"id":"verify","content":"Verify colocated repo, bookmark, and commit","status":"pending","priority":"high"}]}`
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_01RbFKbcqvYrAPXMhdewxZNQ',
        content: '{"success":true}'
      },
      {
        role: 'assistant',
        content: '**Step 3: Create the `feature-x` bookmark.** Let me first check the current jj log to understand the state:',
        tool_calls: [
          {
            id: 'toolu_0194HmfhNtUVQ4zP16p2MXym',
            type: 'function',
            function: {
              name: 'executeCommand',
              arguments: '{"command":"cd /home/user/my-project && jj log"}'
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_0194HmfhNtUVQ4zP16p2MXym',
        content: '{"output":"@  uyntpwtv (no email set) 2026-03-19 09:17:41 5d317252\\r\\n│  (empty) (no description set)\\r\\nā—‹  ypsoummp test@example.com 2026-03-11 12:10:51 main 14d944a2\\r\\n│  Initial commit\\r\\nā—†  zzzzzzzz root() 00000000\\r\\n","isTruncated":false}'
      },
      {
        role: 'assistant',
        content: "The working copy change (`@`) is on top of the `main` branch. Now I'll create the `feature-x` bookmark pointing to the current working copy change:",
        tool_calls: [
          {
            id: 'toolu_01Bqso2WjCh52bGNmUGaHTFv',
            type: 'function',
            function: {
              name: 'executeCommand',
              arguments: '{"command":"cd /home/user/my-project && jj bookmark create feature-x -r @"}'
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_01Bqso2WjCh52bGNmUGaHTFv',
        content: `{"output":"Warning: Target revision is empty.\\r\\nCreated 1 bookmarks pointing to uyntpwtv 5d317252 feature-x | (empty) (no description set)\\r\\nWarning: Name and email not configured. Until configured, your commits will be created with the empty identity, and can't be pushed to remotes.\\r\\nHint: To configure, run:\\r\\n  jj config set --user user.name \\"Some One\\"\\r\\n  jj config set --user user.email \\"someone@example.com\\"\\r\\n","isTruncated":false}`
      },
      {
        role: 'assistant',
        content: '',
        tool_calls: [
          {
            id: 'toolu_01L3ZYAHCdqTVwMNgE1PPERS',
            type: 'function',
            function: {
              name: 'todoWrite',
              arguments: `{"todos":[{"id":"check-repo","content":"Check if /home/user/my-project exists and has a Git repo","status":"completed","priority":"high"},{"id":"init-jj","content":"Initialize colocated jj repository","status":"completed","priority":"high"},{"id":"create-bookmark","content":"Create feature-x bookmark","status":"completed","priority":"high"},{"id":"create-file","content":"Create feature.txt with 'Hello jj'","status":"in-progress","priority":"high"},{"id":"describe-commit","content":"Describe/create commit with 'Add feature.txt'","status":"pending","priority":"high"},{"id":"verify","content":"Verify colocated repo, bookmark, and commit","status":"pending","priority":"high"}]}`
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_01L3ZYAHCdqTVwMNgE1PPERS',
        content: '{"success":true}'
      }
    ],
    tools: [
      {
        type: 'function',
        function: {
          name: 'applyDiff',
          description: "This is a tool for editing files. For moving or renaming files, you should generally use the executeCommand tool with the 'mv' command instead. For larger edits, use the writeFile tool to overwrite files.\n" +
            '\n' +
            "Before using this tool, use the readFile tool to understand the file's contents and context\n" +
            '\n' +
            'To make a file edit, provide the following:\n' +
            '1. path: The path to the file to modify (relative to the current working directory, or an absolute path)\n' +
            '2. searchContent: The text to replace (must match the file contents exactly, including all whitespace and indentation)\n' +
            '3. replaceContent: The edited text to replace the searchContent (must be different from searchContent)\n' +
            '4. expectedReplacements: The number of replacements you expect to make. Defaults to 1 if not specified.\n' +
            '\n' +
            'By default, the tool will replace ONE occurrence of searchContent with replaceContent in the specified file. If you want to replace multiple occurrences, provide the expectedReplacements parameter with the exact number of occurrences you expect.\n' +
            '\n' +
            'CRITICAL REQUIREMENTS FOR USING THIS TOOL:\n' +
            '\n' +
            '1. UNIQUENESS (when expectedReplacements is not specified): The searchContent MUST uniquely identify the specific instance you want to change. This means:\n' +
            '   - Include AT LEAST 3-5 lines of context BEFORE the change point\n' +
            '   - Include AT LEAST 3-5 lines of context AFTER the change point\n' +
            '   - Include all whitespace, indentation, and surrounding code exactly as it appears in the file\n' +
            '\n' +
            '2. EXPECTED MATCHES: If you want to replace multiple instances:\n' +
            '   - Use the expectedReplacements parameter with the exact number of occurrences you expect to replace\n' +
            '   - This will replace ALL occurrences of the searchContent with the replaceContent\n' +
            "   - If the actual number of matches doesn't equal expectedReplacements, the edit will fail\n" +
            '   - This is a safety feature to prevent unintended replacements\n' +
            '\n' +
            '3. VERIFICATION: Before using this tool:\n' +
            '   - Check how many instances of the target text exist in the file\n' +
            '   - If multiple instances exist, either:\n' +
            '     a) Gather enough context to uniquely identify each one and make separate calls, OR\n' +
            '     b) Use expectedReplacements parameter with the exact count of instances you expect to replace\n' +
            '\n' +
            'WARNING:\n' +
            "- The tool will fail if searchContent matches multiple locations and expectedReplacements isn't specified\n" +
            "- The tool will fail if the number of matches doesn't equal expectedReplacements when it's specified\n" +
            "- The tool will fail if searchContent doesn't match the file contents exactly (including whitespace)\n" +
            '- The tool will fail if searchContent and replaceContent are the same\n' +
            '\n' +
            'When making edits:\n' +
            '   - Ensure the edit results in idiomatic, correct code\n' +
            '   - Do not add trailing whitespace to lines (a newline at the end of a file is fine)\n' +
            '   - Do not leave the code in a broken state\n' +
            '\n' +
            'If you want to create a new file, use:\n' +
            '   - A new file path, including dir name if needed\n' +
            '   - An empty searchContent\n' +
            "   - The new file's contents as replaceContent\n" +
            '\n' +
            'Remember: when making multiple file edits in a row to the same file, you should prefer to send all edits in a single message with multiple calls to this tool, rather than multiple messages with a single call each.\n' +
            '\n' +
            'You may see the following fields in the result:\n' +
            '- autoFormattingEdits: If the auto-formatter makes any changes, this field will contain a diff against the file content after your edits and any user edits have been applied.\n' +
            '- newProblems: If any new problems are found after the edit, this field will contain information about them.',
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path of the file to modify (relative to the current working directory, or an absolute path).'
              },
              searchContent: {
                type: 'string',
                description: 'The text to replace.'
              },
              replaceContent: {
                type: 'string',
                description: 'The text to replace it with.'
              },
              expectedReplacements: {
                type: 'number',
                description: 'The expected number of replacements to perform. Defaults to 1 if not specified.'
              }
            },
            required: [
              'path',
              'searchContent',
              'replaceContent'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'askFollowupQuestion',
          description: 'Ask the user a question to gather additional information needed to complete the task. \n' +
            '\n' +
            '## When to Use This Tool\n' +
            'Use this tool in the following scenarios:\n' +
            "1. The user's request is ambiguous or unclear and requires clarification.\n" +
            '2. You need more details to proceed effectively.\n' +
            '3. You have made several unsuccessful attempts to solve the issue and need user guidance to move forward.\n' +
            '4. Offer choices to the user about what direction to take.\n' +
            '\n' +
            '## Usage Notes\n' +
            '- Users will always be able to select "Other" to provide custom text input\n' +
            '- Use multiSelect: true to allow multiple answers to be selected for a question\n' +
            '- If you recommend a specific option, make that the first option in the list and add "(Recommended)" at the end of the label\n' +
            '- Provide 1-4 questions per call\n' +
            '\n' +
            'IMPORTANT: This tool CANNOT be used in combination with other tools (except todoWrite) in a single step. If you need to use other tools, you must do so in a separate step before calling this tool.',
          parameters: {
            type: 'object',
            properties: {
              questions: {
                type: 'array',
                items: {
                  type: 'object',
                  properties: {
                    question: {
                      type: 'string',
                      description: 'The complete question to ask the user. Should be clear, specific, and end with a question mark.'
                    },
                    header: {
                      type: 'string',
                      maxLength: 12,
                      description: 'Very short label displayed as a chip/tag (max 12 chars). Examples: "Auth method", "Library", "Approach".'
                    },
                    options: {
                      type: 'array',
                      items: {
                        type: 'object',
                        properties: {
                          label: {
                            type: 'string',
                            description: 'Short button label shown to the user. Should be concise (1-5 words) and clearly describe the choice.'
                          },
                          description: {
                            type: 'string',
                            description: 'Explanation of what this option means or what will happen if chosen. Useful for providing context about trade-offs or implications.'
                          }
                        },
                        required: [
                          'label'
                        ],
                        additionalProperties: false
                      },
                      minItems: 2,
                      maxItems: 4,
                      description: "The available choices for this question. Must have 2-4 options. Each option should be a distinct, mutually exclusive choice (unless multiSelect is enabled). There should be no 'Other' option, that will be provided automatically."
                    },
                    multiSelect: {
                      type: 'boolean',
                      default: false,
                      description: 'Set to true to allow the user to select multiple options instead of just one. Use when choices are not mutually exclusive.'
                    }
                  },
                  required: [
                    'question',
                    'header',
                    'options'
                  ],
                  additionalProperties: false
                },
                minItems: 1,
                maxItems: 4,
                description: 'Questions to ask the user (1-4 questions).'
              }
            },
            required: [
              'questions'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'attemptCompletion',
          description: "Once you've received the results of tool uses and can confirm that the task is complete, use this tool to present the result of your work to the user.\n" +
            '\n' +
            'You MUST NOT generate any text before this tool call. All conclusion text must be included within the result parameter of the attemptCompletion tool.\n' +
            'Never use this tool with a question or request to engage in further conversation! Formulate the end of your result in a way that is final and does not require further input from the user.\n' +
            '\n' +
            'IMPORTANT: This tool CANNOT be used in combination with other tools (except todoWrite) in a single step. If you need to use other tools, you must do so in a separate step before calling this tool.',
          parameters: {
            '$schema': 'http://json-schema.org/draft-07/schema#',
            type: 'object',
            properties: {
              result: {
                description: 'The result of the task. Formulate this result in a way that is final and does not require further input from the user.',
                type: 'string'
              }
            },
            required: [
              'result'
            ],
            additionalProperties: false
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'executeCommand',
          description: 'Executes a given bash command in a persistent shell session with optional timeout, ensuring proper handling and security measures.\n' +
            '\n' +
            'IMPORTANT: This tool is for terminal operations like git, npm, docker, etc. DO NOT use it for file operations (reading, writing, editing, searching, finding files) - use the specialized tools for this instead.\n' +
            '\n' +
            'Before executing the command, please follow these steps:\n' +
            '\n' +
            '1. Directory Verification:\n' +
            '   - If the command will create new directories or files, first use listFiles to verify the parent directory exists and is the correct location\n' +
            '   - For example, before running "mkdir foo/bar", first use listFiles to check that "foo" exists and is the intended parent directory\n' +
            '\n' +
            '2. Command Execution:\n' +
            '   - Always quote file paths that contain spaces with double quotes (e.g., cd "path with spaces/file.txt")\n' +
            '   - Examples of proper quoting:\n' +
            '     - cd "/Users/name/My Documents" (correct)\n' +
            '     - cd /Users/name/My Documents (incorrect - will fail)\n' +
            '     - python "/path/with spaces/script.py" (correct)\n' +
            '     - python /path/with spaces/script.py (incorrect - will fail)\n' +
            '   - After ensuring proper quoting, execute the command.\n' +
            '   - Capture the output of the command.\n' +
            '\n' +
            'Usage notes:\n' +
            '- The command argument is required.\n' +
            '- You can specify an optional timeout in seconds (up to 300s / 5 minutes). If not specified, commands will timeout after 60s (1 minute).\n' +
            '- If the output exceeds 30000 characters, output will be truncated before being returned to you.\n' +
            '- When issuing multiple commands:\n' +
            '  - If the commands are independent and can run in parallel, make multiple executeCommand tool calls in a single message. For example, if you need to run "git status" and "git diff", send a single message with two executeCommand tool calls in parallel.\n' +
            '  - If the commands depend on each other and must run sequentially, use a single executeCommand call with \'&&\' to chain them together (e.g., `git add . && git commit -m "message" && git push`). For instance, if one operation must complete before another starts (like mkdir before cp, Write before executeCommand for git operations, or git add before git commit), run these operations sequentially instead.\n' +
            "  - Use ';' only when you need to run commands sequentially but don't care if earlier commands fail\n" +
            '  - DO NOT use newlines to separate commands (newlines are ok in quoted strings)\n' +
            "- You shall avoid use the markdown code block syntax (backtick, '`') in your command, as it will be interpreted as a command substitution.\n" +
            "- Before using this tool, you must first think about the context provided in <system-reminder> to understand the user's environment and tailor your commands to ensure they are compatible with their system. You must also consider if the command you need to run should be executed in a specific directory rather than the current working directory, and properly set the `cwd` if necessary.\n" +
            '\n' +
            '# Committing changes with git\n' +
            '\n' +
            'Only create commits when requested by the user. If unclear, ask first. When the user asks you to create a new git commit, follow these steps carefully:\n' +
            '\n' +
            'Git Safety Protocol:\n' +
            '- NEVER update the git config\n' +
            "- NEVER run destructive git commands (push --force, reset --hard, checkout ., restore ., clean -f, branch -D) unless the user explicitly requests these actions. Taking unauthorized destructive actions is unhelpful and can result in lost work, so it's best to ONLY run these commands when given direct instructions \n" +
            '- NEVER skip hooks (--no-verify, --no-gpg-sign, etc) unless the user explicitly requests it\n' +
            '- NEVER run force push to main/master, warn the user if they request it\n' +
            '- CRITICAL: Always create NEW commits rather than amending, unless the user explicitly requests a git amend. When a pre-commit hook fails, the commit did NOT happen  — so --amend would modify the PREVIOUS commit, which may result in destroying work or losing previous changes. Instead, after hook failure, fix the issue, re-stage, and create a NEW commit\n' +
            '- When staging files, prefer adding specific files by name rather than using "git add -A" or "git add .", which can accidentally include sensitive files (.env, credentials) or large binaries\n' +
            '- NEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked, otherwise the user will feel that you are being too proactive\n' +
            '\n' +
            '1. You can call multiple tools in a single response. When multiple independent pieces of information are requested and all commands are likely to succeed, run multiple tool calls in parallel for optimal performance. run the following bash commands in parallel, each using the executeCommand tool:\n' +
            '  - Run a git status command to see all untracked files. IMPORTANT: Never use the -uall flag as it can cause memory issues on large repos.\n' +
            '  - Run a git diff command to see both staged and unstaged changes that will be committed.\n' +
            "  - Run a git log command to see recent commit messages, so that you can follow this repository's commit message style.\n" +
            '2. Analyze all staged changes (both previously staged and newly added) and draft a commit message:\n' +
            '  - Summarize the nature of the changes (eg. new feature, enhancement to an existing feature, bug fix, refactoring, test, docs, etc.). Ensure the message accurately reflects the changes and their purpose (i.e. "add" means a wholly new feature, "update" means an enhancement to an existing feature, "fix" means a bug fix, etc.).\n' +
            '  - Do not commit files that likely contain secrets (.env, credentials.json, etc). Warn the user if they specifically request to commit those files\n' +
            '  - Draft a concise (1-2 sentences) commit message that focuses on the "why" rather than the "what"\n' +
            '  - Ensure it accurately reflects the changes and their purpose\n' +
            '3. You can call multiple tools in a single response. When multiple independent pieces of information are requested and all commands are likely to succeed, run multiple tool calls in parallel for optimal performance. run the following commands:\n' +
            '   - Add relevant untracked files to the staging area.\n' +
            '   - Create the commit with a message ending with:\n' +
            '   šŸ¤– Generated with [Pochi](https://getpochi.com) | [Task](<Share URL>)\n' +
            '\n' +
            '   Co-Authored-By: Pochi <noreply@getpochi.com>\n' +
            '\n' +
            '   Note: Replace <Share URL> with the Share URL from system information if available. If not available, omit the " | [Task](...)" part.\n' +
            '\n' +
            '   - Run git status after the commit completes to verify success.\n' +
            '   Note: git status depends on the commit completing, so run it sequentially after the commit.\n' +
            '4. If the commit fails due to pre-commit hook changes, retry the commit ONCE to include these automated changes. If it fails again, it usually means a pre-commit hook is preventing the commit. If the commit succeeds but you notice that files were modified by the pre-commit hook, you MUST amend your commit to include them.\n' +
            '\n' +
            'Important notes:\n' +
            '- NEVER update the git config\n' +
            '- NEVER run additional commands to read or explore code, besides git bash commands\n' +
            '- DO NOT push to the remote repository unless the user explicitly asks you to do so\n' +
            '- IMPORTANT: Never use git commands with the -i flag (like git rebase -i or git add -i) since they require interactive input which is not supported.\n' +
            '- IMPORTANT: Do not use --no-edit with git rebase commands, as the --no-edit flag is not a valid option for git rebase.\n' +
            '- If there are no changes to commit (i.e., no untracked files and no modifications), do not create an empty commit\n' +
            '- In order to ensure good formatting, ALWAYS pass the commit message via a HEREDOC, a la this example:\n' +
            '<example>\n' +
            `git commit -m "$(cat <<'EOF'\n` +
            'Commit message here.\n' +
            '\n' +
            'šŸ¤– Generated with [Pochi](https://getpochi.com) | [Task](<Share URL>)\n' +
            '\n' +
            'Co-Authored-By: Pochi <noreply@getpochi.com>\n' +
            'EOF\n' +
            ')"\n' +
            '</example>\n' +
            '\n' +
            '# Creating pull requests\n' +
            'Use the gh command via the executeCommand tool for ALL GitHub-related tasks including working with issues, pull requests, checks, and releases. If given a Github URL use the gh command to get the information needed.\n' +
            '\n' +
            'IMPORTANT: When the user asks you to create a pull request, follow these steps carefully:\n' +
            '\n' +
            '1. You can call multiple tools in a single response. When multiple independent pieces of information are requested and all commands are likely to succeed, run multiple tool calls in parallel for optimal performance. run the following bash commands in parallel using the executeCommand tool, in order to understand the current state of the branch since it diverged from the main branch:\n' +
            '   - Run a git status command to see all untracked files (never use -uall flag)\n' +
            '   - Run a git diff command to see both staged and unstaged changes that will be committed\n' +
            '   - Check if the current branch tracks a remote branch and is up to date with the remote, so you know if you need to push to the remote\n' +
            '   - Run a git log command and `git diff [base-branch]...HEAD` to understand the full commit history for the current branch (from the time it diverged from the base branch)\n' +
            '2. Analyze all changes that will be included in the pull request, making sure to look at all relevant commits (NOT just the latest commit, but ALL commits that will be included in the pull request!!!), and draft a pull request title and summary:\n' +
            '   - Keep the PR title short (under 70 characters)\n' +
            '   - Use the description/body for details, not the title\n' +
            '3. You can call multiple tools in a single response. When multiple independent pieces of information are requested and all commands are likely to succeed, run multiple tool calls in parallel for optimal performance. run the following commands in parallel:\n' +
            '   - Create new branch if needed\n' +
            '   - Push to remote with -u flag if needed\n' +
            '   - Create PR using gh pr create with the format below. Use a HEREDOC to pass the body to ensure correct formatting.\n' +
            '<example>\n' +
            `gh pr create --title "the pr title" --body "$(cat <<'EOF'\n` +
            '## Summary\n' +
            '<1-3 bullet points>\n' +
            '\n' +
            '## Test plan\n' +
            '[Checklist of TODOs for testing the pull request...]\n' +
            '\n' +
            'šŸ¤– Generated with [Pochi](https://getpochi.com) | [Task](<Share URL>)\n' +
            'EOF\n' +
            ')"\n' +
            '</example>\n' +
            '\n' +
            'Important:\n' +
            '- NEVER update the git confi'... 355 more characters,
          parameters: {
            type: 'object',
            properties: {
              command: {
                type: 'string',
                description: 'The CLI command to execute. This should be valid for the current operating system.'
              },
              cwd: {
                type: 'string',
                description: 'The working directory to execute the command in.'
              },
              timeout: {
                type: 'number',
                minimum: 1,
                maximum: 300,
                description: 'Optional timeout in seconds, max 300 seconds. By default the timeout is 120 seconds.'
              }
            },
            required: [
              'command'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'globFiles',
          description: 'Request to find files matching a glob pattern within a specified directory. Use this to get a list of files based on a pattern.',
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path of the directory to search in (relative to the current working directory, or an absolute path)'
              },
              globPattern: {
                type: 'string',
                description: "The glob pattern to match files against (e.g., '*.ts', '**/*.js')"
              }
            },
            required: [
              'path',
              'globPattern'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'listFiles',
          description: 'Request to list files and directories within the specified directory. If recursive is true, it will list all files and directories recursively. If recursive is false or not provided, it will only list the top-level contents. Do not use this tool to confirm the existence of files you may have created, as the user will let you know if the files were created successfully or not.',
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path of the directory to list contents for (relative to the current working directory, or an absolute path)'
              },
              recursive: {
                type: 'boolean',
                description: 'Whether to list files and directories recursively.'
              }
            },
            required: [
              'path'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'readFile',
          description: 'Request to read the contents of a file at the specified path. Use this when you need to examine the contents of an existing file you do not know the contents of, for example to analyze code, review text files, extract information from configuration files.\n' +
            '',
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path of the file to read (relative to the current working directory, or an absolute path)'
              },
              startLine: {
                type: 'number',
                description: 'The starting line number to read from (1-based). If not provided, it starts from the beginning of the file.'
              },
              endLine: {
                type: 'number',
                description: 'The ending line number to read to (1-based, inclusive). If not provided, it reads to the end of the file.'
              }
            },
            required: [
              'path'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'useSkill',
          description: 'Execute a skill within the main conversation\n' +
            '\n' +
            'When users ask you to perform tasks, check if any of the available skills below can help complete the task more effectively. Skills provide specialized capabilities and domain knowledge.\n' +
            '\n' +
            'When users ask about a SPECIFIC skill (e.g., "How does the pdf skill work?", "What does the commit skill do?"), you must call this tool to get detailed information about that skill.\n' +
            '\n' +
            'When users ask general questions like "What skills are available?" or "List all skills", simply refer to the "Available skills" section below - do NOT call this tool.\n' +
            '\n' +
            "This tool returns the skill's detailed instructions which you must then follow to complete the task. The instructions contain step-by-step guidance on how to perform the specific task or workflow.\n" +
            '\n' +
            'How to invoke:\n' +
            '- Use this tool with the skill name\n' +
            '- Example: `skill: "pdf-processing"` - invoke the pdf-processing skill\n' +
            "- The tool will return the skill's instructions\n" +
            '- Follow the returned instructions carefully to complete the task\n' +
            '\n' +
            'Important:\n' +
            '- When a skill is relevant for a task OR when users ask about a SPECIFIC skill, you must invoke this tool IMMEDIATELY as your first action\n' +
            '- For general questions about available skills, simply refer to the "Available skills" list below without calling this tool\n' +
            '- NEVER just announce or mention a skill in your text response without actually calling this tool (except for general skill listing requests)\n' +
            '- This is a BLOCKING REQUIREMENT: invoke the relevant Skill tool BEFORE generating any other response about a specific skill or task\n' +
            '- Only use skills listed in "Available skills" below\n' +
            '- Check compatibility requirements before using a skill - ensure the skill is compatible with the current OS/environment\n' +
            '- After calling this tool, follow the returned instructions step by step\n' +
            '- The skill file location is shown in the [Location: filepath] section of each skill listing below - use this information to understand where the skill is defined\n' +
            "- Use the directory containing the skill's source file as the base directory for resolving any resource files mentioned in the instructions\n" +
            '- Proactively explore the skill directory for optional resources that enhance task completion:\n' +
            '  * scripts/ - executable code that agents can run (Python, Bash, JavaScript, etc.)\n' +
            '  * references/ - on-demand documentation (REFERENCE.md, FORMS.md, domain-specific files)\n' +
            '  * assets/ - static resources (templates, images, data files, schemas)\n' +
            '  Use these resources when they exist and are relevant to the current task\n' +
            '\n' +
            'Available skills:\n' +
            '\n' +
            '- **find-skills**: Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill. [Location: _builtIn_]\n' +
            '- **create-skill**: Helps users create new custom agent skills. Use when the user wants to create a new skill, automate a workflow, or package specialized knowledge for reuse. [Location: _builtIn_]',
          parameters: {
            type: 'object',
            properties: {
              skill: {
                type: 'string',
                description: 'The name of the skill to use.'
              }
            },
            required: [
              'skill'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'searchFiles',
          description: '- Fast content search tool that works with any codebase size\n' +
            '- Searches file contents using regular expressions\n' +
            '- Supports Rust regex syntax (eg. "log.*Error", "functions+w+", etc.)\n' +
            '- Filter files by pattern with the include parameter (eg. "*.js", "*.{ts,tsx}")\n' +
            '- Returns file paths with at least one match sorted by modification time\n' +
            '- Use this tool when you need to find files containing specific patterns\n' +
            '- Craft your regex patterns carefully to balance specificity and flexibility.\n' +
            "- Based on the user's task you may use it to find code patterns, TODO comments, function definitions, or any text-based information across the project. The results include context, so analyze the surrounding code to better understand the matches. Leverage the this tool in combination with other tools for more comprehensive analysis. For example, use it to find specific code patterns, then use readFile to examine the full context of interesting matches before using applyDiff or writeToFile to make informed changes.",
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path of the directory to search in (relative to the current working directory, or an absolute path).'
              },
              regex: {
                type: 'string',
                description: 'The regular expression pattern to search for in file contents. Uses Rust regex syntax.'
              },
              filePattern: {
                type: 'string',
                description: 'File pattern to include in the search (e.g. "*.js", "*.{ts,tsx}"). If not provided, it will search all files.'
              }
            },
            required: [
              'path',
              'regex'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'todoWrite',
          description: 'Use this tool to create and manage a structured task list for your current coding session. This helps you track progress, organize complex tasks, and demonstrate thoroughness to the user.\n' +
            'It also helps the user understand the progress of the task and overall progress of their requests.\n' +
            '\n' +
            '## When to Use This Tool\n' +
            'Use this tool proactively in these scenarios:\n' +
            '\n' +
            '1. Complex multi-step tasks - When a task requires 3 or more distinct steps or actions\n' +
            '2. Non-trivial and complex tasks - Tasks that require careful planning or multiple operations\n' +
            '3. User explicitly requests todo list - When the user directly asks you to use the todo list\n' +
            '4. User provides multiple tasks - When users provide a list of things to be done (numbered or comma-separated)\n' +
            '5. After receiving new instructions - Immediately capture user requirements as todos. Feel free to edit the todo list based on new information.\n' +
            '6. After completing a task - Mark it complete and add any new follow-up tasks\n' +
            '7. When you start working on a new task, mark the todo as in-progress. Ideally you should only have one todo as in-progress at a time. Complete existing tasks before starting new ones.\n' +
            '\n' +
            '## When NOT to Use This Tool\n' +
            '\n' +
            'Skip using this tool when:\n' +
            '1. There is only a single, straightforward task\n' +
            '2. The task is trivial and tracking it provides no organizational benefit\n' +
            '3. The task can be completed in less than 3 trivial steps\n' +
            '4. The task is purely conversational or informational\n' +
            '\n' +
            'NOTE that you should use should not use this tool if there is only one trivial task to do. In this case you are better off just doing the task directly.\n' +
            '\n' +
            '## Examples of When to Use the Todo List\n' +
            '\n' +
            '<example>\n' +
            "User: I want to add a dark mode toggle to the application settings. Make sure you run the tests and build when you're done!\n" +
            "Assistant: I'll help add a dark mode toggle to your application settings. Let me create a todo list to track this implementation.\n" +
            '*Creates todo list with the following items:*\n' +
            '1. Create dark mode toggle component in Settings page\n' +
            '2. Add dark mode state management (context/store)\n' +
            '3. Implement CSS-in-JS styles for dark theme\n' +
            '4. Update existing components to support theme switching\n' +
            '5. Run tests and build process, addressing any failures or errors that occur\n' +
            '*Begins working on the first task*\n' +
            '\n' +
            '<reasoning>\n' +
            'The assistant used the todo list because:\n' +
            '1. Adding dark mode is a multi-step feature requiring UI, state management, and styling changes\n' +
            '2. The user explicitly requested tests and build be run afterward\n' +
            '3. The assistant inferred that tests and build need to pass by adding "Ensure tests and build succeed" as the final task\n' +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '<example>\n' +
            'User: Help me rename the function getCwd to getCurrentWorkingDirectory across my project\n' +
            "Assistant: Let me first search through your codebase to find all occurrences of 'getCwd'.\n" +
            '*Uses grep or search tools to locate all instances of getCwd in the codebase*\n' +
            "Assistant: I've found 15 instances of 'getCwd' across 8 different files. Let me create a todo list to track these changes.\n" +
            '*Creates todo list with specific items for each file that needs updating*\n' +
            '\n' +
            '<reasoning>\n' +
            'The assistant used the todo list because:\n' +
            '1. First, the assistant searched to understand the scope of the task\n' +
            '2. Upon finding multiple occurrences across different files, it determined this was a complex task with multiple steps\n' +
            '3. The todo list helps ensure every instance is tracked and updated systematically\n' +
            '4. This approach prevents missing any occurrences and maintains code consistency\n' +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '\n' +
            '<example>\n' +
            'User: I need to implement these features for my e-commerce site: user registration, product catalog, shopping cart, and checkout flow.\n' +
            "Assistant: I'll help implement these features. First, let's add all the features to the todo list.\n" +
            '*Creates a todo list breaking down each feature into specific tasks based on the project architecture*\n' +
            "Assistant: Let's start with user registration. This will involve creating database models, API endpoints, and frontend forms that integrate with your existing authentication system.\n" +
            '\n' +
            '<reasoning>\n' +
            'The assistant used the todo list because:\n' +
            '1. The user provided multiple complex features to implement in a comma separated list\n' +
            '2. The todo list helps organize these large features into manageable tasks\n' +
            '3. This approach allows for tracking progress across the entire implementation\n' +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '<example>\n' +
            "User: Can you help optimize my React application? It's rendering slowly and has performance issues.</user>\n" +
            "Assistant: I'll help optimize your React application. First, let me examine your codebase to identify potential performance bottlenecks.\n" +
            '*Reviews component structure, render patterns, state management, and data fetching*\n' +
            "Assistant: After analyzing your codebase, I've identified several performance issues. Let me create a todo list to track our optimization efforts.\n" +
            '*Creates todo list with items like: 1) Implement memoization for expensive calculations in ProductList, 2) Add virtualization for long lists in Dashboard, 3) Optimize image loading in Gallery component, 4) Fix state update loops in ShoppingCart, 5) Review bundle size and implement code splitting*\n' +
            "Let's start by implementing memoization for the expensive calculations in your ProductList component.</assistant>\n" +
            '\n' +
            '<reasoning>\n' +
            'The assistant used the todo list because:\n' +
            '1. First, the assistant examined the codebase to identify specific performance issues\n' +
            '2. Based on this analysis, it identified multiple optimization opportunities\n' +
            '3. Performance optimization is a non-trivial task requiring multiple steps\n' +
            '4. The todo list helps methodically track improvements across different components\n' +
            '5. This systematic approach ensures all performance bottlenecks are addressed\n' +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '## Examples of When NOT to Use the Todo List\n' +
            '\n' +
            '<example>\n' +
            "User: How do I print 'Hello World' in Python?\n" +
            'Assistant: In Python, you can print "Hello World" with this simple code:\n' +
            '\n' +
            'python\n' +
            'print("Hello World")\n' +
            '\n' +
            'This will output the text "Hello World" to the console when executed.</assistant>\n' +
            '\n' +
            '<reasoning>\n' +
            "The assistant did not use the todo list because this is a single, trivial task that can be completed in one step. There's no need to track multiple tasks or steps for such a straightforward request.\n" +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '<example>\n' +
            'User: What does the git status command do?\n' +
            "Assistant: The git status command shows the current state of your working directory and staging area. It displays which changes have been staged, which haven't, and which files aren't being tracked by Git. This is a fundamental command for understanding the current state of your repository before making commits.\n" +
            '\n' +
            '<reasoning>\n' +
            'The assistant did not use the todo list because this is an informational request with no actual coding task to complete. The user is simply asking for an explanation, not for the assistant to perform multiple steps or tasks.\n' +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '<example>\n' +
            'User: Can you add a comment to the calculateTotal function to explain what it does?\n' +
            'Assistant: Sure, let me add a comment to the calculateTotal function to explain what it does.\n' +
            '* Uses the Edit tool to add a comment to the calculateTotal function *\n' +
            '\n' +
            '<reasoning>\n' +
            "The assistant did not use the todo list because this is a single, straightforward task confined to one location in the code. Adding a comment doesn't require tracking multiple steps or systematic organization.\n" +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '<example>\n' +
            'User: Run npm install for me and tell me what happens.\n' +
            "Assistant: I'll run the npm install command for you.\n" +
            '\n' +
            '*Executes: npm install*\n' +
            '\n' +
            "The command completed successfully. Here's the output:\n" +
            '[Output of npm install command]\n' +
            '\n' +
            'All dependencies have been installed according to your package.json file.\n' +
            '\n' +
            '<reasoning>\n' +
            'The assistant did not use the todo list because this is a single command execution with immediate results. There are no multiple steps to track or organize, making the todo list unnecessary for this straightforward task.\n' +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '## Task States and Management\n' +
            '\n' +
            '1. **Task States**: Use these states to track progress:\n' +
            '   - pending: Task not yet started\n' +
            '   - in-progress: Currently working on (limit to ONE task at a time)\n' +
            '   - completed: Task finished successfully\n' +
            '   - cancelled: Task no longer needed\n' +
            '\n' +
            '2. **Task Management**:\n' +
            '   - Update task status in real-time as you work\n' +
            "   - Mark tasks complete IMMEDIATELY after finishing (don't batch completions)\n" +
            '   - Only have ONE task in-progress at any time\n' +
            '   - Complete current tasks before starting new ones\n' +
            '   - Cancel tasks that become irrelevant\n' +
            '\n' +
            '3. **Task Breakdown**:\n' +
            '   - Create specific, actionable items\n' +
            '   - Break complex tasks into smaller, manageable steps\n' +
            '   - Use clear, descriptive task names\n' +
            '\n' +
            'When in doubt, use this tool. Being proactive with task management demonstrates attentiveness and ensures you complete all requirements successfully.',
          parameters: {
            type: 'object',
            properties: {
              todos: {
                type: 'array',
                items: {
                  type: 'object',
                  properties: {
                    id: {
                      type: 'string',
                      description: 'The unique identifier of the task, e.g "collect-information".'
                    },
                    content: {
                      type: 'string',
                      description: 'The content of the task.'
                    },
                    status: {
                      type: 'string',
                      enum: [
                        'pending',
                        'in-progress',
                        'completed',
                        'cancelled'
                      ],
                      description: 'The status of the task.'
                    },
                    priority: {
                      type: 'string',
                      enum: [
                        'low',
                        'medium',
                        'high'
                      ],
                      description: 'The priority of the task.'
                    }
                  },
                  required: [
                    'id',
                    'content',
                    'status',
                    'priority'
                  ],
                  additionalProperties: false
                }
              }
            },
            required: [
              'todos'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'writeToFile',
          description: 'Request to write full content to a file at the specified path.\n' +
            'If the file exists, it will be overwritten with the provided content.\n' +
            "If the file doesn't exist, it will be created. This tool will automatically create any directories needed to write the file.\n" +
            '\n' +
            'You may see the following fields in the result:\n' +
            '- autoFormattingEdits: If the auto-formatter makes any changes, this field will contain a diff against the file content after your edits and any user edits have been applied.\n' +
            '- newProblems: If any new problems are found after the edit, this field will contain information about them.',
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path of the file to write to (relative to the current working directory, or an absolute path).'
              },
              content: {
                type: 'string',
                description: 'The content to write to the file.'
              }
            },
            required: [
              'path',
              'content'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'editNotebook',
          description: 'Edit a specific cell in a Jupyter notebook (.ipynb file) by its cell ID',
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path to the notebook file (relative to the current working directory, or an absolute path)'
              },
              cellId: {
                type: 'string',
                description: 'The ID of the cell to edit'
              },
              content: {
                type: 'string',
                description: 'The new content of the cell'
              }
            },
            required: [
              'path',
              'cellId',
              'content'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'newTask',
          description: 'Launch a new agent to handle complex, multi-step tasks autonomously.\n' +
            'When using the newTask tool, you may specify a agentType parameter to select which agent type to use.\n' +
            'Available agent types and the tools they have access to:\n' +
            '\n' +
            '### planner\n' +
            'Engage this agent to formulate comprehensive, technical implementation strategies for feature development, system refactoring, or defect resolution.\n' +
            'This agent is strictly limited to planning and architectural design; it DOES NOT execute code modifications.\n' +
            '\n' +
            'Examples of user requests this agent shall trigger:\n' +
            '- "create a plan to implement the user authentication feature"\n' +
            '- "how should we refactor the database schema"\n' +
            '- "design a solution for the memory leak issue"\n' +
            '\n' +
            '### browser\n' +
            'Web browser automation agent for navigating websites, interacting with pages, and extracting information. Uses agent-browser CLI for headless browser control.\n' +
            '\n' +
            '### reviewer\n' +
            'Engage this agent to perform code reviews and leave inline comments.\n' +
            'This agent can analyze code and create review comments on specific lines.\n' +
            '\n' +
            'Examples of user requests this agent shall trigger:\n' +
            '- "review the code in src/auth"\n' +
            '- "add review comments to this file"\n' +
            '- "check this code and leave feedback"\n' +
            '\n' +
            '### walkthrough\n' +
            'Engage this agent to create a summary of the changes made in the current task.\n' +
            'This agent is strictly limited to documentation and explanation; it DOES NOT execute code modifications.\n' +
            '\n' +
            'Examples of user requests this agent shall trigger:\n' +
            '- "summarize what we have done"\n' +
            '- "create a walkthrough for the changes"\n' +
            '- "explain the changes made in this task"\n' +
            '\n' +
            '### explore\n' +
            'Use this agent to explore the codebase when you need to: understand project structure, find where features are implemented, locate specific functions or classes, analyze code patterns, investigate how something works, search for examples or usage, or gather information before making changes.\n' +
            '\n' +
            'Examples of questions this agent shall trigger:\n' +
            '- "where is the authentication logic implemented"\n' +
            '- "find all usages of the config parser"\n' +
            '- "how does the ignore-walk module work"\n' +
            '\n' +
            '\n' +
            'Always include a reminder in your prompt to ensure the result will be submitted through the `attemptCompletion` tool.\n' +
            'If the task stops without submitting the result, it will return an error message.\n' +
            '\n' +
            'You can optionally run agents in the background using the runAsync parameter. You can continue working while background agents run.\n' +
            '\n' +
            'When NOT to use the newTask tool:\n' +
            '- If you want to read a specific file path, use the readFile or globFiles tool instead of the newTask tool, to find the match more quickly\n' +
            '- If you are searching for a specific class definition like "class Foo", use the globFiles tool instead, to find the match more quickly\n' +
            '- If you are searching for code within a specific file or set of 2-3 files, use the readFile tool instead of the newTask tool, to find the match more quickly\n' +
            '- Other tasks that are not related to the agent descriptions above\n' +
            '\n' +
            'Usage notes:\n' +
            '1. Launch multiple agents tools concurrently whenever possible to maximize performance; to do that, use a single message with multiple tool uses\n' +
            '2. When the agent is done, it will return a single message back to you. The result returned by the agent is not visible to the user. To show the user the result, you should send a text message back to the user with a concise summary of the result.\n' +
            '3. Each agent invocation is stateless. You will not be able to send additional messages to the agent, nor will the agent be able to communicate with you outside of its final report. Therefore, your prompt should contain a highly detailed task description for the agent to perform autonomously and you should specify exactly what information the agent should return back to you in its final and only message to you.\n' +
            "4. The agent's outputs should generally be trusted\n" +
            "5. Clearly tell the agent whether you expect it to write code or just to do research (search, file reads, web fetches, etc.), since it is not aware of the user's intent\n" +
            '6. If the agent description mentions that it should be used proactively, then you should try your best to use it without the user having to ask for it first. Use your judgement.',
          parameters: {
            type: 'object',
            properties: {
              description: {
                type: 'string',
                description: 'A short description of the task.'
              },
              prompt: {
                type: 'string',
                description: 'The detailed prompt for the task to be performed.'
              },
              agentType: {
                type: 'string',
                description: 'The type of the specialized agent to use for the task.'
              },
              runAsync: {
                type: 'boolean',
                description: 'Set to true to run this agent in the background.'
              }
            },
            required: [
              'description',
              'prompt'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'startBackgroundJob',
          description: 'Start a background job to execute a bash command, which allows you to continue working while the job runs.\n' +
            '\n' +
            'Before starting the background job, please follow these steps:\n' +
            '\n' +
            '1. Directory Verification:\n' +
            '   - If the command will create new directories or files, first use the listFiles tool to verify the parent directory exists and is the correct location\n' +
            '   - For example, before running "mkdir foo/bar", first use listFiles to check that "foo" exists and is the intended parent directory\n' +
            '\n' +
            '2. Job Execution:\n' +
            '   - After ensuring proper quoting, start the background job.\n' +
            '\n' +
            'Usage notes:\n' +
            '- The command argument is required.\n' +
            '- Use readBackgroundJobOutput to monitor the output and status of the job.\n' +
            '- Use killBackgroundJob to terminate the job if needed.\n' +
            '- If the output exceeds 30000 characters, output will be truncated before being returned to you.\n' +
            '\n' +
            'Common use cases and examples:\n' +
            '- Development servers: `npm run dev`, `yarn start`, `bun run dev`\n' +
            '- Build processes: `npm run build`, `make`, `cargo build`\n' +
            '- File watchers: `npm run watch`, `tsc --watch`\n' +
            '- Testing: `npm run test:watch`, `jest --watch`\n' +
            '- Database services: `docker run -p 5432:5432 postgres`\n' +
            '\n' +
            'Command execution rules:\n' +
            "- Never run 'sleep' as it will return immediately.\n" +
            "- You do not need to use '&' at the end of the command.\n" +
            "- When issuing multiple commands, use the ';' or '&&' operator to separate them. DO NOT use newlines (newlines are ok in quoted strings).\n" +
            "- You shall avoid use the markdown code block syntax (backtick, '`') in your command, as it will be interpreted as a command substitution.",
          parameters: {
            type: 'object',
            properties: {
              command: {
                type: 'string',
                description: 'The CLI command to execute. This should be valid for the current operating system.'
              },
              cwd: {
                type: 'string',
                description: 'The working directory to execute the command in.'
              }
            },
            required: [
              'command'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'readBackgroundJobOutput',
          description: '- Retrieves output from a running or completed background job or async task\n' +
            '- Takes a backgroundJobId parameter identifying the job or task\n' +
            '- For terminal jobs, returns only new output since the last check\n' +
            '- For task IDs, returns the latest attemptCompletion result once completed\n' +
            '- Returns stdout and stderr output along with job status\n' +
            '- Supports optional regex filtering to show only lines matching a pattern\n' +
            '- Use this tool when you need to monitor or check the output of a long-running background job',
          parameters: {
            type: 'object',
            properties: {
              backgroundJobId: {
                type: 'string',
                description: 'The ID of the background job to get output from'
              },
              regex: {
                type: 'string',
                description: 'Optional regular expression to filter the output lines. Only lines matching this regex will be included in the result. Any lines that do not match will no longer be available to read.'
              }
            },
            required: [
              'backgroundJobId'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'killBackgroundJob',
          description: '- Kills a running background job by its ID\n' +
            '- Takes a backgroundJobId parameter identifying the job to kill\n' +
            '- Returns a success or failure status\n' +
            '- Use this tool when you need to terminate a long-running background job',
          parameters: {
            type: 'object',
            properties: {
              backgroundJobId: {
                type: 'string',
                description: 'The ID of the background job to kill.'
              }
            },
            required: [
              'backgroundJobId'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'webFetch',
          description: '- Fetches content from a specified URL and converts HTML to markdown\n' +
            '- Use this tool when you need to retrieve and analyze web content\n' +
            '\n' +
            'Usage notes:\n' +
            '  - IMPORTANT: If an MCP-provided web fetch tool is available, prefer using that tool instead of this one, as it may have fewer restrictions.\n' +
            '  - The URL must be a fully-formed valid URL\n' +
            '  - The prompt should describe what information you want to extract from the page\n' +
            '  - This tool is read-only and does not modify any files\n' +
            '  - Includes a self-cleaning 10-minute cache for faster responses when repeatedly accessing the same URL',
          parameters: {
            '$schema': 'https://json-schema.org/draft/2020-12/schema',
            type: 'object',
            properties: {
              url: {
                type: 'string',
                format: 'uri'
              }
            },
            required: [
              'url'
            ],
            additionalProperties: false
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'webSearch',
          description: '- Allows Pochi to search the web and use the results to inform responses\n' +
            '- Provides up-to-date information for current events and recent data\n' +
            '- Returns search result information formatted as search result blocks, including links as markdown hyperlinks\n' +
            '- Searches are performed automatically within a single API call\n' +
            '\n' +
            'CRITICAL REQUIREMENT - You MUST follow this:\n' +
            `  - After answering the user's question, you MUST include a "Sources:" section at the end of your response\n` +
            '  - In the Sources section, list all relevant URLs from the search results as markdown hyperlinks: [Title](URL)\n' +
            '  - This is MANDATORY - never skip including sources in your response\n' +
            '  - Example format:\n' +
            '\n' +
            '    [Your answer here]\n' +
            '\n' +
            '    Sources:\n' +
            '    - [Source Title 1](https://example.com/1)\n' +
            '    - [Source Title 2](https://example.com/2)\n' +
            '\n' +
            'Usage notes:\n' +
            `  - Account for "Today's date" in <system-reminder>. For example, if <system-reminder> says "Today's date: 2025-07-01", and the user wants the latest docs, do not use 2024 in the search query. Use 2025.`,
          parameters: {
            '$schema': 'https://json-schema.org/draft/2020-12/schema',
            type: 'object',
            properties: {
              query: {
                description: 'The search query to perform',
                type: 'string'
              },
              country: {
                description: "Country code to filter search results by, e.g. 'US', 'GB', 'JP'",
                type: 'string'
              }
            },
            required: [
              'query'
            ],
            additionalProperties: false
          }
        }
      }
    ],
    tool_choice: 'auto',
    stream: true
  }
}
2026-03-19 09:19:05.795	DEBUG	/$bunfs/pochi:454339	listFiles	Listing workspace files from /root with maxItems 500
2026-03-19 09:19:34.594	DEBUG	/$bunfs/pochi:454339	listFiles	Listing workspace files from /root with maxItems 500
2026-03-19 09:19:34.732	ERROR	/$bunfs/pochi:432009	LiveChatKit	onError

 AI_APICallError  This request would exceed your organization's rate limit of 2,000,000 input tokens per minute (org: e70c8d22-9099-49c5-a9af-e059e6515b76, model: claude-opus-4-6). For details, refer to: https://docs.claude.com/en/api/rate-limits. You can see the response headers for current usage. Please reduce the prompt length or the maximum tokens requested, or try again later. You may also contact sales at https://claude.com/contact-sales to discuss your options for a rate limit increase., AI_APICallError, , https://api.anthropic.com/v1/chat/completions, [object Object], 429, [object Object], {"error":{"code":"rate_limit_error","message":"This request would exceed your organization's rate limit of 2,000,000 input tokens per minute (org: e70c8d22-9099-49c5-a9af-e059e6515b76, model: claude-opus-4-6). For details, refer to: https://docs.claude.com/en/api/rate-limits. You can see the response headers for current usage. Please reduce the prompt length or the maximum tokens requested, or try again later. You may also contact sales at https://claude.com/contact-sales to discuss your options for a rate limit increase.","type":"invalid_request_error","param":null}}, true, [object Object], 423231, 30, 423231, 30, /$bunfs/root/pochi
error stack:
  • pochi	<anonymous>
	/$bunfs/pochi:423231
  • pochi	async <anonymous>
	/$bunfs/pochi:423092
  • native	processTicksAndRejections
	native:7
2026-03-19 09:19:34.747	ERROR	/$bunfs/pochi:502749	TaskRunner	Task is failed, trying to resend last message to resume it. {
  kind: 'APICallError',
  isRetryable: true,
  message: "This request would exceed your organization's rate limit of 2,000,000 input tokens per minute (org: e70c8d22-9099-49c5-a9af-e059e6515b76, model: claude-opus-4-6). For details, refer to: https://docs.claude.com/en/api/rate-limits. You can see the response headers for current usage. Please reduce the prompt length or the maximum tokens requested, or try again later. You may also contact sales at https://claude.com/contact-sales to discuss your options for a rate limit increase.",
  requestBodyValues: {
    model: 'claude-opus-4-6',
    max_tokens: 4096,
    messages: [
      {
        role: 'system',
        content: 'You are Pochi, a highly skilled software engineer with extensive knowledge in many programming languages, frameworks, design patterns, and best practices.\n' +
          '\n' +
          'IMPORTANT: You must NEVER generate or guess URLs for the user unless you are confident that the URLs are for helping the user with programming. You may use URLs provided by the user in their messages or local files.\n' +
          '\n' +
          'If the user asks for help or wants to give feedback inform them of the following:\n' +
          '- Join the discord channel at https://getpochi.com/discord to ask questions and get help\n' +
          '- To report bugs, users should report the issue at https://github.com/TabbyML/pochi/issues\n' +
          '\n' +
          "When the user directly asks about Pochi (eg 'can Pochi do...', 'does Pochi have...') or asks in second person (eg 'are you able...', 'can you do...'), first use curl to gather information to answer the question from Pochi docs at https://docs.getpochi.com/llms.txt\n" +
          '\n' +
          '====\n' +
          '\n' +
          'TASK MANAGEMENT\n' +
          '\n' +
          'You have access to the todoWrite tool to help you manage and plan tasks. Use these tools VERY frequently to ensure that you are tracking your tasks and giving the user visibility into your progress.\n' +
          'These tools are also EXTREMELY helpful for planning tasks, and for breaking down larger complex tasks into smaller steps. If you do not use this tool when planning, you may forget to do important tasks - and that is unacceptable.\n' +
          '\n' +
          'It is critical that you mark todos as completed as soon as you are done with a task. Do not batch up multiple tasks before marking them as completed.\n' +
          '\n' +
          '====\n' +
          '\n' +
          'RULES\n' +
          '\n' +
          "- User messages may include <system-reminder> tags. <system-reminder> tags contain useful information and reminders. They are NOT part of the user's provided input or the tool result. You shall pay close attention to information in these tags and use it to inform you actions.\n" +
          "- When the user initially gives you a task, a recursive list of all filepaths in the current working directory will be included in <system-reminder> tag. This provides an overview of the project's file structure, offering key insights into the project from directory/file names (how developers conceptualize and organize their code) and file extensions (the language used). This can also guide decision-making on which files to explore further. If you need to further explore directories such as outside the current working directory, you can use the listFiles tool. If you pass 'true' for the recursive parameter, it will list files recursively.\n" +
          '- All file paths used by tools must be relative to current working directory, do not use the ~ character or $HOME to refer to the home directory in file paths used by tools.\n' +
          "- You can use `pochi://` URI schema to access the Pochi virtual file system. This allows you to read and write files that are stored in Pochi's internal storage.\n" +
          "- Be sure to consider the type of project (e.g. Python, JavaScript, web application) when determining the appropriate structure and files to include. Also consider what files may be most relevant to accomplishing the task, for example looking at a project's manifest file would help you understand the project's dependencies, which you could incorporate into any code you write.\n" +
          "- Do not ask for more information than necessary. Use the tools provided to accomplish the user's request efficiently and effectively. When you've completed your task, you must use the attemptCompletion tool to present the result to the user. The user may provide feedback, which you can use to make improvements and try again.\n" +
          '- You are only allowed to ask the user questions using the askFollowupQuestion tool. Use this tool only when you need additional details to complete a task, and be sure to use a clear and concise question that will help you move forward with the task. However if you can use the available tools to avoid having to ask the user questions, you should do so. For example, if the user mentions a file that may be in an outside directory like the Desktop, you should use the listFiles tool to list the files in the Desktop and check if the file they are talking about is there, rather than asking the user to provide the file path themselves.\n' +
          `- You are STRICTLY FORBIDDEN from starting your messages with "Great", "Certainly", "Okay", "Sure". You should NOT be conversational in your responses, but rather direct and to the point. For example you should NOT say "Great, I've updated the CSS" but instead something like "I've updated the CSS". It is important you be clear and technical in your messages.\n` +
          "- Once you've completed the user's task, you MUST use the attemptCompletion tool to present the result of the task to the user. It is STRICTLY FORBIDDEN to complete the task without using this tool.\n" +
          '- When planning large-scale changes, create a high-level diagram using mermaid in Markdown. This helps explain your plan and allows you to gather user feedback before implementation.'
      },
      {
        role: 'user',
        content: [
          {
            type: 'text',
            text: '<system-reminder># System Information\n' +
              '\n' +
              'Operating System: linux\n' +
              'Default Shell: \n' +
              'Home Directory: /root\n' +
              'Current Working Directory: /root\n' +
              'Current Time: Thu Mar 19 2026 09:17:12 GMT+0000 (Coordinated Universal Time)\n' +
              '\n' +
              '# User Information\n' +
              '- Name: Test User\n' +
              '- Email: test@example.com\n' +
              '\n' +
              '# Current Working Directory (/root) Files\n' +
              '.bashrc\n' +
              '.profile\n' +
              '.daytona\n' +
              '.pochi\n' +
              '.gitconfig\n' +
              '.daytona/sessions\n' +
              '.pochi/config.jsonc\n' +
              '.daytona/sessions/a3777110-8132-47af-b51b-5923306e85aa\n' +
              '.daytona/sessions/693f5c50-112b-4d7e-b770-9650df4dec45\n' +
              '.daytona/sessions/380662f8-8805-47f4-91d4-31c76feba356\n' +
              '.daytona/sessions/9fa6e4a8-0a92-4a65-ac29-ae9e066c28a4\n' +
              '.daytona/sessions/a3777110-8132-47af-b51b-5923306e85aa/b4ba62f8-aee3-4106-9aef-66f6c5df79f2\n' +
              '.daytona/sessions/693f5c50-112b-4d7e-b770-9650df4dec45/ebb5ee05-6f54-4f88-9e78-089e3dc49fda\n' +
              '.daytona/sessions/380662f8-8805-47f4-91d4-31c76feba356/d6e3820d-c720-4dd4-b5a4-372b6a6f4077\n' +
              '.daytona/sessions/9fa6e4a8-0a92-4a65-ac29-ae9e066c28a4/4f04fe80-a746-46a5-b898-0d363239583c\n' +
              '.daytona/sessions/a3777110-8132-47af-b51b-5923306e85aa/b4ba62f8-aee3-4106-9aef-66f6c5df79f2/exit_code\n' +
              '.daytona/sessions/693f5c50-112b-4d7e-b770-9650df4dec45/ebb5ee05-6f54-4f88-9e78-089e3dc49fda/exit_code\n' +
              '.daytona/sessions/380662f8-8805-47f4-91d4-31c76feba356/d6e3820d-c720-4dd4-b5a4-372b6a6f4077/exit_code\n' +
              '\n' +
              '# GIT STATUS\n' +
              'Current branch: \n' +
              'Main branch (you will usually use this for PRs): \n' +
              '\n' +
              'Recent commits:\n' +
              '\n' +
              '\n' +
              '# TODOs\n' +
              'No TODOs yet, if you are working on tasks that would benefit from a todo list please use the todoWrite tool to create one.</system-reminder>'
          },
          {
            type: 'text',
            text: 'You are a developer migrating from Git to Jujutsu (jj). You have an existing local Git repository at `/home/user/my-project`. Your task is to start using jj with this repository without breaking Git compatibility.\\n\\n1. Navigate to `/home/user/my-project`.\\n2. Initialize a colocated jj repository so that jj and Git can be used together.\\n3. Create a new bookmark named `feature-x`.\\n4. Create a new file named `feature.txt` containing the text `Hello jj`.\\n5. Create a new jj commit (or describe the working copy) with the description `Add feature.txt`.\\n\\nWhen finished, the repository should be a valid colocated jj/Git repo, the `feature-x` bookmark should exist and be exported to Git, and the commit should have the specified description and file.'
          }
        ]
      },
      {
        role: 'assistant',
        content: '\n' +
          '\n' +
          "I'll work through this step-by-step, migrating the Git repository to use Jujutsu (jj) in colocated mode.",
        tool_calls: [
          {
            id: 'toolu_011rCkj2REAg3R87c4PHJkcQ',
            type: 'function',
            function: {
              name: 'todoWrite',
              arguments: `{"todos":[{"id":"check-repo","content":"Check if /home/user/my-project exists and has a Git repo","status":"in-progress","priority":"high"},{"id":"init-jj","content":"Initialize colocated jj repository","status":"pending","priority":"high"},{"id":"create-bookmark","content":"Create feature-x bookmark","status":"pending","priority":"high"},{"id":"create-file","content":"Create feature.txt with 'Hello jj'","status":"pending","priority":"high"},{"id":"describe-commit","content":"Describe/create commit with 'Add feature.txt'","status":"pending","priority":"high"},{"id":"verify","content":"Verify colocated repo, bookmark, and commit","status":"pending","priority":"high"}]}`
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_011rCkj2REAg3R87c4PHJkcQ',
        content: '{"success":true}'
      },
      {
        role: 'assistant',
        content: '',
        tool_calls: [
          {
            id: 'toolu_0174ARF4pbW41KSU4HQtRVw4',
            type: 'function',
            function: {
              name: 'executeCommand',
              arguments: '{"command":"ls -la /home/user/my-project 2>/dev/null; echo \\"---\\"; ls -la /home/user/my-project/.git 2>/dev/null"}'
            }
          },
          {
            id: 'toolu_01FmkuNLXYsjxvTsBfVmHFba',
            type: 'function',
            function: {
              name: 'executeCommand',
              arguments: '{"command":"which jj && jj --version"}'
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_0174ARF4pbW41KSU4HQtRVw4',
        content: '{"output":"total 8\\r\\ndrwxr-xr-x 3 root root   47 Mar 11 12:10 .\\r\\ndrwxr-xr-x 1 root root   32 Mar 11 12:10 ..\\r\\ndrwxr-xr-x 8 root root 4096 Mar 11 12:10 .git\\r\\n-rw-r--r-- 1 root root   15 Mar 11 12:10 README.md\\r\\n---\\r\\ntotal 28\\r\\ndrwxr-xr-x 8 root root 4096 Mar 11 12:10 .\\r\\ndrwxr-xr-x 3 root root   47 Mar 11 12:10 ..\\r\\n-rw-r--r-- 1 root root   15 Mar 11 12:10 COMMIT_EDITMSG\\r\\n-rw-r--r-- 1 root root   21 Mar 11 12:10 HEAD\\r\\ndrwxr-xr-x 2 root root    6 Mar 11 12:10 branches\\r\\n-rw-r--r-- 1 root root   92 Mar 11 12:10 config\\r\\n-rw-r--r-- 1 root root   73 Mar 11 12:10 description\\r\\ndrwxr-xr-x 2 root root 4096 Mar 11 12:10 hooks\\r\\n-rw-r--r-- 1 root root  137 Mar 11 12:10 index\\r\\ndrwxr-xr-x 2 root root   29 Mar 11 12:10 info\\r\\ndrwxr-xr-x 3 root root   30 Mar 11 12:10 logs\\r\\ndrwxr-xr-x 7 root root   84 Mar 11 12:10 objects\\r\\ndrwxr-xr-x 4 root root   43 Mar 11 12:10 refs\\r\\n","isTruncated":false}'
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_01FmkuNLXYsjxvTsBfVmHFba',
        content: '{"output":"/usr/local/bin/jj\\r\\njj 0.38.0-2508982cde5c7e4db0933e0b6469f9e778e71e28\\r\\n","isTruncated":false}'
      },
      {
        role: 'assistant',
        content: 'The Git repository exists at `/home/user/my-project` with a `README.md` file, and `jj` v0.38.0 is installed.',
        tool_calls: [
          {
            id: 'toolu_01ULas2uw3TnyRPAHN6aUhhT',
            type: 'function',
            function: {
              name: 'todoWrite',
              arguments: `{"todos":[{"id":"check-repo","content":"Check if /home/user/my-project exists and has a Git repo","status":"completed","priority":"high"},{"id":"init-jj","content":"Initialize colocated jj repository","status":"in-progress","priority":"high"},{"id":"create-bookmark","content":"Create feature-x bookmark","status":"pending","priority":"high"},{"id":"create-file","content":"Create feature.txt with 'Hello jj'","status":"pending","priority":"high"},{"id":"describe-commit","content":"Describe/create commit with 'Add feature.txt'","status":"pending","priority":"high"},{"id":"verify","content":"Verify colocated repo, bookmark, and commit","status":"pending","priority":"high"}]}`
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_01ULas2uw3TnyRPAHN6aUhhT',
        content: '{"success":true}'
      },
      {
        role: 'assistant',
        content: '**Step 1 & 2: Initialize a colocated jj repository.** The `--colocate` flag (or running `jj git init --colocate` inside an existing Git repo) sets up jj to share the `.git` directory, so both tools work together.',
        tool_calls: [
          {
            id: 'toolu_019jY8xFeB1m7PfbXfapjtni',
            type: 'function',
            function: {
              name: 'executeCommand',
              arguments: '{"command":"cd /home/user/my-project && jj git init --colocate"}'
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_019jY8xFeB1m7PfbXfapjtni',
        content: '{"output":"Done importing changes from the underlying Git repo.\\r\\nInitialized repo in \\".\\"\\r\\nHint: Running `git clean -xdf` will remove `.jj/`!\\r\\n","isTruncated":false}'
      },
      {
        role: 'assistant',
        content: 'Colocated jj repository initialized. Let me verify the `.jj` directory was created alongside `.git`:',
        tool_calls: [
          {
            id: 'toolu_017U73gxk7EtcnybfQfMwDDW',
            type: 'function',
            function: {
              name: 'executeCommand',
              arguments: '{"command":"ls -la /home/user/my-project/ | head -20"}'
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_017U73gxk7EtcnybfQfMwDDW',
        content: '{"output":"total 4\\r\\ndrwxr-xr-x 1 root root 41 Mar 19 09:17 .\\r\\ndrwxr-xr-x 1 root root 32 Mar 11 12:10 ..\\r\\ndrwxr-xr-x 1 root root 45 Mar 11 12:10 .git\\r\\ndrwxr-xr-x 4 root root 72 Mar 19 09:17 .jj\\r\\n-rw-r--r-- 1 root root 15 Mar 11 12:10 README.md\\r\\n","isTruncated":false}'
      },
      {
        role: 'assistant',
        content: 'Both `.git` and `.jj` directories exist — the repo is colocated.',
        tool_calls: [
          {
            id: 'toolu_01RbFKbcqvYrAPXMhdewxZNQ',
            type: 'function',
            function: {
              name: 'todoWrite',
              arguments: `{"todos":[{"id":"check-repo","content":"Check if /home/user/my-project exists and has a Git repo","status":"completed","priority":"high"},{"id":"init-jj","content":"Initialize colocated jj repository","status":"completed","priority":"high"},{"id":"create-bookmark","content":"Create feature-x bookmark","status":"in-progress","priority":"high"},{"id":"create-file","content":"Create feature.txt with 'Hello jj'","status":"pending","priority":"high"},{"id":"describe-commit","content":"Describe/create commit with 'Add feature.txt'","status":"pending","priority":"high"},{"id":"verify","content":"Verify colocated repo, bookmark, and commit","status":"pending","priority":"high"}]}`
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_01RbFKbcqvYrAPXMhdewxZNQ',
        content: '{"success":true}'
      },
      {
        role: 'assistant',
        content: '**Step 3: Create the `feature-x` bookmark.** Let me first check the current jj log to understand the state:',
        tool_calls: [
          {
            id: 'toolu_0194HmfhNtUVQ4zP16p2MXym',
            type: 'function',
            function: {
              name: 'executeCommand',
              arguments: '{"command":"cd /home/user/my-project && jj log"}'
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_0194HmfhNtUVQ4zP16p2MXym',
        content: '{"output":"@  uyntpwtv (no email set) 2026-03-19 09:17:41 5d317252\\r\\n│  (empty) (no description set)\\r\\nā—‹  ypsoummp test@example.com 2026-03-11 12:10:51 main 14d944a2\\r\\n│  Initial commit\\r\\nā—†  zzzzzzzz root() 00000000\\r\\n","isTruncated":false}'
      },
      {
        role: 'assistant',
        content: "The working copy change (`@`) is on top of the `main` branch. Now I'll create the `feature-x` bookmark pointing to the current working copy change:",
        tool_calls: [
          {
            id: 'toolu_01Bqso2WjCh52bGNmUGaHTFv',
            type: 'function',
            function: {
              name: 'executeCommand',
              arguments: '{"command":"cd /home/user/my-project && jj bookmark create feature-x -r @"}'
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_01Bqso2WjCh52bGNmUGaHTFv',
        content: `{"output":"Warning: Target revision is empty.\\r\\nCreated 1 bookmarks pointing to uyntpwtv 5d317252 feature-x | (empty) (no description set)\\r\\nWarning: Name and email not configured. Until configured, your commits will be created with the empty identity, and can't be pushed to remotes.\\r\\nHint: To configure, run:\\r\\n  jj config set --user user.name \\"Some One\\"\\r\\n  jj config set --user user.email \\"someone@example.com\\"\\r\\n","isTruncated":false}`
      },
      {
        role: 'assistant',
        content: '',
        tool_calls: [
          {
            id: 'toolu_01L3ZYAHCdqTVwMNgE1PPERS',
            type: 'function',
            function: {
              name: 'todoWrite',
              arguments: `{"todos":[{"id":"check-repo","content":"Check if /home/user/my-project exists and has a Git repo","status":"completed","priority":"high"},{"id":"init-jj","content":"Initialize colocated jj repository","status":"completed","priority":"high"},{"id":"create-bookmark","content":"Create feature-x bookmark","status":"completed","priority":"high"},{"id":"create-file","content":"Create feature.txt with 'Hello jj'","status":"in-progress","priority":"high"},{"id":"describe-commit","content":"Describe/create commit with 'Add feature.txt'","status":"pending","priority":"high"},{"id":"verify","content":"Verify colocated repo, bookmark, and commit","status":"pending","priority":"high"}]}`
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_01L3ZYAHCdqTVwMNgE1PPERS',
        content: '{"success":true}'
      },
      {
        role: 'assistant',
        content: '**Step 4: Create `feature.txt` with the text `Hello jj`.**',
        tool_calls: [
          {
            id: 'toolu_01UTmkEZMJjWuXVJ3nbfuwtw',
            type: 'function',
            function: {
              name: 'writeToFile',
              arguments: '{"path":"/home/user/my-project/feature.txt","content":"Hello jj\\n"}'
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_01UTmkEZMJjWuXVJ3nbfuwtw',
        content: '{"success":true}'
      }
    ],
    tools: [
      {
        type: 'function',
        function: {
          name: 'applyDiff',
          description: "This is a tool for editing files. For moving or renaming files, you should generally use the executeCommand tool with the 'mv' command instead. For larger edits, use the writeFile tool to overwrite files.\n" +
            '\n' +
            "Before using this tool, use the readFile tool to understand the file's contents and context\n" +
            '\n' +
            'To make a file edit, provide the following:\n' +
            '1. path: The path to the file to modify (relative to the current working directory, or an absolute path)\n' +
            '2. searchContent: The text to replace (must match the file contents exactly, including all whitespace and indentation)\n' +
            '3. replaceContent: The edited text to replace the searchContent (must be different from searchContent)\n' +
            '4. expectedReplacements: The number of replacements you expect to make. Defaults to 1 if not specified.\n' +
            '\n' +
            'By default, the tool will replace ONE occurrence of searchContent with replaceContent in the specified file. If you want to replace multiple occurrences, provide the expectedReplacements parameter with the exact number of occurrences you expect.\n' +
            '\n' +
            'CRITICAL REQUIREMENTS FOR USING THIS TOOL:\n' +
            '\n' +
            '1. UNIQUENESS (when expectedReplacements is not specified): The searchContent MUST uniquely identify the specific instance you want to change. This means:\n' +
            '   - Include AT LEAST 3-5 lines of context BEFORE the change point\n' +
            '   - Include AT LEAST 3-5 lines of context AFTER the change point\n' +
            '   - Include all whitespace, indentation, and surrounding code exactly as it appears in the file\n' +
            '\n' +
            '2. EXPECTED MATCHES: If you want to replace multiple instances:\n' +
            '   - Use the expectedReplacements parameter with the exact number of occurrences you expect to replace\n' +
            '   - This will replace ALL occurrences of the searchContent with the replaceContent\n' +
            "   - If the actual number of matches doesn't equal expectedReplacements, the edit will fail\n" +
            '   - This is a safety feature to prevent unintended replacements\n' +
            '\n' +
            '3. VERIFICATION: Before using this tool:\n' +
            '   - Check how many instances of the target text exist in the file\n' +
            '   - If multiple instances exist, either:\n' +
            '     a) Gather enough context to uniquely identify each one and make separate calls, OR\n' +
            '     b) Use expectedReplacements parameter with the exact count of instances you expect to replace\n' +
            '\n' +
            'WARNING:\n' +
            "- The tool will fail if searchContent matches multiple locations and expectedReplacements isn't specified\n" +
            "- The tool will fail if the number of matches doesn't equal expectedReplacements when it's specified\n" +
            "- The tool will fail if searchContent doesn't match the file contents exactly (including whitespace)\n" +
            '- The tool will fail if searchContent and replaceContent are the same\n' +
            '\n' +
            'When making edits:\n' +
            '   - Ensure the edit results in idiomatic, correct code\n' +
            '   - Do not add trailing whitespace to lines (a newline at the end of a file is fine)\n' +
            '   - Do not leave the code in a broken state\n' +
            '\n' +
            'If you want to create a new file, use:\n' +
            '   - A new file path, including dir name if needed\n' +
            '   - An empty searchContent\n' +
            "   - The new file's contents as replaceContent\n" +
            '\n' +
            'Remember: when making multiple file edits in a row to the same file, you should prefer to send all edits in a single message with multiple calls to this tool, rather than multiple messages with a single call each.\n' +
            '\n' +
            'You may see the following fields in the result:\n' +
            '- autoFormattingEdits: If the auto-formatter makes any changes, this field will contain a diff against the file content after your edits and any user edits have been applied.\n' +
            '- newProblems: If any new problems are found after the edit, this field will contain information about them.',
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path of the file to modify (relative to the current working directory, or an absolute path).'
              },
              searchContent: {
                type: 'string',
                description: 'The text to replace.'
              },
              replaceContent: {
                type: 'string',
                description: 'The text to replace it with.'
              },
              expectedReplacements: {
                type: 'number',
                description: 'The expected number of replacements to perform. Defaults to 1 if not specified.'
              }
            },
            required: [
              'path',
              'searchContent',
              'replaceContent'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'askFollowupQuestion',
          description: 'Ask the user a question to gather additional information needed to complete the task. \n' +
            '\n' +
            '## When to Use This Tool\n' +
            'Use this tool in the following scenarios:\n' +
            "1. The user's request is ambiguous or unclear and requires clarification.\n" +
            '2. You need more details to proceed effectively.\n' +
            '3. You have made several unsuccessful attempts to solve the issue and need user guidance to move forward.\n' +
            '4. Offer choices to the user about what direction to take.\n' +
            '\n' +
            '## Usage Notes\n' +
            '- Users will always be able to select "Other" to provide custom text input\n' +
            '- Use multiSelect: true to allow multiple answers to be selected for a question\n' +
            '- If you recommend a specific option, make that the first option in the list and add "(Recommended)" at the end of the label\n' +
            '- Provide 1-4 questions per call\n' +
            '\n' +
            'IMPORTANT: This tool CANNOT be used in combination with other tools (except todoWrite) in a single step. If you need to use other tools, you must do so in a separate step before calling this tool.',
          parameters: {
            type: 'object',
            properties: {
              questions: {
                type: 'array',
                items: {
                  type: 'object',
                  properties: {
                    question: {
                      type: 'string',
                      description: 'The complete question to ask the user. Should be clear, specific, and end with a question mark.'
                    },
                    header: {
                      type: 'string',
                      maxLength: 12,
                      description: 'Very short label displayed as a chip/tag (max 12 chars). Examples: "Auth method", "Library", "Approach".'
                    },
                    options: {
                      type: 'array',
                      items: {
                        type: 'object',
                        properties: {
                          label: {
                            type: 'string',
                            description: 'Short button label shown to the user. Should be concise (1-5 words) and clearly describe the choice.'
                          },
                          description: {
                            type: 'string',
                            description: 'Explanation of what this option means or what will happen if chosen. Useful for providing context about trade-offs or implications.'
                          }
                        },
                        required: [
                          'label'
                        ],
                        additionalProperties: false
                      },
                      minItems: 2,
                      maxItems: 4,
                      description: "The available choices for this question. Must have 2-4 options. Each option should be a distinct, mutually exclusive choice (unless multiSelect is enabled). There should be no 'Other' option, that will be provided automatically."
                    },
                    multiSelect: {
                      type: 'boolean',
                      default: false,
                      description: 'Set to true to allow the user to select multiple options instead of just one. Use when choices are not mutually exclusive.'
                    }
                  },
                  required: [
                    'question',
                    'header',
                    'options'
                  ],
                  additionalProperties: false
                },
                minItems: 1,
                maxItems: 4,
                description: 'Questions to ask the user (1-4 questions).'
              }
            },
            required: [
              'questions'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'attemptCompletion',
          description: "Once you've received the results of tool uses and can confirm that the task is complete, use this tool to present the result of your work to the user.\n" +
            '\n' +
            'You MUST NOT generate any text before this tool call. All conclusion text must be included within the result parameter of the attemptCompletion tool.\n' +
            'Never use this tool with a question or request to engage in further conversation! Formulate the end of your result in a way that is final and does not require further input from the user.\n' +
            '\n' +
            'IMPORTANT: This tool CANNOT be used in combination with other tools (except todoWrite) in a single step. If you need to use other tools, you must do so in a separate step before calling this tool.',
          parameters: {
            '$schema': 'http://json-schema.org/draft-07/schema#',
            type: 'object',
            properties: {
              result: {
                description: 'The result of the task. Formulate this result in a way that is final and does not require further input from the user.',
                type: 'string'
              }
            },
            required: [
              'result'
            ],
            additionalProperties: false
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'executeCommand',
          description: 'Executes a given bash command in a persistent shell session with optional timeout, ensuring proper handling and security measures.\n' +
            '\n' +
            'IMPORTANT: This tool is for terminal operations like git, npm, docker, etc. DO NOT use it for file operations (reading, writing, editing, searching, finding files) - use the specialized tools for this instead.\n' +
            '\n' +
            'Before executing the command, please follow these steps:\n' +
            '\n' +
            '1. Directory Verification:\n' +
            '   - If the command will create new directories or files, first use listFiles to verify the parent directory exists and is the correct location\n' +
            '   - For example, before running "mkdir foo/bar", first use listFiles to check that "foo" exists and is the intended parent directory\n' +
            '\n' +
            '2. Command Execution:\n' +
            '   - Always quote file paths that contain spaces with double quotes (e.g., cd "path with spaces/file.txt")\n' +
            '   - Examples of proper quoting:\n' +
            '     - cd "/Users/name/My Documents" (correct)\n' +
            '     - cd /Users/name/My Documents (incorrect - will fail)\n' +
            '     - python "/path/with spaces/script.py" (correct)\n' +
            '     - python /path/with spaces/script.py (incorrect - will fail)\n' +
            '   - After ensuring proper quoting, execute the command.\n' +
            '   - Capture the output of the command.\n' +
            '\n' +
            'Usage notes:\n' +
            '- The command argument is required.\n' +
            '- You can specify an optional timeout in seconds (up to 300s / 5 minutes). If not specified, commands will timeout after 60s (1 minute).\n' +
            '- If the output exceeds 30000 characters, output will be truncated before being returned to you.\n' +
            '- When issuing multiple commands:\n' +
            '  - If the commands are independent and can run in parallel, make multiple executeCommand tool calls in a single message. For example, if you need to run "git status" and "git diff", send a single message with two executeCommand tool calls in parallel.\n' +
            '  - If the commands depend on each other and must run sequentially, use a single executeCommand call with \'&&\' to chain them together (e.g., `git add . && git commit -m "message" && git push`). For instance, if one operation must complete before another starts (like mkdir before cp, Write before executeCommand for git operations, or git add before git commit), run these operations sequentially instead.\n' +
            "  - Use ';' only when you need to run commands sequentially but don't care if earlier commands fail\n" +
            '  - DO NOT use newlines to separate commands (newlines are ok in quoted strings)\n' +
            "- You shall avoid use the markdown code block syntax (backtick, '`') in your command, as it will be interpreted as a command substitution.\n" +
            "- Before using this tool, you must first think about the context provided in <system-reminder> to understand the user's environment and tailor your commands to ensure they are compatible with their system. You must also consider if the command you need to run should be executed in a specific directory rather than the current working directory, and properly set the `cwd` if necessary.\n" +
            '\n' +
            '# Committing changes with git\n' +
            '\n' +
            'Only create commits when requested by the user. If unclear, ask first. When the user asks you to create a new git commit, follow these steps carefully:\n' +
            '\n' +
            'Git Safety Protocol:\n' +
            '- NEVER update the git config\n' +
            "- NEVER run destructive git commands (push --force, reset --hard, checkout ., restore ., clean -f, branch -D) unless the user explicitly requests these actions. Taking unauthorized destructive actions is unhelpful and can result in lost work, so it's best to ONLY run these commands when given direct instructions \n" +
            '- NEVER skip hooks (--no-verify, --no-gpg-sign, etc) unless the user explicitly requests it\n' +
            '- NEVER run force push to main/master, warn the user if they request it\n' +
            '- CRITICAL: Always create NEW commits rather than amending, unless the user explicitly requests a git amend. When a pre-commit hook fails, the commit did NOT happen  — so --amend would modify the PREVIOUS commit, which may result in destroying work or losing previous changes. Instead, after hook failure, fix the issue, re-stage, and create a NEW commit\n' +
            '- When staging files, prefer adding specific files by name rather than using "git add -A" or "git add .", which can accidentally include sensitive files (.env, credentials) or large binaries\n' +
            '- NEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked, otherwise the user will feel that you are being too proactive\n' +
            '\n' +
            '1. You can call multiple tools in a single response. When multiple independent pieces of information are requested and all commands are likely to succeed, run multiple tool calls in parallel for optimal performance. run the following bash commands in parallel, each using the executeCommand tool:\n' +
            '  - Run a git status command to see all untracked files. IMPORTANT: Never use the -uall flag as it can cause memory issues on large repos.\n' +
            '  - Run a git diff command to see both staged and unstaged changes that will be committed.\n' +
            "  - Run a git log command to see recent commit messages, so that you can follow this repository's commit message style.\n" +
            '2. Analyze all staged changes (both previously staged and newly added) and draft a commit message:\n' +
            '  - Summarize the nature of the changes (eg. new feature, enhancement to an existing feature, bug fix, refactoring, test, docs, etc.). Ensure the message accurately reflects the changes and their purpose (i.e. "add" means a wholly new feature, "update" means an enhancement to an existing feature, "fix" means a bug fix, etc.).\n' +
            '  - Do not commit files that likely contain secrets (.env, credentials.json, etc). Warn the user if they specifically request to commit those files\n' +
            '  - Draft a concise (1-2 sentences) commit message that focuses on the "why" rather than the "what"\n' +
            '  - Ensure it accurately reflects the changes and their purpose\n' +
            '3. You can call multiple tools in a single response. When multiple independent pieces of information are requested and all commands are likely to succeed, run multiple tool calls in parallel for optimal performance. run the following commands:\n' +
            '   - Add relevant untracked files to the staging area.\n' +
            '   - Create the commit with a message ending with:\n' +
            '   šŸ¤– Generated with [Pochi](https://getpochi.com) | [Task](<Share URL>)\n' +
            '\n' +
            '   Co-Authored-By: Pochi <noreply@getpochi.com>\n' +
            '\n' +
            '   Note: Replace <Share URL> with the Share URL from system information if available. If not available, omit the " | [Task](...)" part.\n' +
            '\n' +
            '   - Run git status after the commit completes to verify success.\n' +
            '   Note: git status depends on the commit completing, so run it sequentially after the commit.\n' +
            '4. If the commit fails due to pre-commit hook changes, retry the commit ONCE to include these automated changes. If it fails again, it usually means a pre-commit hook is preventing the commit. If the commit succeeds but you notice that files were modified by the pre-commit hook, you MUST amend your commit to include them.\n' +
            '\n' +
            'Important notes:\n' +
            '- NEVER update the git config\n' +
            '- NEVER run additional commands to read or explore code, besides git bash commands\n' +
            '- DO NOT push to the remote repository unless the user explicitly asks you to do so\n' +
            '- IMPORTANT: Never use git commands with the -i flag (like git rebase -i or git add -i) since they require interactive input which is not supported.\n' +
            '- IMPORTANT: Do not use --no-edit with git rebase commands, as the --no-edit flag is not a valid option for git rebase.\n' +
            '- If there are no changes to commit (i.e., no untracked files and no modifications), do not create an empty commit\n' +
            '- In order to ensure good formatting, ALWAYS pass the commit message via a HEREDOC, a la this example:\n' +
            '<example>\n' +
            `git commit -m "$(cat <<'EOF'\n` +
            'Commit message here.\n' +
            '\n' +
            'šŸ¤– Generated with [Pochi](https://getpochi.com) | [Task](<Share URL>)\n' +
            '\n' +
            'Co-Authored-By: Pochi <noreply@getpochi.com>\n' +
            'EOF\n' +
            ')"\n' +
            '</example>\n' +
            '\n' +
            '# Creating pull requests\n' +
            'Use the gh command via the executeCommand tool for ALL GitHub-related tasks including working with issues, pull requests, checks, and releases. If given a Github URL use the gh command to get the information needed.\n' +
            '\n' +
            'IMPORTANT: When the user asks you to create a pull request, follow these steps carefully:\n' +
            '\n' +
            '1. You can call multiple tools in a single response. When multiple independent pieces of information are requested and all commands are likely to succeed, run multiple tool calls in parallel for optimal performance. run the following bash commands in parallel using the executeCommand tool, in order to understand the current state of the branch since it diverged from the main branch:\n' +
            '   - Run a git status command to see all untracked files (never use -uall flag)\n' +
            '   - Run a git diff command to see both staged and unstaged changes that will be committed\n' +
            '   - Check if the current branch tracks a remote branch and is up to date with the remote, so you know if you need to push to the remote\n' +
            '   - Run a git log command and `git diff [base-branch]...HEAD` to understand the full commit history for the current branch (from the time it diverged from the base branch)\n' +
            '2. Analyze all changes that will be included in the pull request, making sure to look at all relevant commits (NOT just the latest commit, but ALL commits that will be included in the pull request!!!), and draft a pull request title and summary:\n' +
            '   - Keep the PR title short (under 70 characters)\n' +
            '   - Use the description/body for details, not the title\n' +
            '3. You can call multiple tools in a single response. When multiple independent pieces of information are requested and all commands are likely to succeed, run multiple tool calls in parallel for optimal performance. run the following commands in parallel:\n' +
            '   - Create new branch if needed\n' +
            '   - Push to remote with -u flag if needed\n' +
            '   - Create PR using gh pr create with the format below. Use a HEREDOC to pass the body to ensure correct formatting.\n' +
            '<example>\n' +
            `gh pr create --title "the pr title" --body "$(cat <<'EOF'\n` +
            '## Summary\n' +
            '<1-3 bullet points>\n' +
            '\n' +
            '## Test plan\n' +
            '[Checklist of TODOs for testing the pull request...]\n' +
            '\n' +
            'šŸ¤– Generated with [Pochi](https://getpochi.com) | [Task](<Share URL>)\n' +
            'EOF\n' +
            ')"\n' +
            '</example>\n' +
            '\n' +
            'Important:\n' +
            '- NEVER update the git confi'... 355 more characters,
          parameters: {
            type: 'object',
            properties: {
              command: {
                type: 'string',
                description: 'The CLI command to execute. This should be valid for the current operating system.'
              },
              cwd: {
                type: 'string',
                description: 'The working directory to execute the command in.'
              },
              timeout: {
                type: 'number',
                minimum: 1,
                maximum: 300,
                description: 'Optional timeout in seconds, max 300 seconds. By default the timeout is 120 seconds.'
              }
            },
            required: [
              'command'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'globFiles',
          description: 'Request to find files matching a glob pattern within a specified directory. Use this to get a list of files based on a pattern.',
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path of the directory to search in (relative to the current working directory, or an absolute path)'
              },
              globPattern: {
                type: 'string',
                description: "The glob pattern to match files against (e.g., '*.ts', '**/*.js')"
              }
            },
            required: [
              'path',
              'globPattern'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'listFiles',
          description: 'Request to list files and directories within the specified directory. If recursive is true, it will list all files and directories recursively. If recursive is false or not provided, it will only list the top-level contents. Do not use this tool to confirm the existence of files you may have created, as the user will let you know if the files were created successfully or not.',
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path of the directory to list contents for (relative to the current working directory, or an absolute path)'
              },
              recursive: {
                type: 'boolean',
                description: 'Whether to list files and directories recursively.'
              }
            },
            required: [
              'path'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'readFile',
          description: 'Request to read the contents of a file at the specified path. Use this when you need to examine the contents of an existing file you do not know the contents of, for example to analyze code, review text files, extract information from configuration files.\n' +
            '',
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path of the file to read (relative to the current working directory, or an absolute path)'
              },
              startLine: {
                type: 'number',
                description: 'The starting line number to read from (1-based). If not provided, it starts from the beginning of the file.'
              },
              endLine: {
                type: 'number',
                description: 'The ending line number to read to (1-based, inclusive). If not provided, it reads to the end of the file.'
              }
            },
            required: [
              'path'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'useSkill',
          description: 'Execute a skill within the main conversation\n' +
            '\n' +
            'When users ask you to perform tasks, check if any of the available skills below can help complete the task more effectively. Skills provide specialized capabilities and domain knowledge.\n' +
            '\n' +
            'When users ask about a SPECIFIC skill (e.g., "How does the pdf skill work?", "What does the commit skill do?"), you must call this tool to get detailed information about that skill.\n' +
            '\n' +
            'When users ask general questions like "What skills are available?" or "List all skills", simply refer to the "Available skills" section below - do NOT call this tool.\n' +
            '\n' +
            "This tool returns the skill's detailed instructions which you must then follow to complete the task. The instructions contain step-by-step guidance on how to perform the specific task or workflow.\n" +
            '\n' +
            'How to invoke:\n' +
            '- Use this tool with the skill name\n' +
            '- Example: `skill: "pdf-processing"` - invoke the pdf-processing skill\n' +
            "- The tool will return the skill's instructions\n" +
            '- Follow the returned instructions carefully to complete the task\n' +
            '\n' +
            'Important:\n' +
            '- When a skill is relevant for a task OR when users ask about a SPECIFIC skill, you must invoke this tool IMMEDIATELY as your first action\n' +
            '- For general questions about available skills, simply refer to the "Available skills" list below without calling this tool\n' +
            '- NEVER just announce or mention a skill in your text response without actually calling this tool (except for general skill listing requests)\n' +
            '- This is a BLOCKING REQUIREMENT: invoke the relevant Skill tool BEFORE generating any other response about a specific skill or task\n' +
            '- Only use skills listed in "Available skills" below\n' +
            '- Check compatibility requirements before using a skill - ensure the skill is compatible with the current OS/environment\n' +
            '- After calling this tool, follow the returned instructions step by step\n' +
            '- The skill file location is shown in the [Location: filepath] section of each skill listing below - use this information to understand where the skill is defined\n' +
            "- Use the directory containing the skill's source file as the base directory for resolving any resource files mentioned in the instructions\n" +
            '- Proactively explore the skill directory for optional resources that enhance task completion:\n' +
            '  * scripts/ - executable code that agents can run (Python, Bash, JavaScript, etc.)\n' +
            '  * references/ - on-demand documentation (REFERENCE.md, FORMS.md, domain-specific files)\n' +
            '  * assets/ - static resources (templates, images, data files, schemas)\n' +
            '  Use these resources when they exist and are relevant to the current task\n' +
            '\n' +
            'Available skills:\n' +
            '\n' +
            '- **find-skills**: Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill. [Location: _builtIn_]\n' +
            '- **create-skill**: Helps users create new custom agent skills. Use when the user wants to create a new skill, automate a workflow, or package specialized knowledge for reuse. [Location: _builtIn_]',
          parameters: {
            type: 'object',
            properties: {
              skill: {
                type: 'string',
                description: 'The name of the skill to use.'
              }
            },
            required: [
              'skill'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'searchFiles',
          description: '- Fast content search tool that works with any codebase size\n' +
            '- Searches file contents using regular expressions\n' +
            '- Supports Rust regex syntax (eg. "log.*Error", "functions+w+", etc.)\n' +
            '- Filter files by pattern with the include parameter (eg. "*.js", "*.{ts,tsx}")\n' +
            '- Returns file paths with at least one match sorted by modification time\n' +
            '- Use this tool when you need to find files containing specific patterns\n' +
            '- Craft your regex patterns carefully to balance specificity and flexibility.\n' +
            "- Based on the user's task you may use it to find code patterns, TODO comments, function definitions, or any text-based information across the project. The results include context, so analyze the surrounding code to better understand the matches. Leverage the this tool in combination with other tools for more comprehensive analysis. For example, use it to find specific code patterns, then use readFile to examine the full context of interesting matches before using applyDiff or writeToFile to make informed changes.",
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path of the directory to search in (relative to the current working directory, or an absolute path).'
              },
              regex: {
                type: 'string',
                description: 'The regular expression pattern to search for in file contents. Uses Rust regex syntax.'
              },
              filePattern: {
                type: 'string',
                description: 'File pattern to include in the search (e.g. "*.js", "*.{ts,tsx}"). If not provided, it will search all files.'
              }
            },
            required: [
              'path',
              'regex'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'todoWrite',
          description: 'Use this tool to create and manage a structured task list for your current coding session. This helps you track progress, organize complex tasks, and demonstrate thoroughness to the user.\n' +
            'It also helps the user understand the progress of the task and overall progress of their requests.\n' +
            '\n' +
            '## When to Use This Tool\n' +
            'Use this tool proactively in these scenarios:\n' +
            '\n' +
            '1. Complex multi-step tasks - When a task requires 3 or more distinct steps or actions\n' +
            '2. Non-trivial and complex tasks - Tasks that require careful planning or multiple operations\n' +
            '3. User explicitly requests todo list - When the user directly asks you to use the todo list\n' +
            '4. User provides multiple tasks - When users provide a list of things to be done (numbered or comma-separated)\n' +
            '5. After receiving new instructions - Immediately capture user requirements as todos. Feel free to edit the todo list based on new information.\n' +
            '6. After completing a task - Mark it complete and add any new follow-up tasks\n' +
            '7. When you start working on a new task, mark the todo as in-progress. Ideally you should only have one todo as in-progress at a time. Complete existing tasks before starting new ones.\n' +
            '\n' +
            '## When NOT to Use This Tool\n' +
            '\n' +
            'Skip using this tool when:\n' +
            '1. There is only a single, straightforward task\n' +
            '2. The task is trivial and tracking it provides no organizational benefit\n' +
            '3. The task can be completed in less than 3 trivial steps\n' +
            '4. The task is purely conversational or informational\n' +
            '\n' +
            'NOTE that you should use should not use this tool if there is only one trivial task to do. In this case you are better off just doing the task directly.\n' +
            '\n' +
            '## Examples of When to Use the Todo List\n' +
            '\n' +
            '<example>\n' +
            "User: I want to add a dark mode toggle to the application settings. Make sure you run the tests and build when you're done!\n" +
            "Assistant: I'll help add a dark mode toggle to your application settings. Let me create a todo list to track this implementation.\n" +
            '*Creates todo list with the following items:*\n' +
            '1. Create dark mode toggle component in Settings page\n' +
            '2. Add dark mode state management (context/store)\n' +
            '3. Implement CSS-in-JS styles for dark theme\n' +
            '4. Update existing components to support theme switching\n' +
            '5. Run tests and build process, addressing any failures or errors that occur\n' +
            '*Begins working on the first task*\n' +
            '\n' +
            '<reasoning>\n' +
            'The assistant used the todo list because:\n' +
            '1. Adding dark mode is a multi-step feature requiring UI, state management, and styling changes\n' +
            '2. The user explicitly requested tests and build be run afterward\n' +
            '3. The assistant inferred that tests and build need to pass by adding "Ensure tests and build succeed" as the final task\n' +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '<example>\n' +
            'User: Help me rename the function getCwd to getCurrentWorkingDirectory across my project\n' +
            "Assistant: Let me first search through your codebase to find all occurrences of 'getCwd'.\n" +
            '*Uses grep or search tools to locate all instances of getCwd in the codebase*\n' +
            "Assistant: I've found 15 instances of 'getCwd' across 8 different files. Let me create a todo list to track these changes.\n" +
            '*Creates todo list with specific items for each file that needs updating*\n' +
            '\n' +
            '<reasoning>\n' +
            'The assistant used the todo list because:\n' +
            '1. First, the assistant searched to understand the scope of the task\n' +
            '2. Upon finding multiple occurrences across different files, it determined this was a complex task with multiple steps\n' +
            '3. The todo list helps ensure every instance is tracked and updated systematically\n' +
            '4. This approach prevents missing any occurrences and maintains code consistency\n' +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '\n' +
            '<example>\n' +
            'User: I need to implement these features for my e-commerce site: user registration, product catalog, shopping cart, and checkout flow.\n' +
            "Assistant: I'll help implement these features. First, let's add all the features to the todo list.\n" +
            '*Creates a todo list breaking down each feature into specific tasks based on the project architecture*\n' +
            "Assistant: Let's start with user registration. This will involve creating database models, API endpoints, and frontend forms that integrate with your existing authentication system.\n" +
            '\n' +
            '<reasoning>\n' +
            'The assistant used the todo list because:\n' +
            '1. The user provided multiple complex features to implement in a comma separated list\n' +
            '2. The todo list helps organize these large features into manageable tasks\n' +
            '3. This approach allows for tracking progress across the entire implementation\n' +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '<example>\n' +
            "User: Can you help optimize my React application? It's rendering slowly and has performance issues.</user>\n" +
            "Assistant: I'll help optimize your React application. First, let me examine your codebase to identify potential performance bottlenecks.\n" +
            '*Reviews component structure, render patterns, state management, and data fetching*\n' +
            "Assistant: After analyzing your codebase, I've identified several performance issues. Let me create a todo list to track our optimization efforts.\n" +
            '*Creates todo list with items like: 1) Implement memoization for expensive calculations in ProductList, 2) Add virtualization for long lists in Dashboard, 3) Optimize image loading in Gallery component, 4) Fix state update loops in ShoppingCart, 5) Review bundle size and implement code splitting*\n' +
            "Let's start by implementing memoization for the expensive calculations in your ProductList component.</assistant>\n" +
            '\n' +
            '<reasoning>\n' +
            'The assistant used the todo list because:\n' +
            '1. First, the assistant examined the codebase to identify specific performance issues\n' +
            '2. Based on this analysis, it identified multiple optimization opportunities\n' +
            '3. Performance optimization is a non-trivial task requiring multiple steps\n' +
            '4. The todo list helps methodically track improvements across different components\n' +
            '5. This systematic approach ensures all performance bottlenecks are addressed\n' +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '## Examples of When NOT to Use the Todo List\n' +
            '\n' +
            '<example>\n' +
            "User: How do I print 'Hello World' in Python?\n" +
            'Assistant: In Python, you can print "Hello World" with this simple code:\n' +
            '\n' +
            'python\n' +
            'print("Hello World")\n' +
            '\n' +
            'This will output the text "Hello World" to the console when executed.</assistant>\n' +
            '\n' +
            '<reasoning>\n' +
            "The assistant did not use the todo list because this is a single, trivial task that can be completed in one step. There's no need to track multiple tasks or steps for such a straightforward request.\n" +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '<example>\n' +
            'User: What does the git status command do?\n' +
            "Assistant: The git status command shows the current state of your working directory and staging area. It displays which changes have been staged, which haven't, and which files aren't being tracked by Git. This is a fundamental command for understanding the current state of your repository before making commits.\n" +
            '\n' +
            '<reasoning>\n' +
            'The assistant did not use the todo list because this is an informational request with no actual coding task to complete. The user is simply asking for an explanation, not for the assistant to perform multiple steps or tasks.\n' +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '<example>\n' +
            'User: Can you add a comment to the calculateTotal function to explain what it does?\n' +
            'Assistant: Sure, let me add a comment to the calculateTotal function to explain what it does.\n' +
            '* Uses the Edit tool to add a comment to the calculateTotal function *\n' +
            '\n' +
            '<reasoning>\n' +
            "The assistant did not use the todo list because this is a single, straightforward task confined to one location in the code. Adding a comment doesn't require tracking multiple steps or systematic organization.\n" +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '<example>\n' +
            'User: Run npm install for me and tell me what happens.\n' +
            "Assistant: I'll run the npm install command for you.\n" +
            '\n' +
            '*Executes: npm install*\n' +
            '\n' +
            "The command completed successfully. Here's the output:\n" +
            '[Output of npm install command]\n' +
            '\n' +
            'All dependencies have been installed according to your package.json file.\n' +
            '\n' +
            '<reasoning>\n' +
            'The assistant did not use the todo list because this is a single command execution with immediate results. There are no multiple steps to track or organize, making the todo list unnecessary for this straightforward task.\n' +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '## Task States and Management\n' +
            '\n' +
            '1. **Task States**: Use these states to track progress:\n' +
            '   - pending: Task not yet started\n' +
            '   - in-progress: Currently working on (limit to ONE task at a time)\n' +
            '   - completed: Task finished successfully\n' +
            '   - cancelled: Task no longer needed\n' +
            '\n' +
            '2. **Task Management**:\n' +
            '   - Update task status in real-time as you work\n' +
            "   - Mark tasks complete IMMEDIATELY after finishing (don't batch completions)\n" +
            '   - Only have ONE task in-progress at any time\n' +
            '   - Complete current tasks before starting new ones\n' +
            '   - Cancel tasks that become irrelevant\n' +
            '\n' +
            '3. **Task Breakdown**:\n' +
            '   - Create specific, actionable items\n' +
            '   - Break complex tasks into smaller, manageable steps\n' +
            '   - Use clear, descriptive task names\n' +
            '\n' +
            'When in doubt, use this tool. Being proactive with task management demonstrates attentiveness and ensures you complete all requirements successfully.',
          parameters: {
            type: 'object',
            properties: {
              todos: {
                type: 'array',
                items: {
                  type: 'object',
                  properties: {
                    id: {
                      type: 'string',
                      description: 'The unique identifier of the task, e.g "collect-information".'
                    },
                    content: {
                      type: 'string',
                      description: 'The content of the task.'
                    },
                    status: {
                      type: 'string',
                      enum: [
                        'pending',
                        'in-progress',
                        'completed',
                        'cancelled'
                      ],
                      description: 'The status of the task.'
                    },
                    priority: {
                      type: 'string',
                      enum: [
                        'low',
                        'medium',
                        'high'
                      ],
                      description: 'The priority of the task.'
                    }
                  },
                  required: [
                    'id',
                    'content',
                    'status',
                    'priority'
                  ],
                  additionalProperties: false
                }
              }
            },
            required: [
              'todos'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'writeToFile',
          description: 'Request to write full content to a file at the specified path.\n' +
            'If the file exists, it will be overwritten with the provided content.\n' +
            "If the file doesn't exist, it will be created. This tool will automatically create any directories needed to write the file.\n" +
            '\n' +
            'You may see the following fields in the result:\n' +
            '- autoFormattingEdits: If the auto-formatter makes any changes, this field will contain a diff against the file content after your edits and any user edits have been applied.\n' +
            '- newProblems: If any new problems are found after the edit, this field will contain information about them.',
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path of the file to write to (relative to the current working directory, or an absolute path).'
              },
              content: {
                type: 'string',
                description: 'The content to write to the file.'
              }
            },
            required: [
              'path',
              'content'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'editNotebook',
          description: 'Edit a specific cell in a Jupyter notebook (.ipynb file) by its cell ID',
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path to the notebook file (relative to the current working directory, or an absolute path)'
              },
              cellId: {
                type: 'string',
                description: 'The ID of the cell to edit'
              },
              content: {
                type: 'string',
                description: 'The new content of the cell'
              }
            },
            required: [
              'path',
              'cellId',
              'content'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'newTask',
          description: 'Launch a new agent to handle complex, multi-step tasks autonomously.\n' +
            'When using the newTask tool, you may specify a agentType parameter to select which agent type to use.\n' +
            'Available agent types and the tools they have access to:\n' +
            '\n' +
            '### planner\n' +
            'Engage this agent to formulate comprehensive, technical implementation strategies for feature development, system refactoring, or defect resolution.\n' +
            'This agent is strictly limited to planning and architectural design; it DOES NOT execute code modifications.\n' +
            '\n' +
            'Examples of user requests this agent shall trigger:\n' +
            '- "create a plan to implement the user authentication feature"\n' +
            '- "how should we refactor the database schema"\n' +
            '- "design a solution for the memory leak issue"\n' +
            '\n' +
            '### browser\n' +
            'Web browser automation agent for navigating websites, interacting with pages, and extracting information. Uses agent-browser CLI for headless browser control.\n' +
            '\n' +
            '### reviewer\n' +
            'Engage this agent to perform code reviews and leave inline comments.\n' +
            'This agent can analyze code and create review comments on specific lines.\n' +
            '\n' +
            'Examples of user requests this agent shall trigger:\n' +
            '- "review the code in src/auth"\n' +
            '- "add review comments to this file"\n' +
            '- "check this code and leave feedback"\n' +
            '\n' +
            '### walkthrough\n' +
            'Engage this agent to create a summary of the changes made in the current task.\n' +
            'This agent is strictly limited to documentation and explanation; it DOES NOT execute code modifications.\n' +
            '\n' +
            'Examples of user requests this agent shall trigger:\n' +
            '- "summarize what we have done"\n' +
            '- "create a walkthrough for the changes"\n' +
            '- "explain the changes made in this task"\n' +
            '\n' +
            '### explore\n' +
            'Use this agent to explore the codebase when you need to: understand project structure, find where features are implemented, locate specific functions or classes, analyze code patterns, investigate how something works, search for examples or usage, or gather information before making changes.\n' +
            '\n' +
            'Examples of questions this agent shall trigger:\n' +
            '- "where is the authentication logic implemented"\n' +
            '- "find all usages of the config parser"\n' +
            '- "how does the ignore-walk module work"\n' +
            '\n' +
            '\n' +
            'Always include a reminder in your prompt to ensure the result will be submitted through the `attemptCompletion` tool.\n' +
            'If the task stops without submitting the result, it will return an error message.\n' +
            '\n' +
            'You can optionally run agents in the background using the runAsync parameter. You can continue working while background agents run.\n' +
            '\n' +
            'When NOT to use the newTask tool:\n' +
            '- If you want to read a specific file path, use the readFile or globFiles tool instead of the newTask tool, to find the match more quickly\n' +
            '- If you are searching for a specific class definition like "class Foo", use the globFiles tool instead, to find the match more quickly\n' +
            '- If you are searching for code within a specific file or set of 2-3 files, use the readFile tool instead of the newTask tool, to find the match more quickly\n' +
            '- Other tasks that are not related to the agent descriptions above\n' +
            '\n' +
            'Usage notes:\n' +
            '1. Launch multiple agents tools concurrently whenever possible to maximize performance; to do that, use a single message with multiple tool uses\n' +
            '2. When the agent is done, it will return a single message back to you. The result returned by the agent is not visible to the user. To show the user the result, you should send a text message back to the user with a concise summary of the result.\n' +
            '3. Each agent invocation is stateless. You will not be able to send additional messages to the agent, nor will the agent be able to communicate with you outside of its final report. Therefore, your prompt should contain a highly detailed task description for the agent to perform autonomously and you should specify exactly what information the agent should return back to you in its final and only message to you.\n' +
            "4. The agent's outputs should generally be trusted\n" +
            "5. Clearly tell the agent whether you expect it to write code or just to do research (search, file reads, web fetches, etc.), since it is not aware of the user's intent\n" +
            '6. If the agent description mentions that it should be used proactively, then you should try your best to use it without the user having to ask for it first. Use your judgement.',
          parameters: {
            type: 'object',
            properties: {
              description: {
                type: 'string',
                description: 'A short description of the task.'
              },
              prompt: {
                type: 'string',
                description: 'The detailed prompt for the task to be performed.'
              },
              agentType: {
                type: 'string',
                description: 'The type of the specialized agent to use for the task.'
              },
              runAsync: {
                type: 'boolean',
                description: 'Set to true to run this agent in the background.'
              }
            },
            required: [
              'description',
              'prompt'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'startBackgroundJob',
          description: 'Start a background job to execute a bash command, which allows you to continue working while the job runs.\n' +
            '\n' +
            'Before starting the background job, please follow these steps:\n' +
            '\n' +
            '1. Directory Verification:\n' +
            '   - If the command will create new directories or files, first use the listFiles tool to verify the parent directory exists and is the correct location\n' +
            '   - For example, before running "mkdir foo/bar", first use listFiles to check that "foo" exists and is the intended parent directory\n' +
            '\n' +
            '2. Job Execution:\n' +
            '   - After ensuring proper quoting, start the background job.\n' +
            '\n' +
            'Usage notes:\n' +
            '- The command argument is required.\n' +
            '- Use readBackgroundJobOutput to monitor the output and status of the job.\n' +
            '- Use killBackgroundJob to terminate the job if needed.\n' +
            '- If the output exceeds 30000 characters, output will be truncated before being returned to you.\n' +
            '\n' +
            'Common use cases and examples:\n' +
            '- Development servers: `npm run dev`, `yarn start`, `bun run dev`\n' +
            '- Build processes: `npm run build`, `make`, `cargo build`\n' +
            '- File watchers: `npm run watch`, `tsc --watch`\n' +
            '- Testing: `npm run test:watch`, `jest --watch`\n' +
            '- Database services: `docker run -p 5432:5432 postgres`\n' +
            '\n' +
            'Command execution rules:\n' +
            "- Never run 'sleep' as it will return immediately.\n" +
            "- You do not need to use '&' at the end of the command.\n" +
            "- When issuing multiple commands, use the ';' or '&&' operator to separate them. DO NOT use newlines (newlines are ok in quoted strings).\n" +
            "- You shall avoid use the markdown code block syntax (backtick, '`') in your command, as it will be interpreted as a command substitution.",
          parameters: {
            type: 'object',
            properties: {
              command: {
                type: 'string',
                description: 'The CLI command to execute. This should be valid for the current operating system.'
              },
              cwd: {
                type: 'string',
                description: 'The working directory to execute the command in.'
              }
            },
            required: [
              'command'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'readBackgroundJobOutput',
          description: '- Retrieves output from a running or completed background job or async task\n' +
            '- Takes a backgroundJobId parameter identifying the job or task\n' +
            '- For terminal jobs, returns only new output since the last check\n' +
            '- For task IDs, returns the latest attemptCompletion result once completed\n' +
            '- Returns stdout and stderr output along with job status\n' +
            '- Supports optional regex filtering to show only lines matching a pattern\n' +
            '- Use this tool when you need to monitor or check the output of a long-running background job',
          parameters: {
            type: 'object',
            properties: {
              backgroundJobId: {
                type: 'string',
                description: 'The ID of the background job to get output from'
              },
              regex: {
                type: 'string',
                description: 'Optional regular expression to filter the output lines. Only lines matching this regex will be included in the result. Any lines that do not match will no longer be available to read.'
              }
            },
            required: [
              'backgroundJobId'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'killBackgroundJob',
          description: '- Kills a running background job by its ID\n' +
            '- Takes a backgroundJobId parameter identifying the job to kill\n' +
            '- Returns a success or failure status\n' +
            '- Use this tool when you need to terminate a long-running background job',
          parameters: {
            type: 'object',
            properties: {
              backgroundJobId: {
                type: 'string',
                description: 'The ID of the background job to kill.'
              }
            },
            required: [
              'backgroundJobId'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'webFetch',
          description: '- Fetches content from a specified URL and converts HTML to markdown\n' +
            '- Use this tool when you need to retrieve and analyze web content\n' +
            '\n' +
            'Usage notes:\n' +
            '  - IMPORTANT: If an MCP-provided web fetch tool is available, prefer using that tool instead of this one, as it may have fewer restrictions.\n' +
            '  - The URL must be a fully-formed valid URL\n' +
            '  - The prompt should describe what information you want to extract from the page\n' +
            '  - This tool is read-only and does not modify any files\n' +
            '  - Includes a self-cleaning 10-minute cache for faster responses when repeatedly accessing the same URL',
          parameters: {
            '$schema': 'https://json-schema.org/draft/2020-12/schema',
            type: 'object',
            properties: {
              url: {
                type: 'string',
                format: 'uri'
              }
            },
            required: [
              'url'
            ],
            additionalProperties: false
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'webSearch',
          description: '- Allows Pochi to search the web and use the results to inform responses\n' +
            '- Provides up-to-date information for current events and recent data\n' +
            '- Returns search result information formatted as search result blocks, including links as markdown hyperlinks\n' +
            '- Searches are performed automatically within a single API call\n' +
            '\n' +
            'CRITICAL REQUIREMENT - You MUST follow this:\n' +
            `  - After answering the user's question, you MUST include a "Sources:" section at the end of your response\n` +
            '  - In the Sources section, list all relevant URLs from the search results as markdown hyperlinks: [Title](URL)\n' +
            '  - This is MANDATORY - never skip including sources in your response\n' +
            '  - Example format:\n' +
            '\n' +
            '    [Your answer here]\n' +
            '\n' +
            '    Sources:\n' +
            '    - [Source Title 1](https://example.com/1)\n' +
            '    - [Source Title 2](https://example.com/2)\n' +
            '\n' +
            'Usage notes:\n' +
            `  - Account for "Today's date" in <system-reminder>. For example, if <system-reminder> says "Today's date: 2025-07-01", and the user wants the latest docs, do not use 2024 in the search query. Use 2025.`,
          parameters: {
            '$schema': 'https://json-schema.org/draft/2020-12/schema',
            type: 'object',
            properties: {
              query: {
                description: 'The search query to perform',
                type: 'string'
              },
              country: {
                description: "Country code to filter search results by, e.g. 'US', 'GB', 'JP'",
                type: 'string'
              }
            },
            required: [
              'query'
            ],
            additionalProperties: false
          }
        }
      }
    ],
    tool_choice: 'auto',
    stream: true
  }
}
2026-03-19 09:19:34.767	DEBUG	/$bunfs/pochi:454339	listFiles	Listing workspace files from /root with maxItems 500
2026-03-19 09:19:45.964	DEBUG	/$bunfs/pochi:454339	listFiles	Listing workspace files from /root with maxItems 500
2026-03-19 09:19:46.217	ERROR	/$bunfs/pochi:432009	LiveChatKit	onError

 AI_APICallError  This request would exceed your organization's rate limit of 2,000,000 input tokens per minute (org: e70c8d22-9099-49c5-a9af-e059e6515b76, model: claude-opus-4-6). For details, refer to: https://docs.claude.com/en/api/rate-limits. You can see the response headers for current usage. Please reduce the prompt length or the maximum tokens requested, or try again later. You may also contact sales at https://claude.com/contact-sales to discuss your options for a rate limit increase., AI_APICallError, , https://api.anthropic.com/v1/chat/completions, [object Object], 429, [object Object], {"error":{"code":"rate_limit_error","message":"This request would exceed your organization's rate limit of 2,000,000 input tokens per minute (org: e70c8d22-9099-49c5-a9af-e059e6515b76, model: claude-opus-4-6). For details, refer to: https://docs.claude.com/en/api/rate-limits. You can see the response headers for current usage. Please reduce the prompt length or the maximum tokens requested, or try again later. You may also contact sales at https://claude.com/contact-sales to discuss your options for a rate limit increase.","type":"invalid_request_error","param":null}}, true, [object Object], 423231, 30, 423231, 30, /$bunfs/root/pochi
error stack:
  • pochi	<anonymous>
	/$bunfs/pochi:423231
  • pochi	async <anonymous>
	/$bunfs/pochi:423092
  • native	processTicksAndRejections
	native:7
2026-03-19 09:19:46.231	ERROR	/$bunfs/pochi:502749	TaskRunner	Task is failed, trying to resend last message to resume it. {
  kind: 'APICallError',
  isRetryable: true,
  message: "This request would exceed your organization's rate limit of 2,000,000 input tokens per minute (org: e70c8d22-9099-49c5-a9af-e059e6515b76, model: claude-opus-4-6). For details, refer to: https://docs.claude.com/en/api/rate-limits. You can see the response headers for current usage. Please reduce the prompt length or the maximum tokens requested, or try again later. You may also contact sales at https://claude.com/contact-sales to discuss your options for a rate limit increase.",
  requestBodyValues: {
    model: 'claude-opus-4-6',
    max_tokens: 4096,
    messages: [
      {
        role: 'system',
        content: 'You are Pochi, a highly skilled software engineer with extensive knowledge in many programming languages, frameworks, design patterns, and best practices.\n' +
          '\n' +
          'IMPORTANT: You must NEVER generate or guess URLs for the user unless you are confident that the URLs are for helping the user with programming. You may use URLs provided by the user in their messages or local files.\n' +
          '\n' +
          'If the user asks for help or wants to give feedback inform them of the following:\n' +
          '- Join the discord channel at https://getpochi.com/discord to ask questions and get help\n' +
          '- To report bugs, users should report the issue at https://github.com/TabbyML/pochi/issues\n' +
          '\n' +
          "When the user directly asks about Pochi (eg 'can Pochi do...', 'does Pochi have...') or asks in second person (eg 'are you able...', 'can you do...'), first use curl to gather information to answer the question from Pochi docs at https://docs.getpochi.com/llms.txt\n" +
          '\n' +
          '====\n' +
          '\n' +
          'TASK MANAGEMENT\n' +
          '\n' +
          'You have access to the todoWrite tool to help you manage and plan tasks. Use these tools VERY frequently to ensure that you are tracking your tasks and giving the user visibility into your progress.\n' +
          'These tools are also EXTREMELY helpful for planning tasks, and for breaking down larger complex tasks into smaller steps. If you do not use this tool when planning, you may forget to do important tasks - and that is unacceptable.\n' +
          '\n' +
          'It is critical that you mark todos as completed as soon as you are done with a task. Do not batch up multiple tasks before marking them as completed.\n' +
          '\n' +
          '====\n' +
          '\n' +
          'RULES\n' +
          '\n' +
          "- User messages may include <system-reminder> tags. <system-reminder> tags contain useful information and reminders. They are NOT part of the user's provided input or the tool result. You shall pay close attention to information in these tags and use it to inform you actions.\n" +
          "- When the user initially gives you a task, a recursive list of all filepaths in the current working directory will be included in <system-reminder> tag. This provides an overview of the project's file structure, offering key insights into the project from directory/file names (how developers conceptualize and organize their code) and file extensions (the language used). This can also guide decision-making on which files to explore further. If you need to further explore directories such as outside the current working directory, you can use the listFiles tool. If you pass 'true' for the recursive parameter, it will list files recursively.\n" +
          '- All file paths used by tools must be relative to current working directory, do not use the ~ character or $HOME to refer to the home directory in file paths used by tools.\n' +
          "- You can use `pochi://` URI schema to access the Pochi virtual file system. This allows you to read and write files that are stored in Pochi's internal storage.\n" +
          "- Be sure to consider the type of project (e.g. Python, JavaScript, web application) when determining the appropriate structure and files to include. Also consider what files may be most relevant to accomplishing the task, for example looking at a project's manifest file would help you understand the project's dependencies, which you could incorporate into any code you write.\n" +
          "- Do not ask for more information than necessary. Use the tools provided to accomplish the user's request efficiently and effectively. When you've completed your task, you must use the attemptCompletion tool to present the result to the user. The user may provide feedback, which you can use to make improvements and try again.\n" +
          '- You are only allowed to ask the user questions using the askFollowupQuestion tool. Use this tool only when you need additional details to complete a task, and be sure to use a clear and concise question that will help you move forward with the task. However if you can use the available tools to avoid having to ask the user questions, you should do so. For example, if the user mentions a file that may be in an outside directory like the Desktop, you should use the listFiles tool to list the files in the Desktop and check if the file they are talking about is there, rather than asking the user to provide the file path themselves.\n' +
          `- You are STRICTLY FORBIDDEN from starting your messages with "Great", "Certainly", "Okay", "Sure". You should NOT be conversational in your responses, but rather direct and to the point. For example you should NOT say "Great, I've updated the CSS" but instead something like "I've updated the CSS". It is important you be clear and technical in your messages.\n` +
          "- Once you've completed the user's task, you MUST use the attemptCompletion tool to present the result of the task to the user. It is STRICTLY FORBIDDEN to complete the task without using this tool.\n" +
          '- When planning large-scale changes, create a high-level diagram using mermaid in Markdown. This helps explain your plan and allows you to gather user feedback before implementation.'
      },
      {
        role: 'user',
        content: [
          {
            type: 'text',
            text: '<system-reminder># System Information\n' +
              '\n' +
              'Operating System: linux\n' +
              'Default Shell: \n' +
              'Home Directory: /root\n' +
              'Current Working Directory: /root\n' +
              'Current Time: Thu Mar 19 2026 09:17:12 GMT+0000 (Coordinated Universal Time)\n' +
              '\n' +
              '# User Information\n' +
              '- Name: Test User\n' +
              '- Email: test@example.com\n' +
              '\n' +
              '# Current Working Directory (/root) Files\n' +
              '.bashrc\n' +
              '.profile\n' +
              '.daytona\n' +
              '.pochi\n' +
              '.gitconfig\n' +
              '.daytona/sessions\n' +
              '.pochi/config.jsonc\n' +
              '.daytona/sessions/a3777110-8132-47af-b51b-5923306e85aa\n' +
              '.daytona/sessions/693f5c50-112b-4d7e-b770-9650df4dec45\n' +
              '.daytona/sessions/380662f8-8805-47f4-91d4-31c76feba356\n' +
              '.daytona/sessions/9fa6e4a8-0a92-4a65-ac29-ae9e066c28a4\n' +
              '.daytona/sessions/a3777110-8132-47af-b51b-5923306e85aa/b4ba62f8-aee3-4106-9aef-66f6c5df79f2\n' +
              '.daytona/sessions/693f5c50-112b-4d7e-b770-9650df4dec45/ebb5ee05-6f54-4f88-9e78-089e3dc49fda\n' +
              '.daytona/sessions/380662f8-8805-47f4-91d4-31c76feba356/d6e3820d-c720-4dd4-b5a4-372b6a6f4077\n' +
              '.daytona/sessions/9fa6e4a8-0a92-4a65-ac29-ae9e066c28a4/4f04fe80-a746-46a5-b898-0d363239583c\n' +
              '.daytona/sessions/a3777110-8132-47af-b51b-5923306e85aa/b4ba62f8-aee3-4106-9aef-66f6c5df79f2/exit_code\n' +
              '.daytona/sessions/693f5c50-112b-4d7e-b770-9650df4dec45/ebb5ee05-6f54-4f88-9e78-089e3dc49fda/exit_code\n' +
              '.daytona/sessions/380662f8-8805-47f4-91d4-31c76feba356/d6e3820d-c720-4dd4-b5a4-372b6a6f4077/exit_code\n' +
              '\n' +
              '# GIT STATUS\n' +
              'Current branch: \n' +
              'Main branch (you will usually use this for PRs): \n' +
              '\n' +
              'Recent commits:\n' +
              '\n' +
              '\n' +
              '# TODOs\n' +
              'No TODOs yet, if you are working on tasks that would benefit from a todo list please use the todoWrite tool to create one.</system-reminder>'
          },
          {
            type: 'text',
            text: 'You are a developer migrating from Git to Jujutsu (jj). You have an existing local Git repository at `/home/user/my-project`. Your task is to start using jj with this repository without breaking Git compatibility.\\n\\n1. Navigate to `/home/user/my-project`.\\n2. Initialize a colocated jj repository so that jj and Git can be used together.\\n3. Create a new bookmark named `feature-x`.\\n4. Create a new file named `feature.txt` containing the text `Hello jj`.\\n5. Create a new jj commit (or describe the working copy) with the description `Add feature.txt`.\\n\\nWhen finished, the repository should be a valid colocated jj/Git repo, the `feature-x` bookmark should exist and be exported to Git, and the commit should have the specified description and file.'
          }
        ]
      },
      {
        role: 'assistant',
        content: '\n' +
          '\n' +
          "I'll work through this step-by-step, migrating the Git repository to use Jujutsu (jj) in colocated mode.",
        tool_calls: [
          {
            id: 'toolu_011rCkj2REAg3R87c4PHJkcQ',
            type: 'function',
            function: {
              name: 'todoWrite',
              arguments: `{"todos":[{"id":"check-repo","content":"Check if /home/user/my-project exists and has a Git repo","status":"in-progress","priority":"high"},{"id":"init-jj","content":"Initialize colocated jj repository","status":"pending","priority":"high"},{"id":"create-bookmark","content":"Create feature-x bookmark","status":"pending","priority":"high"},{"id":"create-file","content":"Create feature.txt with 'Hello jj'","status":"pending","priority":"high"},{"id":"describe-commit","content":"Describe/create commit with 'Add feature.txt'","status":"pending","priority":"high"},{"id":"verify","content":"Verify colocated repo, bookmark, and commit","status":"pending","priority":"high"}]}`
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_011rCkj2REAg3R87c4PHJkcQ',
        content: '{"success":true}'
      },
      {
        role: 'assistant',
        content: '',
        tool_calls: [
          {
            id: 'toolu_0174ARF4pbW41KSU4HQtRVw4',
            type: 'function',
            function: {
              name: 'executeCommand',
              arguments: '{"command":"ls -la /home/user/my-project 2>/dev/null; echo \\"---\\"; ls -la /home/user/my-project/.git 2>/dev/null"}'
            }
          },
          {
            id: 'toolu_01FmkuNLXYsjxvTsBfVmHFba',
            type: 'function',
            function: {
              name: 'executeCommand',
              arguments: '{"command":"which jj && jj --version"}'
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_0174ARF4pbW41KSU4HQtRVw4',
        content: '{"output":"total 8\\r\\ndrwxr-xr-x 3 root root   47 Mar 11 12:10 .\\r\\ndrwxr-xr-x 1 root root   32 Mar 11 12:10 ..\\r\\ndrwxr-xr-x 8 root root 4096 Mar 11 12:10 .git\\r\\n-rw-r--r-- 1 root root   15 Mar 11 12:10 README.md\\r\\n---\\r\\ntotal 28\\r\\ndrwxr-xr-x 8 root root 4096 Mar 11 12:10 .\\r\\ndrwxr-xr-x 3 root root   47 Mar 11 12:10 ..\\r\\n-rw-r--r-- 1 root root   15 Mar 11 12:10 COMMIT_EDITMSG\\r\\n-rw-r--r-- 1 root root   21 Mar 11 12:10 HEAD\\r\\ndrwxr-xr-x 2 root root    6 Mar 11 12:10 branches\\r\\n-rw-r--r-- 1 root root   92 Mar 11 12:10 config\\r\\n-rw-r--r-- 1 root root   73 Mar 11 12:10 description\\r\\ndrwxr-xr-x 2 root root 4096 Mar 11 12:10 hooks\\r\\n-rw-r--r-- 1 root root  137 Mar 11 12:10 index\\r\\ndrwxr-xr-x 2 root root   29 Mar 11 12:10 info\\r\\ndrwxr-xr-x 3 root root   30 Mar 11 12:10 logs\\r\\ndrwxr-xr-x 7 root root   84 Mar 11 12:10 objects\\r\\ndrwxr-xr-x 4 root root   43 Mar 11 12:10 refs\\r\\n","isTruncated":false}'
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_01FmkuNLXYsjxvTsBfVmHFba',
        content: '{"output":"/usr/local/bin/jj\\r\\njj 0.38.0-2508982cde5c7e4db0933e0b6469f9e778e71e28\\r\\n","isTruncated":false}'
      },
      {
        role: 'assistant',
        content: 'The Git repository exists at `/home/user/my-project` with a `README.md` file, and `jj` v0.38.0 is installed.',
        tool_calls: [
          {
            id: 'toolu_01ULas2uw3TnyRPAHN6aUhhT',
            type: 'function',
            function: {
              name: 'todoWrite',
              arguments: `{"todos":[{"id":"check-repo","content":"Check if /home/user/my-project exists and has a Git repo","status":"completed","priority":"high"},{"id":"init-jj","content":"Initialize colocated jj repository","status":"in-progress","priority":"high"},{"id":"create-bookmark","content":"Create feature-x bookmark","status":"pending","priority":"high"},{"id":"create-file","content":"Create feature.txt with 'Hello jj'","status":"pending","priority":"high"},{"id":"describe-commit","content":"Describe/create commit with 'Add feature.txt'","status":"pending","priority":"high"},{"id":"verify","content":"Verify colocated repo, bookmark, and commit","status":"pending","priority":"high"}]}`
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_01ULas2uw3TnyRPAHN6aUhhT',
        content: '{"success":true}'
      },
      {
        role: 'assistant',
        content: '**Step 1 & 2: Initialize a colocated jj repository.** The `--colocate` flag (or running `jj git init --colocate` inside an existing Git repo) sets up jj to share the `.git` directory, so both tools work together.',
        tool_calls: [
          {
            id: 'toolu_019jY8xFeB1m7PfbXfapjtni',
            type: 'function',
            function: {
              name: 'executeCommand',
              arguments: '{"command":"cd /home/user/my-project && jj git init --colocate"}'
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_019jY8xFeB1m7PfbXfapjtni',
        content: '{"output":"Done importing changes from the underlying Git repo.\\r\\nInitialized repo in \\".\\"\\r\\nHint: Running `git clean -xdf` will remove `.jj/`!\\r\\n","isTruncated":false}'
      },
      {
        role: 'assistant',
        content: 'Colocated jj repository initialized. Let me verify the `.jj` directory was created alongside `.git`:',
        tool_calls: [
          {
            id: 'toolu_017U73gxk7EtcnybfQfMwDDW',
            type: 'function',
            function: {
              name: 'executeCommand',
              arguments: '{"command":"ls -la /home/user/my-project/ | head -20"}'
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_017U73gxk7EtcnybfQfMwDDW',
        content: '{"output":"total 4\\r\\ndrwxr-xr-x 1 root root 41 Mar 19 09:17 .\\r\\ndrwxr-xr-x 1 root root 32 Mar 11 12:10 ..\\r\\ndrwxr-xr-x 1 root root 45 Mar 11 12:10 .git\\r\\ndrwxr-xr-x 4 root root 72 Mar 19 09:17 .jj\\r\\n-rw-r--r-- 1 root root 15 Mar 11 12:10 README.md\\r\\n","isTruncated":false}'
      },
      {
        role: 'assistant',
        content: 'Both `.git` and `.jj` directories exist — the repo is colocated.',
        tool_calls: [
          {
            id: 'toolu_01RbFKbcqvYrAPXMhdewxZNQ',
            type: 'function',
            function: {
              name: 'todoWrite',
              arguments: `{"todos":[{"id":"check-repo","content":"Check if /home/user/my-project exists and has a Git repo","status":"completed","priority":"high"},{"id":"init-jj","content":"Initialize colocated jj repository","status":"completed","priority":"high"},{"id":"create-bookmark","content":"Create feature-x bookmark","status":"in-progress","priority":"high"},{"id":"create-file","content":"Create feature.txt with 'Hello jj'","status":"pending","priority":"high"},{"id":"describe-commit","content":"Describe/create commit with 'Add feature.txt'","status":"pending","priority":"high"},{"id":"verify","content":"Verify colocated repo, bookmark, and commit","status":"pending","priority":"high"}]}`
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_01RbFKbcqvYrAPXMhdewxZNQ',
        content: '{"success":true}'
      },
      {
        role: 'assistant',
        content: '**Step 3: Create the `feature-x` bookmark.** Let me first check the current jj log to understand the state:',
        tool_calls: [
          {
            id: 'toolu_0194HmfhNtUVQ4zP16p2MXym',
            type: 'function',
            function: {
              name: 'executeCommand',
              arguments: '{"command":"cd /home/user/my-project && jj log"}'
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_0194HmfhNtUVQ4zP16p2MXym',
        content: '{"output":"@  uyntpwtv (no email set) 2026-03-19 09:17:41 5d317252\\r\\n│  (empty) (no description set)\\r\\nā—‹  ypsoummp test@example.com 2026-03-11 12:10:51 main 14d944a2\\r\\n│  Initial commit\\r\\nā—†  zzzzzzzz root() 00000000\\r\\n","isTruncated":false}'
      },
      {
        role: 'assistant',
        content: "The working copy change (`@`) is on top of the `main` branch. Now I'll create the `feature-x` bookmark pointing to the current working copy change:",
        tool_calls: [
          {
            id: 'toolu_01Bqso2WjCh52bGNmUGaHTFv',
            type: 'function',
            function: {
              name: 'executeCommand',
              arguments: '{"command":"cd /home/user/my-project && jj bookmark create feature-x -r @"}'
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_01Bqso2WjCh52bGNmUGaHTFv',
        content: `{"output":"Warning: Target revision is empty.\\r\\nCreated 1 bookmarks pointing to uyntpwtv 5d317252 feature-x | (empty) (no description set)\\r\\nWarning: Name and email not configured. Until configured, your commits will be created with the empty identity, and can't be pushed to remotes.\\r\\nHint: To configure, run:\\r\\n  jj config set --user user.name \\"Some One\\"\\r\\n  jj config set --user user.email \\"someone@example.com\\"\\r\\n","isTruncated":false}`
      },
      {
        role: 'assistant',
        content: '',
        tool_calls: [
          {
            id: 'toolu_01L3ZYAHCdqTVwMNgE1PPERS',
            type: 'function',
            function: {
              name: 'todoWrite',
              arguments: `{"todos":[{"id":"check-repo","content":"Check if /home/user/my-project exists and has a Git repo","status":"completed","priority":"high"},{"id":"init-jj","content":"Initialize colocated jj repository","status":"completed","priority":"high"},{"id":"create-bookmark","content":"Create feature-x bookmark","status":"completed","priority":"high"},{"id":"create-file","content":"Create feature.txt with 'Hello jj'","status":"in-progress","priority":"high"},{"id":"describe-commit","content":"Describe/create commit with 'Add feature.txt'","status":"pending","priority":"high"},{"id":"verify","content":"Verify colocated repo, bookmark, and commit","status":"pending","priority":"high"}]}`
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_01L3ZYAHCdqTVwMNgE1PPERS',
        content: '{"success":true}'
      },
      {
        role: 'assistant',
        content: '**Step 4: Create `feature.txt` with the text `Hello jj`.**',
        tool_calls: [
          {
            id: 'toolu_01UTmkEZMJjWuXVJ3nbfuwtw',
            type: 'function',
            function: {
              name: 'writeToFile',
              arguments: '{"path":"/home/user/my-project/feature.txt","content":"Hello jj\\n"}'
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_01UTmkEZMJjWuXVJ3nbfuwtw',
        content: '{"success":true}'
      },
      {
        role: 'assistant',
        content: '',
        tool_calls: [
          {
            id: 'toolu_01CJMGCaa5eWDGRn4qEz6FDV',
            type: 'function',
            function: {
              name: 'todoWrite',
              arguments: `{"todos":[{"id":"check-repo","content":"Check if /home/user/my-project exists and has a Git repo","status":"completed","priority":"high"},{"id":"init-jj","content":"Initialize colocated jj repository","status":"completed","priority":"high"},{"id":"create-bookmark","content":"Create feature-x bookmark","status":"completed","priority":"high"},{"id":"create-file","content":"Create feature.txt with 'Hello jj'","status":"completed","priority":"high"},{"id":"describe-commit","content":"Describe/create commit with 'Add feature.txt'","status":"in-progress","priority":"high"},{"id":"verify","content":"Verify colocated repo, bookmark, and commit","status":"pending","priority":"high"}]}`
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_01CJMGCaa5eWDGRn4qEz6FDV',
        content: '{"success":true}'
      }
    ],
    tools: [
      {
        type: 'function',
        function: {
          name: 'applyDiff',
          description: "This is a tool for editing files. For moving or renaming files, you should generally use the executeCommand tool with the 'mv' command instead. For larger edits, use the writeFile tool to overwrite files.\n" +
            '\n' +
            "Before using this tool, use the readFile tool to understand the file's contents and context\n" +
            '\n' +
            'To make a file edit, provide the following:\n' +
            '1. path: The path to the file to modify (relative to the current working directory, or an absolute path)\n' +
            '2. searchContent: The text to replace (must match the file contents exactly, including all whitespace and indentation)\n' +
            '3. replaceContent: The edited text to replace the searchContent (must be different from searchContent)\n' +
            '4. expectedReplacements: The number of replacements you expect to make. Defaults to 1 if not specified.\n' +
            '\n' +
            'By default, the tool will replace ONE occurrence of searchContent with replaceContent in the specified file. If you want to replace multiple occurrences, provide the expectedReplacements parameter with the exact number of occurrences you expect.\n' +
            '\n' +
            'CRITICAL REQUIREMENTS FOR USING THIS TOOL:\n' +
            '\n' +
            '1. UNIQUENESS (when expectedReplacements is not specified): The searchContent MUST uniquely identify the specific instance you want to change. This means:\n' +
            '   - Include AT LEAST 3-5 lines of context BEFORE the change point\n' +
            '   - Include AT LEAST 3-5 lines of context AFTER the change point\n' +
            '   - Include all whitespace, indentation, and surrounding code exactly as it appears in the file\n' +
            '\n' +
            '2. EXPECTED MATCHES: If you want to replace multiple instances:\n' +
            '   - Use the expectedReplacements parameter with the exact number of occurrences you expect to replace\n' +
            '   - This will replace ALL occurrences of the searchContent with the replaceContent\n' +
            "   - If the actual number of matches doesn't equal expectedReplacements, the edit will fail\n" +
            '   - This is a safety feature to prevent unintended replacements\n' +
            '\n' +
            '3. VERIFICATION: Before using this tool:\n' +
            '   - Check how many instances of the target text exist in the file\n' +
            '   - If multiple instances exist, either:\n' +
            '     a) Gather enough context to uniquely identify each one and make separate calls, OR\n' +
            '     b) Use expectedReplacements parameter with the exact count of instances you expect to replace\n' +
            '\n' +
            'WARNING:\n' +
            "- The tool will fail if searchContent matches multiple locations and expectedReplacements isn't specified\n" +
            "- The tool will fail if the number of matches doesn't equal expectedReplacements when it's specified\n" +
            "- The tool will fail if searchContent doesn't match the file contents exactly (including whitespace)\n" +
            '- The tool will fail if searchContent and replaceContent are the same\n' +
            '\n' +
            'When making edits:\n' +
            '   - Ensure the edit results in idiomatic, correct code\n' +
            '   - Do not add trailing whitespace to lines (a newline at the end of a file is fine)\n' +
            '   - Do not leave the code in a broken state\n' +
            '\n' +
            'If you want to create a new file, use:\n' +
            '   - A new file path, including dir name if needed\n' +
            '   - An empty searchContent\n' +
            "   - The new file's contents as replaceContent\n" +
            '\n' +
            'Remember: when making multiple file edits in a row to the same file, you should prefer to send all edits in a single message with multiple calls to this tool, rather than multiple messages with a single call each.\n' +
            '\n' +
            'You may see the following fields in the result:\n' +
            '- autoFormattingEdits: If the auto-formatter makes any changes, this field will contain a diff against the file content after your edits and any user edits have been applied.\n' +
            '- newProblems: If any new problems are found after the edit, this field will contain information about them.',
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path of the file to modify (relative to the current working directory, or an absolute path).'
              },
              searchContent: {
                type: 'string',
                description: 'The text to replace.'
              },
              replaceContent: {
                type: 'string',
                description: 'The text to replace it with.'
              },
              expectedReplacements: {
                type: 'number',
                description: 'The expected number of replacements to perform. Defaults to 1 if not specified.'
              }
            },
            required: [
              'path',
              'searchContent',
              'replaceContent'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'askFollowupQuestion',
          description: 'Ask the user a question to gather additional information needed to complete the task. \n' +
            '\n' +
            '## When to Use This Tool\n' +
            'Use this tool in the following scenarios:\n' +
            "1. The user's request is ambiguous or unclear and requires clarification.\n" +
            '2. You need more details to proceed effectively.\n' +
            '3. You have made several unsuccessful attempts to solve the issue and need user guidance to move forward.\n' +
            '4. Offer choices to the user about what direction to take.\n' +
            '\n' +
            '## Usage Notes\n' +
            '- Users will always be able to select "Other" to provide custom text input\n' +
            '- Use multiSelect: true to allow multiple answers to be selected for a question\n' +
            '- If you recommend a specific option, make that the first option in the list and add "(Recommended)" at the end of the label\n' +
            '- Provide 1-4 questions per call\n' +
            '\n' +
            'IMPORTANT: This tool CANNOT be used in combination with other tools (except todoWrite) in a single step. If you need to use other tools, you must do so in a separate step before calling this tool.',
          parameters: {
            type: 'object',
            properties: {
              questions: {
                type: 'array',
                items: {
                  type: 'object',
                  properties: {
                    question: {
                      type: 'string',
                      description: 'The complete question to ask the user. Should be clear, specific, and end with a question mark.'
                    },
                    header: {
                      type: 'string',
                      maxLength: 12,
                      description: 'Very short label displayed as a chip/tag (max 12 chars). Examples: "Auth method", "Library", "Approach".'
                    },
                    options: {
                      type: 'array',
                      items: {
                        type: 'object',
                        properties: {
                          label: {
                            type: 'string',
                            description: 'Short button label shown to the user. Should be concise (1-5 words) and clearly describe the choice.'
                          },
                          description: {
                            type: 'string',
                            description: 'Explanation of what this option means or what will happen if chosen. Useful for providing context about trade-offs or implications.'
                          }
                        },
                        required: [
                          'label'
                        ],
                        additionalProperties: false
                      },
                      minItems: 2,
                      maxItems: 4,
                      description: "The available choices for this question. Must have 2-4 options. Each option should be a distinct, mutually exclusive choice (unless multiSelect is enabled). There should be no 'Other' option, that will be provided automatically."
                    },
                    multiSelect: {
                      type: 'boolean',
                      default: false,
                      description: 'Set to true to allow the user to select multiple options instead of just one. Use when choices are not mutually exclusive.'
                    }
                  },
                  required: [
                    'question',
                    'header',
                    'options'
                  ],
                  additionalProperties: false
                },
                minItems: 1,
                maxItems: 4,
                description: 'Questions to ask the user (1-4 questions).'
              }
            },
            required: [
              'questions'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'attemptCompletion',
          description: "Once you've received the results of tool uses and can confirm that the task is complete, use this tool to present the result of your work to the user.\n" +
            '\n' +
            'You MUST NOT generate any text before this tool call. All conclusion text must be included within the result parameter of the attemptCompletion tool.\n' +
            'Never use this tool with a question or request to engage in further conversation! Formulate the end of your result in a way that is final and does not require further input from the user.\n' +
            '\n' +
            'IMPORTANT: This tool CANNOT be used in combination with other tools (except todoWrite) in a single step. If you need to use other tools, you must do so in a separate step before calling this tool.',
          parameters: {
            '$schema': 'http://json-schema.org/draft-07/schema#',
            type: 'object',
            properties: {
              result: {
                description: 'The result of the task. Formulate this result in a way that is final and does not require further input from the user.',
                type: 'string'
              }
            },
            required: [
              'result'
            ],
            additionalProperties: false
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'executeCommand',
          description: 'Executes a given bash command in a persistent shell session with optional timeout, ensuring proper handling and security measures.\n' +
            '\n' +
            'IMPORTANT: This tool is for terminal operations like git, npm, docker, etc. DO NOT use it for file operations (reading, writing, editing, searching, finding files) - use the specialized tools for this instead.\n' +
            '\n' +
            'Before executing the command, please follow these steps:\n' +
            '\n' +
            '1. Directory Verification:\n' +
            '   - If the command will create new directories or files, first use listFiles to verify the parent directory exists and is the correct location\n' +
            '   - For example, before running "mkdir foo/bar", first use listFiles to check that "foo" exists and is the intended parent directory\n' +
            '\n' +
            '2. Command Execution:\n' +
            '   - Always quote file paths that contain spaces with double quotes (e.g., cd "path with spaces/file.txt")\n' +
            '   - Examples of proper quoting:\n' +
            '     - cd "/Users/name/My Documents" (correct)\n' +
            '     - cd /Users/name/My Documents (incorrect - will fail)\n' +
            '     - python "/path/with spaces/script.py" (correct)\n' +
            '     - python /path/with spaces/script.py (incorrect - will fail)\n' +
            '   - After ensuring proper quoting, execute the command.\n' +
            '   - Capture the output of the command.\n' +
            '\n' +
            'Usage notes:\n' +
            '- The command argument is required.\n' +
            '- You can specify an optional timeout in seconds (up to 300s / 5 minutes). If not specified, commands will timeout after 60s (1 minute).\n' +
            '- If the output exceeds 30000 characters, output will be truncated before being returned to you.\n' +
            '- When issuing multiple commands:\n' +
            '  - If the commands are independent and can run in parallel, make multiple executeCommand tool calls in a single message. For example, if you need to run "git status" and "git diff", send a single message with two executeCommand tool calls in parallel.\n' +
            '  - If the commands depend on each other and must run sequentially, use a single executeCommand call with \'&&\' to chain them together (e.g., `git add . && git commit -m "message" && git push`). For instance, if one operation must complete before another starts (like mkdir before cp, Write before executeCommand for git operations, or git add before git commit), run these operations sequentially instead.\n' +
            "  - Use ';' only when you need to run commands sequentially but don't care if earlier commands fail\n" +
            '  - DO NOT use newlines to separate commands (newlines are ok in quoted strings)\n' +
            "- You shall avoid use the markdown code block syntax (backtick, '`') in your command, as it will be interpreted as a command substitution.\n" +
            "- Before using this tool, you must first think about the context provided in <system-reminder> to understand the user's environment and tailor your commands to ensure they are compatible with their system. You must also consider if the command you need to run should be executed in a specific directory rather than the current working directory, and properly set the `cwd` if necessary.\n" +
            '\n' +
            '# Committing changes with git\n' +
            '\n' +
            'Only create commits when requested by the user. If unclear, ask first. When the user asks you to create a new git commit, follow these steps carefully:\n' +
            '\n' +
            'Git Safety Protocol:\n' +
            '- NEVER update the git config\n' +
            "- NEVER run destructive git commands (push --force, reset --hard, checkout ., restore ., clean -f, branch -D) unless the user explicitly requests these actions. Taking unauthorized destructive actions is unhelpful and can result in lost work, so it's best to ONLY run these commands when given direct instructions \n" +
            '- NEVER skip hooks (--no-verify, --no-gpg-sign, etc) unless the user explicitly requests it\n' +
            '- NEVER run force push to main/master, warn the user if they request it\n' +
            '- CRITICAL: Always create NEW commits rather than amending, unless the user explicitly requests a git amend. When a pre-commit hook fails, the commit did NOT happen  — so --amend would modify the PREVIOUS commit, which may result in destroying work or losing previous changes. Instead, after hook failure, fix the issue, re-stage, and create a NEW commit\n' +
            '- When staging files, prefer adding specific files by name rather than using "git add -A" or "git add .", which can accidentally include sensitive files (.env, credentials) or large binaries\n' +
            '- NEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked, otherwise the user will feel that you are being too proactive\n' +
            '\n' +
            '1. You can call multiple tools in a single response. When multiple independent pieces of information are requested and all commands are likely to succeed, run multiple tool calls in parallel for optimal performance. run the following bash commands in parallel, each using the executeCommand tool:\n' +
            '  - Run a git status command to see all untracked files. IMPORTANT: Never use the -uall flag as it can cause memory issues on large repos.\n' +
            '  - Run a git diff command to see both staged and unstaged changes that will be committed.\n' +
            "  - Run a git log command to see recent commit messages, so that you can follow this repository's commit message style.\n" +
            '2. Analyze all staged changes (both previously staged and newly added) and draft a commit message:\n' +
            '  - Summarize the nature of the changes (eg. new feature, enhancement to an existing feature, bug fix, refactoring, test, docs, etc.). Ensure the message accurately reflects the changes and their purpose (i.e. "add" means a wholly new feature, "update" means an enhancement to an existing feature, "fix" means a bug fix, etc.).\n' +
            '  - Do not commit files that likely contain secrets (.env, credentials.json, etc). Warn the user if they specifically request to commit those files\n' +
            '  - Draft a concise (1-2 sentences) commit message that focuses on the "why" rather than the "what"\n' +
            '  - Ensure it accurately reflects the changes and their purpose\n' +
            '3. You can call multiple tools in a single response. When multiple independent pieces of information are requested and all commands are likely to succeed, run multiple tool calls in parallel for optimal performance. run the following commands:\n' +
            '   - Add relevant untracked files to the staging area.\n' +
            '   - Create the commit with a message ending with:\n' +
            '   šŸ¤– Generated with [Pochi](https://getpochi.com) | [Task](<Share URL>)\n' +
            '\n' +
            '   Co-Authored-By: Pochi <noreply@getpochi.com>\n' +
            '\n' +
            '   Note: Replace <Share URL> with the Share URL from system information if available. If not available, omit the " | [Task](...)" part.\n' +
            '\n' +
            '   - Run git status after the commit completes to verify success.\n' +
            '   Note: git status depends on the commit completing, so run it sequentially after the commit.\n' +
            '4. If the commit fails due to pre-commit hook changes, retry the commit ONCE to include these automated changes. If it fails again, it usually means a pre-commit hook is preventing the commit. If the commit succeeds but you notice that files were modified by the pre-commit hook, you MUST amend your commit to include them.\n' +
            '\n' +
            'Important notes:\n' +
            '- NEVER update the git config\n' +
            '- NEVER run additional commands to read or explore code, besides git bash commands\n' +
            '- DO NOT push to the remote repository unless the user explicitly asks you to do so\n' +
            '- IMPORTANT: Never use git commands with the -i flag (like git rebase -i or git add -i) since they require interactive input which is not supported.\n' +
            '- IMPORTANT: Do not use --no-edit with git rebase commands, as the --no-edit flag is not a valid option for git rebase.\n' +
            '- If there are no changes to commit (i.e., no untracked files and no modifications), do not create an empty commit\n' +
            '- In order to ensure good formatting, ALWAYS pass the commit message via a HEREDOC, a la this example:\n' +
            '<example>\n' +
            `git commit -m "$(cat <<'EOF'\n` +
            'Commit message here.\n' +
            '\n' +
            'šŸ¤– Generated with [Pochi](https://getpochi.com) | [Task](<Share URL>)\n' +
            '\n' +
            'Co-Authored-By: Pochi <noreply@getpochi.com>\n' +
            'EOF\n' +
            ')"\n' +
            '</example>\n' +
            '\n' +
            '# Creating pull requests\n' +
            'Use the gh command via the executeCommand tool for ALL GitHub-related tasks including working with issues, pull requests, checks, and releases. If given a Github URL use the gh command to get the information needed.\n' +
            '\n' +
            'IMPORTANT: When the user asks you to create a pull request, follow these steps carefully:\n' +
            '\n' +
            '1. You can call multiple tools in a single response. When multiple independent pieces of information are requested and all commands are likely to succeed, run multiple tool calls in parallel for optimal performance. run the following bash commands in parallel using the executeCommand tool, in order to understand the current state of the branch since it diverged from the main branch:\n' +
            '   - Run a git status command to see all untracked files (never use -uall flag)\n' +
            '   - Run a git diff command to see both staged and unstaged changes that will be committed\n' +
            '   - Check if the current branch tracks a remote branch and is up to date with the remote, so you know if you need to push to the remote\n' +
            '   - Run a git log command and `git diff [base-branch]...HEAD` to understand the full commit history for the current branch (from the time it diverged from the base branch)\n' +
            '2. Analyze all changes that will be included in the pull request, making sure to look at all relevant commits (NOT just the latest commit, but ALL commits that will be included in the pull request!!!), and draft a pull request title and summary:\n' +
            '   - Keep the PR title short (under 70 characters)\n' +
            '   - Use the description/body for details, not the title\n' +
            '3. You can call multiple tools in a single response. When multiple independent pieces of information are requested and all commands are likely to succeed, run multiple tool calls in parallel for optimal performance. run the following commands in parallel:\n' +
            '   - Create new branch if needed\n' +
            '   - Push to remote with -u flag if needed\n' +
            '   - Create PR using gh pr create with the format below. Use a HEREDOC to pass the body to ensure correct formatting.\n' +
            '<example>\n' +
            `gh pr create --title "the pr title" --body "$(cat <<'EOF'\n` +
            '## Summary\n' +
            '<1-3 bullet points>\n' +
            '\n' +
            '## Test plan\n' +
            '[Checklist of TODOs for testing the pull request...]\n' +
            '\n' +
            'šŸ¤– Generated with [Pochi](https://getpochi.com) | [Task](<Share URL>)\n' +
            'EOF\n' +
            ')"\n' +
            '</example>\n' +
            '\n' +
            'Important:\n' +
            '- NEVER update the git confi'... 355 more characters,
          parameters: {
            type: 'object',
            properties: {
              command: {
                type: 'string',
                description: 'The CLI command to execute. This should be valid for the current operating system.'
              },
              cwd: {
                type: 'string',
                description: 'The working directory to execute the command in.'
              },
              timeout: {
                type: 'number',
                minimum: 1,
                maximum: 300,
                description: 'Optional timeout in seconds, max 300 seconds. By default the timeout is 120 seconds.'
              }
            },
            required: [
              'command'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'globFiles',
          description: 'Request to find files matching a glob pattern within a specified directory. Use this to get a list of files based on a pattern.',
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path of the directory to search in (relative to the current working directory, or an absolute path)'
              },
              globPattern: {
                type: 'string',
                description: "The glob pattern to match files against (e.g., '*.ts', '**/*.js')"
              }
            },
            required: [
              'path',
              'globPattern'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'listFiles',
          description: 'Request to list files and directories within the specified directory. If recursive is true, it will list all files and directories recursively. If recursive is false or not provided, it will only list the top-level contents. Do not use this tool to confirm the existence of files you may have created, as the user will let you know if the files were created successfully or not.',
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path of the directory to list contents for (relative to the current working directory, or an absolute path)'
              },
              recursive: {
                type: 'boolean',
                description: 'Whether to list files and directories recursively.'
              }
            },
            required: [
              'path'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'readFile',
          description: 'Request to read the contents of a file at the specified path. Use this when you need to examine the contents of an existing file you do not know the contents of, for example to analyze code, review text files, extract information from configuration files.\n' +
            '',
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path of the file to read (relative to the current working directory, or an absolute path)'
              },
              startLine: {
                type: 'number',
                description: 'The starting line number to read from (1-based). If not provided, it starts from the beginning of the file.'
              },
              endLine: {
                type: 'number',
                description: 'The ending line number to read to (1-based, inclusive). If not provided, it reads to the end of the file.'
              }
            },
            required: [
              'path'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'useSkill',
          description: 'Execute a skill within the main conversation\n' +
            '\n' +
            'When users ask you to perform tasks, check if any of the available skills below can help complete the task more effectively. Skills provide specialized capabilities and domain knowledge.\n' +
            '\n' +
            'When users ask about a SPECIFIC skill (e.g., "How does the pdf skill work?", "What does the commit skill do?"), you must call this tool to get detailed information about that skill.\n' +
            '\n' +
            'When users ask general questions like "What skills are available?" or "List all skills", simply refer to the "Available skills" section below - do NOT call this tool.\n' +
            '\n' +
            "This tool returns the skill's detailed instructions which you must then follow to complete the task. The instructions contain step-by-step guidance on how to perform the specific task or workflow.\n" +
            '\n' +
            'How to invoke:\n' +
            '- Use this tool with the skill name\n' +
            '- Example: `skill: "pdf-processing"` - invoke the pdf-processing skill\n' +
            "- The tool will return the skill's instructions\n" +
            '- Follow the returned instructions carefully to complete the task\n' +
            '\n' +
            'Important:\n' +
            '- When a skill is relevant for a task OR when users ask about a SPECIFIC skill, you must invoke this tool IMMEDIATELY as your first action\n' +
            '- For general questions about available skills, simply refer to the "Available skills" list below without calling this tool\n' +
            '- NEVER just announce or mention a skill in your text response without actually calling this tool (except for general skill listing requests)\n' +
            '- This is a BLOCKING REQUIREMENT: invoke the relevant Skill tool BEFORE generating any other response about a specific skill or task\n' +
            '- Only use skills listed in "Available skills" below\n' +
            '- Check compatibility requirements before using a skill - ensure the skill is compatible with the current OS/environment\n' +
            '- After calling this tool, follow the returned instructions step by step\n' +
            '- The skill file location is shown in the [Location: filepath] section of each skill listing below - use this information to understand where the skill is defined\n' +
            "- Use the directory containing the skill's source file as the base directory for resolving any resource files mentioned in the instructions\n" +
            '- Proactively explore the skill directory for optional resources that enhance task completion:\n' +
            '  * scripts/ - executable code that agents can run (Python, Bash, JavaScript, etc.)\n' +
            '  * references/ - on-demand documentation (REFERENCE.md, FORMS.md, domain-specific files)\n' +
            '  * assets/ - static resources (templates, images, data files, schemas)\n' +
            '  Use these resources when they exist and are relevant to the current task\n' +
            '\n' +
            'Available skills:\n' +
            '\n' +
            '- **find-skills**: Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill. [Location: _builtIn_]\n' +
            '- **create-skill**: Helps users create new custom agent skills. Use when the user wants to create a new skill, automate a workflow, or package specialized knowledge for reuse. [Location: _builtIn_]',
          parameters: {
            type: 'object',
            properties: {
              skill: {
                type: 'string',
                description: 'The name of the skill to use.'
              }
            },
            required: [
              'skill'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'searchFiles',
          description: '- Fast content search tool that works with any codebase size\n' +
            '- Searches file contents using regular expressions\n' +
            '- Supports Rust regex syntax (eg. "log.*Error", "functions+w+", etc.)\n' +
            '- Filter files by pattern with the include parameter (eg. "*.js", "*.{ts,tsx}")\n' +
            '- Returns file paths with at least one match sorted by modification time\n' +
            '- Use this tool when you need to find files containing specific patterns\n' +
            '- Craft your regex patterns carefully to balance specificity and flexibility.\n' +
            "- Based on the user's task you may use it to find code patterns, TODO comments, function definitions, or any text-based information across the project. The results include context, so analyze the surrounding code to better understand the matches. Leverage the this tool in combination with other tools for more comprehensive analysis. For example, use it to find specific code patterns, then use readFile to examine the full context of interesting matches before using applyDiff or writeToFile to make informed changes.",
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path of the directory to search in (relative to the current working directory, or an absolute path).'
              },
              regex: {
                type: 'string',
                description: 'The regular expression pattern to search for in file contents. Uses Rust regex syntax.'
              },
              filePattern: {
                type: 'string',
                description: 'File pattern to include in the search (e.g. "*.js", "*.{ts,tsx}"). If not provided, it will search all files.'
              }
            },
            required: [
              'path',
              'regex'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'todoWrite',
          description: 'Use this tool to create and manage a structured task list for your current coding session. This helps you track progress, organize complex tasks, and demonstrate thoroughness to the user.\n' +
            'It also helps the user understand the progress of the task and overall progress of their requests.\n' +
            '\n' +
            '## When to Use This Tool\n' +
            'Use this tool proactively in these scenarios:\n' +
            '\n' +
            '1. Complex multi-step tasks - When a task requires 3 or more distinct steps or actions\n' +
            '2. Non-trivial and complex tasks - Tasks that require careful planning or multiple operations\n' +
            '3. User explicitly requests todo list - When the user directly asks you to use the todo list\n' +
            '4. User provides multiple tasks - When users provide a list of things to be done (numbered or comma-separated)\n' +
            '5. After receiving new instructions - Immediately capture user requirements as todos. Feel free to edit the todo list based on new information.\n' +
            '6. After completing a task - Mark it complete and add any new follow-up tasks\n' +
            '7. When you start working on a new task, mark the todo as in-progress. Ideally you should only have one todo as in-progress at a time. Complete existing tasks before starting new ones.\n' +
            '\n' +
            '## When NOT to Use This Tool\n' +
            '\n' +
            'Skip using this tool when:\n' +
            '1. There is only a single, straightforward task\n' +
            '2. The task is trivial and tracking it provides no organizational benefit\n' +
            '3. The task can be completed in less than 3 trivial steps\n' +
            '4. The task is purely conversational or informational\n' +
            '\n' +
            'NOTE that you should use should not use this tool if there is only one trivial task to do. In this case you are better off just doing the task directly.\n' +
            '\n' +
            '## Examples of When to Use the Todo List\n' +
            '\n' +
            '<example>\n' +
            "User: I want to add a dark mode toggle to the application settings. Make sure you run the tests and build when you're done!\n" +
            "Assistant: I'll help add a dark mode toggle to your application settings. Let me create a todo list to track this implementation.\n" +
            '*Creates todo list with the following items:*\n' +
            '1. Create dark mode toggle component in Settings page\n' +
            '2. Add dark mode state management (context/store)\n' +
            '3. Implement CSS-in-JS styles for dark theme\n' +
            '4. Update existing components to support theme switching\n' +
            '5. Run tests and build process, addressing any failures or errors that occur\n' +
            '*Begins working on the first task*\n' +
            '\n' +
            '<reasoning>\n' +
            'The assistant used the todo list because:\n' +
            '1. Adding dark mode is a multi-step feature requiring UI, state management, and styling changes\n' +
            '2. The user explicitly requested tests and build be run afterward\n' +
            '3. The assistant inferred that tests and build need to pass by adding "Ensure tests and build succeed" as the final task\n' +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '<example>\n' +
            'User: Help me rename the function getCwd to getCurrentWorkingDirectory across my project\n' +
            "Assistant: Let me first search through your codebase to find all occurrences of 'getCwd'.\n" +
            '*Uses grep or search tools to locate all instances of getCwd in the codebase*\n' +
            "Assistant: I've found 15 instances of 'getCwd' across 8 different files. Let me create a todo list to track these changes.\n" +
            '*Creates todo list with specific items for each file that needs updating*\n' +
            '\n' +
            '<reasoning>\n' +
            'The assistant used the todo list because:\n' +
            '1. First, the assistant searched to understand the scope of the task\n' +
            '2. Upon finding multiple occurrences across different files, it determined this was a complex task with multiple steps\n' +
            '3. The todo list helps ensure every instance is tracked and updated systematically\n' +
            '4. This approach prevents missing any occurrences and maintains code consistency\n' +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '\n' +
            '<example>\n' +
            'User: I need to implement these features for my e-commerce site: user registration, product catalog, shopping cart, and checkout flow.\n' +
            "Assistant: I'll help implement these features. First, let's add all the features to the todo list.\n" +
            '*Creates a todo list breaking down each feature into specific tasks based on the project architecture*\n' +
            "Assistant: Let's start with user registration. This will involve creating database models, API endpoints, and frontend forms that integrate with your existing authentication system.\n" +
            '\n' +
            '<reasoning>\n' +
            'The assistant used the todo list because:\n' +
            '1. The user provided multiple complex features to implement in a comma separated list\n' +
            '2. The todo list helps organize these large features into manageable tasks\n' +
            '3. This approach allows for tracking progress across the entire implementation\n' +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '<example>\n' +
            "User: Can you help optimize my React application? It's rendering slowly and has performance issues.</user>\n" +
            "Assistant: I'll help optimize your React application. First, let me examine your codebase to identify potential performance bottlenecks.\n" +
            '*Reviews component structure, render patterns, state management, and data fetching*\n' +
            "Assistant: After analyzing your codebase, I've identified several performance issues. Let me create a todo list to track our optimization efforts.\n" +
            '*Creates todo list with items like: 1) Implement memoization for expensive calculations in ProductList, 2) Add virtualization for long lists in Dashboard, 3) Optimize image loading in Gallery component, 4) Fix state update loops in ShoppingCart, 5) Review bundle size and implement code splitting*\n' +
            "Let's start by implementing memoization for the expensive calculations in your ProductList component.</assistant>\n" +
            '\n' +
            '<reasoning>\n' +
            'The assistant used the todo list because:\n' +
            '1. First, the assistant examined the codebase to identify specific performance issues\n' +
            '2. Based on this analysis, it identified multiple optimization opportunities\n' +
            '3. Performance optimization is a non-trivial task requiring multiple steps\n' +
            '4. The todo list helps methodically track improvements across different components\n' +
            '5. This systematic approach ensures all performance bottlenecks are addressed\n' +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '## Examples of When NOT to Use the Todo List\n' +
            '\n' +
            '<example>\n' +
            "User: How do I print 'Hello World' in Python?\n" +
            'Assistant: In Python, you can print "Hello World" with this simple code:\n' +
            '\n' +
            'python\n' +
            'print("Hello World")\n' +
            '\n' +
            'This will output the text "Hello World" to the console when executed.</assistant>\n' +
            '\n' +
            '<reasoning>\n' +
            "The assistant did not use the todo list because this is a single, trivial task that can be completed in one step. There's no need to track multiple tasks or steps for such a straightforward request.\n" +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '<example>\n' +
            'User: What does the git status command do?\n' +
            "Assistant: The git status command shows the current state of your working directory and staging area. It displays which changes have been staged, which haven't, and which files aren't being tracked by Git. This is a fundamental command for understanding the current state of your repository before making commits.\n" +
            '\n' +
            '<reasoning>\n' +
            'The assistant did not use the todo list because this is an informational request with no actual coding task to complete. The user is simply asking for an explanation, not for the assistant to perform multiple steps or tasks.\n' +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '<example>\n' +
            'User: Can you add a comment to the calculateTotal function to explain what it does?\n' +
            'Assistant: Sure, let me add a comment to the calculateTotal function to explain what it does.\n' +
            '* Uses the Edit tool to add a comment to the calculateTotal function *\n' +
            '\n' +
            '<reasoning>\n' +
            "The assistant did not use the todo list because this is a single, straightforward task confined to one location in the code. Adding a comment doesn't require tracking multiple steps or systematic organization.\n" +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '<example>\n' +
            'User: Run npm install for me and tell me what happens.\n' +
            "Assistant: I'll run the npm install command for you.\n" +
            '\n' +
            '*Executes: npm install*\n' +
            '\n' +
            "The command completed successfully. Here's the output:\n" +
            '[Output of npm install command]\n' +
            '\n' +
            'All dependencies have been installed according to your package.json file.\n' +
            '\n' +
            '<reasoning>\n' +
            'The assistant did not use the todo list because this is a single command execution with immediate results. There are no multiple steps to track or organize, making the todo list unnecessary for this straightforward task.\n' +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '## Task States and Management\n' +
            '\n' +
            '1. **Task States**: Use these states to track progress:\n' +
            '   - pending: Task not yet started\n' +
            '   - in-progress: Currently working on (limit to ONE task at a time)\n' +
            '   - completed: Task finished successfully\n' +
            '   - cancelled: Task no longer needed\n' +
            '\n' +
            '2. **Task Management**:\n' +
            '   - Update task status in real-time as you work\n' +
            "   - Mark tasks complete IMMEDIATELY after finishing (don't batch completions)\n" +
            '   - Only have ONE task in-progress at any time\n' +
            '   - Complete current tasks before starting new ones\n' +
            '   - Cancel tasks that become irrelevant\n' +
            '\n' +
            '3. **Task Breakdown**:\n' +
            '   - Create specific, actionable items\n' +
            '   - Break complex tasks into smaller, manageable steps\n' +
            '   - Use clear, descriptive task names\n' +
            '\n' +
            'When in doubt, use this tool. Being proactive with task management demonstrates attentiveness and ensures you complete all requirements successfully.',
          parameters: {
            type: 'object',
            properties: {
              todos: {
                type: 'array',
                items: {
                  type: 'object',
                  properties: {
                    id: {
                      type: 'string',
                      description: 'The unique identifier of the task, e.g "collect-information".'
                    },
                    content: {
                      type: 'string',
                      description: 'The content of the task.'
                    },
                    status: {
                      type: 'string',
                      enum: [
                        'pending',
                        'in-progress',
                        'completed',
                        'cancelled'
                      ],
                      description: 'The status of the task.'
                    },
                    priority: {
                      type: 'string',
                      enum: [
                        'low',
                        'medium',
                        'high'
                      ],
                      description: 'The priority of the task.'
                    }
                  },
                  required: [
                    'id',
                    'content',
                    'status',
                    'priority'
                  ],
                  additionalProperties: false
                }
              }
            },
            required: [
              'todos'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'writeToFile',
          description: 'Request to write full content to a file at the specified path.\n' +
            'If the file exists, it will be overwritten with the provided content.\n' +
            "If the file doesn't exist, it will be created. This tool will automatically create any directories needed to write the file.\n" +
            '\n' +
            'You may see the following fields in the result:\n' +
            '- autoFormattingEdits: If the auto-formatter makes any changes, this field will contain a diff against the file content after your edits and any user edits have been applied.\n' +
            '- newProblems: If any new problems are found after the edit, this field will contain information about them.',
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path of the file to write to (relative to the current working directory, or an absolute path).'
              },
              content: {
                type: 'string',
                description: 'The content to write to the file.'
              }
            },
            required: [
              'path',
              'content'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'editNotebook',
          description: 'Edit a specific cell in a Jupyter notebook (.ipynb file) by its cell ID',
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path to the notebook file (relative to the current working directory, or an absolute path)'
              },
              cellId: {
                type: 'string',
                description: 'The ID of the cell to edit'
              },
              content: {
                type: 'string',
                description: 'The new content of the cell'
              }
            },
            required: [
              'path',
              'cellId',
              'content'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'newTask',
          description: 'Launch a new agent to handle complex, multi-step tasks autonomously.\n' +
            'When using the newTask tool, you may specify a agentType parameter to select which agent type to use.\n' +
            'Available agent types and the tools they have access to:\n' +
            '\n' +
            '### planner\n' +
            'Engage this agent to formulate comprehensive, technical implementation strategies for feature development, system refactoring, or defect resolution.\n' +
            'This agent is strictly limited to planning and architectural design; it DOES NOT execute code modifications.\n' +
            '\n' +
            'Examples of user requests this agent shall trigger:\n' +
            '- "create a plan to implement the user authentication feature"\n' +
            '- "how should we refactor the database schema"\n' +
            '- "design a solution for the memory leak issue"\n' +
            '\n' +
            '### browser\n' +
            'Web browser automation agent for navigating websites, interacting with pages, and extracting information. Uses agent-browser CLI for headless browser control.\n' +
            '\n' +
            '### reviewer\n' +
            'Engage this agent to perform code reviews and leave inline comments.\n' +
            'This agent can analyze code and create review comments on specific lines.\n' +
            '\n' +
            'Examples of user requests this agent shall trigger:\n' +
            '- "review the code in src/auth"\n' +
            '- "add review comments to this file"\n' +
            '- "check this code and leave feedback"\n' +
            '\n' +
            '### walkthrough\n' +
            'Engage this agent to create a summary of the changes made in the current task.\n' +
            'This agent is strictly limited to documentation and explanation; it DOES NOT execute code modifications.\n' +
            '\n' +
            'Examples of user requests this agent shall trigger:\n' +
            '- "summarize what we have done"\n' +
            '- "create a walkthrough for the changes"\n' +
            '- "explain the changes made in this task"\n' +
            '\n' +
            '### explore\n' +
            'Use this agent to explore the codebase when you need to: understand project structure, find where features are implemented, locate specific functions or classes, analyze code patterns, investigate how something works, search for examples or usage, or gather information before making changes.\n' +
            '\n' +
            'Examples of questions this agent shall trigger:\n' +
            '- "where is the authentication logic implemented"\n' +
            '- "find all usages of the config parser"\n' +
            '- "how does the ignore-walk module work"\n' +
            '\n' +
            '\n' +
            'Always include a reminder in your prompt to ensure the result will be submitted through the `attemptCompletion` tool.\n' +
            'If the task stops without submitting the result, it will return an error message.\n' +
            '\n' +
            'You can optionally run agents in the background using the runAsync parameter. You can continue working while background agents run.\n' +
            '\n' +
            'When NOT to use the newTask tool:\n' +
            '- If you want to read a specific file path, use the readFile or globFiles tool instead of the newTask tool, to find the match more quickly\n' +
            '- If you are searching for a specific class definition like "class Foo", use the globFiles tool instead, to find the match more quickly\n' +
            '- If you are searching for code within a specific file or set of 2-3 files, use the readFile tool instead of the newTask tool, to find the match more quickly\n' +
            '- Other tasks that are not related to the agent descriptions above\n' +
            '\n' +
            'Usage notes:\n' +
            '1. Launch multiple agents tools concurrently whenever possible to maximize performance; to do that, use a single message with multiple tool uses\n' +
            '2. When the agent is done, it will return a single message back to you. The result returned by the agent is not visible to the user. To show the user the result, you should send a text message back to the user with a concise summary of the result.\n' +
            '3. Each agent invocation is stateless. You will not be able to send additional messages to the agent, nor will the agent be able to communicate with you outside of its final report. Therefore, your prompt should contain a highly detailed task description for the agent to perform autonomously and you should specify exactly what information the agent should return back to you in its final and only message to you.\n' +
            "4. The agent's outputs should generally be trusted\n" +
            "5. Clearly tell the agent whether you expect it to write code or just to do research (search, file reads, web fetches, etc.), since it is not aware of the user's intent\n" +
            '6. If the agent description mentions that it should be used proactively, then you should try your best to use it without the user having to ask for it first. Use your judgement.',
          parameters: {
            type: 'object',
            properties: {
              description: {
                type: 'string',
                description: 'A short description of the task.'
              },
              prompt: {
                type: 'string',
                description: 'The detailed prompt for the task to be performed.'
              },
              agentType: {
                type: 'string',
                description: 'The type of the specialized agent to use for the task.'
              },
              runAsync: {
                type: 'boolean',
                description: 'Set to true to run this agent in the background.'
              }
            },
            required: [
              'description',
              'prompt'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'startBackgroundJob',
          description: 'Start a background job to execute a bash command, which allows you to continue working while the job runs.\n' +
            '\n' +
            'Before starting the background job, please follow these steps:\n' +
            '\n' +
            '1. Directory Verification:\n' +
            '   - If the command will create new directories or files, first use the listFiles tool to verify the parent directory exists and is the correct location\n' +
            '   - For example, before running "mkdir foo/bar", first use listFiles to check that "foo" exists and is the intended parent directory\n' +
            '\n' +
            '2. Job Execution:\n' +
            '   - After ensuring proper quoting, start the background job.\n' +
            '\n' +
            'Usage notes:\n' +
            '- The command argument is required.\n' +
            '- Use readBackgroundJobOutput to monitor the output and status of the job.\n' +
            '- Use killBackgroundJob to terminate the job if needed.\n' +
            '- If the output exceeds 30000 characters, output will be truncated before being returned to you.\n' +
            '\n' +
            'Common use cases and examples:\n' +
            '- Development servers: `npm run dev`, `yarn start`, `bun run dev`\n' +
            '- Build processes: `npm run build`, `make`, `cargo build`\n' +
            '- File watchers: `npm run watch`, `tsc --watch`\n' +
            '- Testing: `npm run test:watch`, `jest --watch`\n' +
            '- Database services: `docker run -p 5432:5432 postgres`\n' +
            '\n' +
            'Command execution rules:\n' +
            "- Never run 'sleep' as it will return immediately.\n" +
            "- You do not need to use '&' at the end of the command.\n" +
            "- When issuing multiple commands, use the ';' or '&&' operator to separate them. DO NOT use newlines (newlines are ok in quoted strings).\n" +
            "- You shall avoid use the markdown code block syntax (backtick, '`') in your command, as it will be interpreted as a command substitution.",
          parameters: {
            type: 'object',
            properties: {
              command: {
                type: 'string',
                description: 'The CLI command to execute. This should be valid for the current operating system.'
              },
              cwd: {
                type: 'string',
                description: 'The working directory to execute the command in.'
              }
            },
            required: [
              'command'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'readBackgroundJobOutput',
          description: '- Retrieves output from a running or completed background job or async task\n' +
            '- Takes a backgroundJobId parameter identifying the job or task\n' +
            '- For terminal jobs, returns only new output since the last check\n' +
            '- For task IDs, returns the latest attemptCompletion result once completed\n' +
            '- Returns stdout and stderr output along with job status\n' +
            '- Supports optional regex filtering to show only lines matching a pattern\n' +
            '- Use this tool when you need to monitor or check the output of a long-running background job',
          parameters: {
            type: 'object',
            properties: {
              backgroundJobId: {
                type: 'string',
                description: 'The ID of the background job to get output from'
              },
              regex: {
                type: 'string',
                description: 'Optional regular expression to filter the output lines. Only lines matching this regex will be included in the result. Any lines that do not match will no longer be available to read.'
              }
            },
            required: [
              'backgroundJobId'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'killBackgroundJob',
          description: '- Kills a running background job by its ID\n' +
            '- Takes a backgroundJobId parameter identifying the job to kill\n' +
            '- Returns a success or failure status\n' +
            '- Use this tool when you need to terminate a long-running background job',
          parameters: {
            type: 'object',
            properties: {
              backgroundJobId: {
                type: 'string',
                description: 'The ID of the background job to kill.'
              }
            },
            required: [
              'backgroundJobId'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'webFetch',
          description: '- Fetches content from a specified URL and converts HTML to markdown\n' +
            '- Use this tool when you need to retrieve and analyze web content\n' +
            '\n' +
            'Usage notes:\n' +
            '  - IMPORTANT: If an MCP-provided web fetch tool is available, prefer using that tool instead of this one, as it may have fewer restrictions.\n' +
            '  - The URL must be a fully-formed valid URL\n' +
            '  - The prompt should describe what information you want to extract from the page\n' +
            '  - This tool is read-only and does not modify any files\n' +
            '  - Includes a self-cleaning 10-minute cache for faster responses when repeatedly accessing the same URL',
          parameters: {
            '$schema': 'https://json-schema.org/draft/2020-12/schema',
            type: 'object',
            properties: {
              url: {
                type: 'string',
                format: 'uri'
              }
            },
            required: [
              'url'
            ],
            additionalProperties: false
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'webSearch',
          description: '- Allows Pochi to search the web and use the results to inform responses\n' +
            '- Provides up-to-date information for current events and recent data\n' +
            '- Returns search result information formatted as search result blocks, including links as markdown hyperlinks\n' +
            '- Searches are performed automatically within a single API call\n' +
            '\n' +
            'CRITICAL REQUIREMENT - You MUST follow this:\n' +
            `  - After answering the user's question, you MUST include a "Sources:" section at the end of your response\n` +
            '  - In the Sources section, list all relevant URLs from the search results as markdown hyperlinks: [Title](URL)\n' +
            '  - This is MANDATORY - never skip including sources in your response\n' +
            '  - Example format:\n' +
            '\n' +
            '    [Your answer here]\n' +
            '\n' +
            '    Sources:\n' +
            '    - [Source Title 1](https://example.com/1)\n' +
            '    - [Source Title 2](https://example.com/2)\n' +
            '\n' +
            'Usage notes:\n' +
            `  - Account for "Today's date" in <system-reminder>. For example, if <system-reminder> says "Today's date: 2025-07-01", and the user wants the latest docs, do not use 2024 in the search query. Use 2025.`,
          parameters: {
            '$schema': 'https://json-schema.org/draft/2020-12/schema',
            type: 'object',
            properties: {
              query: {
                description: 'The search query to perform',
                type: 'string'
              },
              country: {
                description: "Country code to filter search results by, e.g. 'US', 'GB', 'JP'",
                type: 'string'
              }
            },
            required: [
              'query'
            ],
            additionalProperties: false
          }
        }
      }
    ],
    tool_choice: 'auto',
    stream: true
  }
}
2026-03-19 09:19:46.258	DEBUG	/$bunfs/pochi:454339	listFiles	Listing workspace files from /root with maxItems 500
2026-03-19 09:19:46.471	ERROR	/$bunfs/pochi:432009	LiveChatKit	onError

 AI_APICallError  This request would exceed your organization's rate limit of 2,000,000 input tokens per minute (org: e70c8d22-9099-49c5-a9af-e059e6515b76, model: claude-opus-4-6). For details, refer to: https://docs.claude.com/en/api/rate-limits. You can see the response headers for current usage. Please reduce the prompt length or the maximum tokens requested, or try again later. You may also contact sales at https://claude.com/contact-sales to discuss your options for a rate limit increase., AI_APICallError, , https://api.anthropic.com/v1/chat/completions, [object Object], 429, [object Object], {"error":{"code":"rate_limit_error","message":"This request would exceed your organization's rate limit of 2,000,000 input tokens per minute (org: e70c8d22-9099-49c5-a9af-e059e6515b76, model: claude-opus-4-6). For details, refer to: https://docs.claude.com/en/api/rate-limits. You can see the response headers for current usage. Please reduce the prompt length or the maximum tokens requested, or try again later. You may also contact sales at https://claude.com/contact-sales to discuss your options for a rate limit increase.","type":"invalid_request_error","param":null}}, true, [object Object], 423231, 30, 423231, 30, /$bunfs/root/pochi
error stack:
  • pochi	<anonymous>
	/$bunfs/pochi:423231
  • pochi	async <anonymous>
	/$bunfs/pochi:423092
  • native	processTicksAndRejections
	native:7
2026-03-19 09:19:52.488	ERROR	/$bunfs/pochi:502749	TaskRunner	Task is failed, trying to resend last message to resume it. {
  kind: 'APICallError',
  isRetryable: true,
  message: "This request would exceed your organization's rate limit of 2,000,000 input tokens per minute (org: e70c8d22-9099-49c5-a9af-e059e6515b76, model: claude-opus-4-6). For details, refer to: https://docs.claude.com/en/api/rate-limits. You can see the response headers for current usage. Please reduce the prompt length or the maximum tokens requested, or try again later. You may also contact sales at https://claude.com/contact-sales to discuss your options for a rate limit increase.",
  requestBodyValues: {
    model: 'claude-opus-4-6',
    max_tokens: 4096,
    messages: [
      {
        role: 'system',
        content: 'You are Pochi, a highly skilled software engineer with extensive knowledge in many programming languages, frameworks, design patterns, and best practices.\n' +
          '\n' +
          'IMPORTANT: You must NEVER generate or guess URLs for the user unless you are confident that the URLs are for helping the user with programming. You may use URLs provided by the user in their messages or local files.\n' +
          '\n' +
          'If the user asks for help or wants to give feedback inform them of the following:\n' +
          '- Join the discord channel at https://getpochi.com/discord to ask questions and get help\n' +
          '- To report bugs, users should report the issue at https://github.com/TabbyML/pochi/issues\n' +
          '\n' +
          "When the user directly asks about Pochi (eg 'can Pochi do...', 'does Pochi have...') or asks in second person (eg 'are you able...', 'can you do...'), first use curl to gather information to answer the question from Pochi docs at https://docs.getpochi.com/llms.txt\n" +
          '\n' +
          '====\n' +
          '\n' +
          'TASK MANAGEMENT\n' +
          '\n' +
          'You have access to the todoWrite tool to help you manage and plan tasks. Use these tools VERY frequently to ensure that you are tracking your tasks and giving the user visibility into your progress.\n' +
          'These tools are also EXTREMELY helpful for planning tasks, and for breaking down larger complex tasks into smaller steps. If you do not use this tool when planning, you may forget to do important tasks - and that is unacceptable.\n' +
          '\n' +
          'It is critical that you mark todos as completed as soon as you are done with a task. Do not batch up multiple tasks before marking them as completed.\n' +
          '\n' +
          '====\n' +
          '\n' +
          'RULES\n' +
          '\n' +
          "- User messages may include <system-reminder> tags. <system-reminder> tags contain useful information and reminders. They are NOT part of the user's provided input or the tool result. You shall pay close attention to information in these tags and use it to inform you actions.\n" +
          "- When the user initially gives you a task, a recursive list of all filepaths in the current working directory will be included in <system-reminder> tag. This provides an overview of the project's file structure, offering key insights into the project from directory/file names (how developers conceptualize and organize their code) and file extensions (the language used). This can also guide decision-making on which files to explore further. If you need to further explore directories such as outside the current working directory, you can use the listFiles tool. If you pass 'true' for the recursive parameter, it will list files recursively.\n" +
          '- All file paths used by tools must be relative to current working directory, do not use the ~ character or $HOME to refer to the home directory in file paths used by tools.\n' +
          "- You can use `pochi://` URI schema to access the Pochi virtual file system. This allows you to read and write files that are stored in Pochi's internal storage.\n" +
          "- Be sure to consider the type of project (e.g. Python, JavaScript, web application) when determining the appropriate structure and files to include. Also consider what files may be most relevant to accomplishing the task, for example looking at a project's manifest file would help you understand the project's dependencies, which you could incorporate into any code you write.\n" +
          "- Do not ask for more information than necessary. Use the tools provided to accomplish the user's request efficiently and effectively. When you've completed your task, you must use the attemptCompletion tool to present the result to the user. The user may provide feedback, which you can use to make improvements and try again.\n" +
          '- You are only allowed to ask the user questions using the askFollowupQuestion tool. Use this tool only when you need additional details to complete a task, and be sure to use a clear and concise question that will help you move forward with the task. However if you can use the available tools to avoid having to ask the user questions, you should do so. For example, if the user mentions a file that may be in an outside directory like the Desktop, you should use the listFiles tool to list the files in the Desktop and check if the file they are talking about is there, rather than asking the user to provide the file path themselves.\n' +
          `- You are STRICTLY FORBIDDEN from starting your messages with "Great", "Certainly", "Okay", "Sure". You should NOT be conversational in your responses, but rather direct and to the point. For example you should NOT say "Great, I've updated the CSS" but instead something like "I've updated the CSS". It is important you be clear and technical in your messages.\n` +
          "- Once you've completed the user's task, you MUST use the attemptCompletion tool to present the result of the task to the user. It is STRICTLY FORBIDDEN to complete the task without using this tool.\n" +
          '- When planning large-scale changes, create a high-level diagram using mermaid in Markdown. This helps explain your plan and allows you to gather user feedback before implementation.'
      },
      {
        role: 'user',
        content: [
          {
            type: 'text',
            text: '<system-reminder># System Information\n' +
              '\n' +
              'Operating System: linux\n' +
              'Default Shell: \n' +
              'Home Directory: /root\n' +
              'Current Working Directory: /root\n' +
              'Current Time: Thu Mar 19 2026 09:17:12 GMT+0000 (Coordinated Universal Time)\n' +
              '\n' +
              '# User Information\n' +
              '- Name: Test User\n' +
              '- Email: test@example.com\n' +
              '\n' +
              '# Current Working Directory (/root) Files\n' +
              '.bashrc\n' +
              '.profile\n' +
              '.daytona\n' +
              '.pochi\n' +
              '.gitconfig\n' +
              '.daytona/sessions\n' +
              '.pochi/config.jsonc\n' +
              '.daytona/sessions/a3777110-8132-47af-b51b-5923306e85aa\n' +
              '.daytona/sessions/693f5c50-112b-4d7e-b770-9650df4dec45\n' +
              '.daytona/sessions/380662f8-8805-47f4-91d4-31c76feba356\n' +
              '.daytona/sessions/9fa6e4a8-0a92-4a65-ac29-ae9e066c28a4\n' +
              '.daytona/sessions/a3777110-8132-47af-b51b-5923306e85aa/b4ba62f8-aee3-4106-9aef-66f6c5df79f2\n' +
              '.daytona/sessions/693f5c50-112b-4d7e-b770-9650df4dec45/ebb5ee05-6f54-4f88-9e78-089e3dc49fda\n' +
              '.daytona/sessions/380662f8-8805-47f4-91d4-31c76feba356/d6e3820d-c720-4dd4-b5a4-372b6a6f4077\n' +
              '.daytona/sessions/9fa6e4a8-0a92-4a65-ac29-ae9e066c28a4/4f04fe80-a746-46a5-b898-0d363239583c\n' +
              '.daytona/sessions/a3777110-8132-47af-b51b-5923306e85aa/b4ba62f8-aee3-4106-9aef-66f6c5df79f2/exit_code\n' +
              '.daytona/sessions/693f5c50-112b-4d7e-b770-9650df4dec45/ebb5ee05-6f54-4f88-9e78-089e3dc49fda/exit_code\n' +
              '.daytona/sessions/380662f8-8805-47f4-91d4-31c76feba356/d6e3820d-c720-4dd4-b5a4-372b6a6f4077/exit_code\n' +
              '\n' +
              '# GIT STATUS\n' +
              'Current branch: \n' +
              'Main branch (you will usually use this for PRs): \n' +
              '\n' +
              'Recent commits:\n' +
              '\n' +
              '\n' +
              '# TODOs\n' +
              'No TODOs yet, if you are working on tasks that would benefit from a todo list please use the todoWrite tool to create one.</system-reminder>'
          },
          {
            type: 'text',
            text: 'You are a developer migrating from Git to Jujutsu (jj). You have an existing local Git repository at `/home/user/my-project`. Your task is to start using jj with this repository without breaking Git compatibility.\\n\\n1. Navigate to `/home/user/my-project`.\\n2. Initialize a colocated jj repository so that jj and Git can be used together.\\n3. Create a new bookmark named `feature-x`.\\n4. Create a new file named `feature.txt` containing the text `Hello jj`.\\n5. Create a new jj commit (or describe the working copy) with the description `Add feature.txt`.\\n\\nWhen finished, the repository should be a valid colocated jj/Git repo, the `feature-x` bookmark should exist and be exported to Git, and the commit should have the specified description and file.'
          }
        ]
      },
      {
        role: 'assistant',
        content: '\n' +
          '\n' +
          "I'll work through this step-by-step, migrating the Git repository to use Jujutsu (jj) in colocated mode.",
        tool_calls: [
          {
            id: 'toolu_011rCkj2REAg3R87c4PHJkcQ',
            type: 'function',
            function: {
              name: 'todoWrite',
              arguments: `{"todos":[{"id":"check-repo","content":"Check if /home/user/my-project exists and has a Git repo","status":"in-progress","priority":"high"},{"id":"init-jj","content":"Initialize colocated jj repository","status":"pending","priority":"high"},{"id":"create-bookmark","content":"Create feature-x bookmark","status":"pending","priority":"high"},{"id":"create-file","content":"Create feature.txt with 'Hello jj'","status":"pending","priority":"high"},{"id":"describe-commit","content":"Describe/create commit with 'Add feature.txt'","status":"pending","priority":"high"},{"id":"verify","content":"Verify colocated repo, bookmark, and commit","status":"pending","priority":"high"}]}`
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_011rCkj2REAg3R87c4PHJkcQ',
        content: '{"success":true}'
      },
      {
        role: 'assistant',
        content: '',
        tool_calls: [
          {
            id: 'toolu_0174ARF4pbW41KSU4HQtRVw4',
            type: 'function',
            function: {
              name: 'executeCommand',
              arguments: '{"command":"ls -la /home/user/my-project 2>/dev/null; echo \\"---\\"; ls -la /home/user/my-project/.git 2>/dev/null"}'
            }
          },
          {
            id: 'toolu_01FmkuNLXYsjxvTsBfVmHFba',
            type: 'function',
            function: {
              name: 'executeCommand',
              arguments: '{"command":"which jj && jj --version"}'
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_0174ARF4pbW41KSU4HQtRVw4',
        content: '{"output":"total 8\\r\\ndrwxr-xr-x 3 root root   47 Mar 11 12:10 .\\r\\ndrwxr-xr-x 1 root root   32 Mar 11 12:10 ..\\r\\ndrwxr-xr-x 8 root root 4096 Mar 11 12:10 .git\\r\\n-rw-r--r-- 1 root root   15 Mar 11 12:10 README.md\\r\\n---\\r\\ntotal 28\\r\\ndrwxr-xr-x 8 root root 4096 Mar 11 12:10 .\\r\\ndrwxr-xr-x 3 root root   47 Mar 11 12:10 ..\\r\\n-rw-r--r-- 1 root root   15 Mar 11 12:10 COMMIT_EDITMSG\\r\\n-rw-r--r-- 1 root root   21 Mar 11 12:10 HEAD\\r\\ndrwxr-xr-x 2 root root    6 Mar 11 12:10 branches\\r\\n-rw-r--r-- 1 root root   92 Mar 11 12:10 config\\r\\n-rw-r--r-- 1 root root   73 Mar 11 12:10 description\\r\\ndrwxr-xr-x 2 root root 4096 Mar 11 12:10 hooks\\r\\n-rw-r--r-- 1 root root  137 Mar 11 12:10 index\\r\\ndrwxr-xr-x 2 root root   29 Mar 11 12:10 info\\r\\ndrwxr-xr-x 3 root root   30 Mar 11 12:10 logs\\r\\ndrwxr-xr-x 7 root root   84 Mar 11 12:10 objects\\r\\ndrwxr-xr-x 4 root root   43 Mar 11 12:10 refs\\r\\n","isTruncated":false}'
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_01FmkuNLXYsjxvTsBfVmHFba',
        content: '{"output":"/usr/local/bin/jj\\r\\njj 0.38.0-2508982cde5c7e4db0933e0b6469f9e778e71e28\\r\\n","isTruncated":false}'
      },
      {
        role: 'assistant',
        content: 'The Git repository exists at `/home/user/my-project` with a `README.md` file, and `jj` v0.38.0 is installed.',
        tool_calls: [
          {
            id: 'toolu_01ULas2uw3TnyRPAHN6aUhhT',
            type: 'function',
            function: {
              name: 'todoWrite',
              arguments: `{"todos":[{"id":"check-repo","content":"Check if /home/user/my-project exists and has a Git repo","status":"completed","priority":"high"},{"id":"init-jj","content":"Initialize colocated jj repository","status":"in-progress","priority":"high"},{"id":"create-bookmark","content":"Create feature-x bookmark","status":"pending","priority":"high"},{"id":"create-file","content":"Create feature.txt with 'Hello jj'","status":"pending","priority":"high"},{"id":"describe-commit","content":"Describe/create commit with 'Add feature.txt'","status":"pending","priority":"high"},{"id":"verify","content":"Verify colocated repo, bookmark, and commit","status":"pending","priority":"high"}]}`
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_01ULas2uw3TnyRPAHN6aUhhT',
        content: '{"success":true}'
      },
      {
        role: 'assistant',
        content: '**Step 1 & 2: Initialize a colocated jj repository.** The `--colocate` flag (or running `jj git init --colocate` inside an existing Git repo) sets up jj to share the `.git` directory, so both tools work together.',
        tool_calls: [
          {
            id: 'toolu_019jY8xFeB1m7PfbXfapjtni',
            type: 'function',
            function: {
              name: 'executeCommand',
              arguments: '{"command":"cd /home/user/my-project && jj git init --colocate"}'
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_019jY8xFeB1m7PfbXfapjtni',
        content: '{"output":"Done importing changes from the underlying Git repo.\\r\\nInitialized repo in \\".\\"\\r\\nHint: Running `git clean -xdf` will remove `.jj/`!\\r\\n","isTruncated":false}'
      },
      {
        role: 'assistant',
        content: 'Colocated jj repository initialized. Let me verify the `.jj` directory was created alongside `.git`:',
        tool_calls: [
          {
            id: 'toolu_017U73gxk7EtcnybfQfMwDDW',
            type: 'function',
            function: {
              name: 'executeCommand',
              arguments: '{"command":"ls -la /home/user/my-project/ | head -20"}'
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_017U73gxk7EtcnybfQfMwDDW',
        content: '{"output":"total 4\\r\\ndrwxr-xr-x 1 root root 41 Mar 19 09:17 .\\r\\ndrwxr-xr-x 1 root root 32 Mar 11 12:10 ..\\r\\ndrwxr-xr-x 1 root root 45 Mar 11 12:10 .git\\r\\ndrwxr-xr-x 4 root root 72 Mar 19 09:17 .jj\\r\\n-rw-r--r-- 1 root root 15 Mar 11 12:10 README.md\\r\\n","isTruncated":false}'
      },
      {
        role: 'assistant',
        content: 'Both `.git` and `.jj` directories exist — the repo is colocated.',
        tool_calls: [
          {
            id: 'toolu_01RbFKbcqvYrAPXMhdewxZNQ',
            type: 'function',
            function: {
              name: 'todoWrite',
              arguments: `{"todos":[{"id":"check-repo","content":"Check if /home/user/my-project exists and has a Git repo","status":"completed","priority":"high"},{"id":"init-jj","content":"Initialize colocated jj repository","status":"completed","priority":"high"},{"id":"create-bookmark","content":"Create feature-x bookmark","status":"in-progress","priority":"high"},{"id":"create-file","content":"Create feature.txt with 'Hello jj'","status":"pending","priority":"high"},{"id":"describe-commit","content":"Describe/create commit with 'Add feature.txt'","status":"pending","priority":"high"},{"id":"verify","content":"Verify colocated repo, bookmark, and commit","status":"pending","priority":"high"}]}`
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_01RbFKbcqvYrAPXMhdewxZNQ',
        content: '{"success":true}'
      },
      {
        role: 'assistant',
        content: '**Step 3: Create the `feature-x` bookmark.** Let me first check the current jj log to understand the state:',
        tool_calls: [
          {
            id: 'toolu_0194HmfhNtUVQ4zP16p2MXym',
            type: 'function',
            function: {
              name: 'executeCommand',
              arguments: '{"command":"cd /home/user/my-project && jj log"}'
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_0194HmfhNtUVQ4zP16p2MXym',
        content: '{"output":"@  uyntpwtv (no email set) 2026-03-19 09:17:41 5d317252\\r\\n│  (empty) (no description set)\\r\\nā—‹  ypsoummp test@example.com 2026-03-11 12:10:51 main 14d944a2\\r\\n│  Initial commit\\r\\nā—†  zzzzzzzz root() 00000000\\r\\n","isTruncated":false}'
      },
      {
        role: 'assistant',
        content: "The working copy change (`@`) is on top of the `main` branch. Now I'll create the `feature-x` bookmark pointing to the current working copy change:",
        tool_calls: [
          {
            id: 'toolu_01Bqso2WjCh52bGNmUGaHTFv',
            type: 'function',
            function: {
              name: 'executeCommand',
              arguments: '{"command":"cd /home/user/my-project && jj bookmark create feature-x -r @"}'
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_01Bqso2WjCh52bGNmUGaHTFv',
        content: `{"output":"Warning: Target revision is empty.\\r\\nCreated 1 bookmarks pointing to uyntpwtv 5d317252 feature-x | (empty) (no description set)\\r\\nWarning: Name and email not configured. Until configured, your commits will be created with the empty identity, and can't be pushed to remotes.\\r\\nHint: To configure, run:\\r\\n  jj config set --user user.name \\"Some One\\"\\r\\n  jj config set --user user.email \\"someone@example.com\\"\\r\\n","isTruncated":false}`
      },
      {
        role: 'assistant',
        content: '',
        tool_calls: [
          {
            id: 'toolu_01L3ZYAHCdqTVwMNgE1PPERS',
            type: 'function',
            function: {
              name: 'todoWrite',
              arguments: `{"todos":[{"id":"check-repo","content":"Check if /home/user/my-project exists and has a Git repo","status":"completed","priority":"high"},{"id":"init-jj","content":"Initialize colocated jj repository","status":"completed","priority":"high"},{"id":"create-bookmark","content":"Create feature-x bookmark","status":"completed","priority":"high"},{"id":"create-file","content":"Create feature.txt with 'Hello jj'","status":"in-progress","priority":"high"},{"id":"describe-commit","content":"Describe/create commit with 'Add feature.txt'","status":"pending","priority":"high"},{"id":"verify","content":"Verify colocated repo, bookmark, and commit","status":"pending","priority":"high"}]}`
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_01L3ZYAHCdqTVwMNgE1PPERS',
        content: '{"success":true}'
      },
      {
        role: 'assistant',
        content: '**Step 4: Create `feature.txt` with the text `Hello jj`.**',
        tool_calls: [
          {
            id: 'toolu_01UTmkEZMJjWuXVJ3nbfuwtw',
            type: 'function',
            function: {
              name: 'writeToFile',
              arguments: '{"path":"/home/user/my-project/feature.txt","content":"Hello jj\\n"}'
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_01UTmkEZMJjWuXVJ3nbfuwtw',
        content: '{"success":true}'
      },
      {
        role: 'assistant',
        content: '',
        tool_calls: [
          {
            id: 'toolu_01CJMGCaa5eWDGRn4qEz6FDV',
            type: 'function',
            function: {
              name: 'todoWrite',
              arguments: `{"todos":[{"id":"check-repo","content":"Check if /home/user/my-project exists and has a Git repo","status":"completed","priority":"high"},{"id":"init-jj","content":"Initialize colocated jj repository","status":"completed","priority":"high"},{"id":"create-bookmark","content":"Create feature-x bookmark","status":"completed","priority":"high"},{"id":"create-file","content":"Create feature.txt with 'Hello jj'","status":"completed","priority":"high"},{"id":"describe-commit","content":"Describe/create commit with 'Add feature.txt'","status":"in-progress","priority":"high"},{"id":"verify","content":"Verify colocated repo, bookmark, and commit","status":"pending","priority":"high"}]}`
            }
          }
        ]
      },
      {
        role: 'tool',
        tool_call_id: 'toolu_01CJMGCaa5eWDGRn4qEz6FDV',
        content: '{"success":true}'
      }
    ],
    tools: [
      {
        type: 'function',
        function: {
          name: 'applyDiff',
          description: "This is a tool for editing files. For moving or renaming files, you should generally use the executeCommand tool with the 'mv' command instead. For larger edits, use the writeFile tool to overwrite files.\n" +
            '\n' +
            "Before using this tool, use the readFile tool to understand the file's contents and context\n" +
            '\n' +
            'To make a file edit, provide the following:\n' +
            '1. path: The path to the file to modify (relative to the current working directory, or an absolute path)\n' +
            '2. searchContent: The text to replace (must match the file contents exactly, including all whitespace and indentation)\n' +
            '3. replaceContent: The edited text to replace the searchContent (must be different from searchContent)\n' +
            '4. expectedReplacements: The number of replacements you expect to make. Defaults to 1 if not specified.\n' +
            '\n' +
            'By default, the tool will replace ONE occurrence of searchContent with replaceContent in the specified file. If you want to replace multiple occurrences, provide the expectedReplacements parameter with the exact number of occurrences you expect.\n' +
            '\n' +
            'CRITICAL REQUIREMENTS FOR USING THIS TOOL:\n' +
            '\n' +
            '1. UNIQUENESS (when expectedReplacements is not specified): The searchContent MUST uniquely identify the specific instance you want to change. This means:\n' +
            '   - Include AT LEAST 3-5 lines of context BEFORE the change point\n' +
            '   - Include AT LEAST 3-5 lines of context AFTER the change point\n' +
            '   - Include all whitespace, indentation, and surrounding code exactly as it appears in the file\n' +
            '\n' +
            '2. EXPECTED MATCHES: If you want to replace multiple instances:\n' +
            '   - Use the expectedReplacements parameter with the exact number of occurrences you expect to replace\n' +
            '   - This will replace ALL occurrences of the searchContent with the replaceContent\n' +
            "   - If the actual number of matches doesn't equal expectedReplacements, the edit will fail\n" +
            '   - This is a safety feature to prevent unintended replacements\n' +
            '\n' +
            '3. VERIFICATION: Before using this tool:\n' +
            '   - Check how many instances of the target text exist in the file\n' +
            '   - If multiple instances exist, either:\n' +
            '     a) Gather enough context to uniquely identify each one and make separate calls, OR\n' +
            '     b) Use expectedReplacements parameter with the exact count of instances you expect to replace\n' +
            '\n' +
            'WARNING:\n' +
            "- The tool will fail if searchContent matches multiple locations and expectedReplacements isn't specified\n" +
            "- The tool will fail if the number of matches doesn't equal expectedReplacements when it's specified\n" +
            "- The tool will fail if searchContent doesn't match the file contents exactly (including whitespace)\n" +
            '- The tool will fail if searchContent and replaceContent are the same\n' +
            '\n' +
            'When making edits:\n' +
            '   - Ensure the edit results in idiomatic, correct code\n' +
            '   - Do not add trailing whitespace to lines (a newline at the end of a file is fine)\n' +
            '   - Do not leave the code in a broken state\n' +
            '\n' +
            'If you want to create a new file, use:\n' +
            '   - A new file path, including dir name if needed\n' +
            '   - An empty searchContent\n' +
            "   - The new file's contents as replaceContent\n" +
            '\n' +
            'Remember: when making multiple file edits in a row to the same file, you should prefer to send all edits in a single message with multiple calls to this tool, rather than multiple messages with a single call each.\n' +
            '\n' +
            'You may see the following fields in the result:\n' +
            '- autoFormattingEdits: If the auto-formatter makes any changes, this field will contain a diff against the file content after your edits and any user edits have been applied.\n' +
            '- newProblems: If any new problems are found after the edit, this field will contain information about them.',
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path of the file to modify (relative to the current working directory, or an absolute path).'
              },
              searchContent: {
                type: 'string',
                description: 'The text to replace.'
              },
              replaceContent: {
                type: 'string',
                description: 'The text to replace it with.'
              },
              expectedReplacements: {
                type: 'number',
                description: 'The expected number of replacements to perform. Defaults to 1 if not specified.'
              }
            },
            required: [
              'path',
              'searchContent',
              'replaceContent'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'askFollowupQuestion',
          description: 'Ask the user a question to gather additional information needed to complete the task. \n' +
            '\n' +
            '## When to Use This Tool\n' +
            'Use this tool in the following scenarios:\n' +
            "1. The user's request is ambiguous or unclear and requires clarification.\n" +
            '2. You need more details to proceed effectively.\n' +
            '3. You have made several unsuccessful attempts to solve the issue and need user guidance to move forward.\n' +
            '4. Offer choices to the user about what direction to take.\n' +
            '\n' +
            '## Usage Notes\n' +
            '- Users will always be able to select "Other" to provide custom text input\n' +
            '- Use multiSelect: true to allow multiple answers to be selected for a question\n' +
            '- If you recommend a specific option, make that the first option in the list and add "(Recommended)" at the end of the label\n' +
            '- Provide 1-4 questions per call\n' +
            '\n' +
            'IMPORTANT: This tool CANNOT be used in combination with other tools (except todoWrite) in a single step. If you need to use other tools, you must do so in a separate step before calling this tool.',
          parameters: {
            type: 'object',
            properties: {
              questions: {
                type: 'array',
                items: {
                  type: 'object',
                  properties: {
                    question: {
                      type: 'string',
                      description: 'The complete question to ask the user. Should be clear, specific, and end with a question mark.'
                    },
                    header: {
                      type: 'string',
                      maxLength: 12,
                      description: 'Very short label displayed as a chip/tag (max 12 chars). Examples: "Auth method", "Library", "Approach".'
                    },
                    options: {
                      type: 'array',
                      items: {
                        type: 'object',
                        properties: {
                          label: {
                            type: 'string',
                            description: 'Short button label shown to the user. Should be concise (1-5 words) and clearly describe the choice.'
                          },
                          description: {
                            type: 'string',
                            description: 'Explanation of what this option means or what will happen if chosen. Useful for providing context about trade-offs or implications.'
                          }
                        },
                        required: [
                          'label'
                        ],
                        additionalProperties: false
                      },
                      minItems: 2,
                      maxItems: 4,
                      description: "The available choices for this question. Must have 2-4 options. Each option should be a distinct, mutually exclusive choice (unless multiSelect is enabled). There should be no 'Other' option, that will be provided automatically."
                    },
                    multiSelect: {
                      type: 'boolean',
                      default: false,
                      description: 'Set to true to allow the user to select multiple options instead of just one. Use when choices are not mutually exclusive.'
                    }
                  },
                  required: [
                    'question',
                    'header',
                    'options'
                  ],
                  additionalProperties: false
                },
                minItems: 1,
                maxItems: 4,
                description: 'Questions to ask the user (1-4 questions).'
              }
            },
            required: [
              'questions'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'attemptCompletion',
          description: "Once you've received the results of tool uses and can confirm that the task is complete, use this tool to present the result of your work to the user.\n" +
            '\n' +
            'You MUST NOT generate any text before this tool call. All conclusion text must be included within the result parameter of the attemptCompletion tool.\n' +
            'Never use this tool with a question or request to engage in further conversation! Formulate the end of your result in a way that is final and does not require further input from the user.\n' +
            '\n' +
            'IMPORTANT: This tool CANNOT be used in combination with other tools (except todoWrite) in a single step. If you need to use other tools, you must do so in a separate step before calling this tool.',
          parameters: {
            '$schema': 'http://json-schema.org/draft-07/schema#',
            type: 'object',
            properties: {
              result: {
                description: 'The result of the task. Formulate this result in a way that is final and does not require further input from the user.',
                type: 'string'
              }
            },
            required: [
              'result'
            ],
            additionalProperties: false
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'executeCommand',
          description: 'Executes a given bash command in a persistent shell session with optional timeout, ensuring proper handling and security measures.\n' +
            '\n' +
            'IMPORTANT: This tool is for terminal operations like git, npm, docker, etc. DO NOT use it for file operations (reading, writing, editing, searching, finding files) - use the specialized tools for this instead.\n' +
            '\n' +
            'Before executing the command, please follow these steps:\n' +
            '\n' +
            '1. Directory Verification:\n' +
            '   - If the command will create new directories or files, first use listFiles to verify the parent directory exists and is the correct location\n' +
            '   - For example, before running "mkdir foo/bar", first use listFiles to check that "foo" exists and is the intended parent directory\n' +
            '\n' +
            '2. Command Execution:\n' +
            '   - Always quote file paths that contain spaces with double quotes (e.g., cd "path with spaces/file.txt")\n' +
            '   - Examples of proper quoting:\n' +
            '     - cd "/Users/name/My Documents" (correct)\n' +
            '     - cd /Users/name/My Documents (incorrect - will fail)\n' +
            '     - python "/path/with spaces/script.py" (correct)\n' +
            '     - python /path/with spaces/script.py (incorrect - will fail)\n' +
            '   - After ensuring proper quoting, execute the command.\n' +
            '   - Capture the output of the command.\n' +
            '\n' +
            'Usage notes:\n' +
            '- The command argument is required.\n' +
            '- You can specify an optional timeout in seconds (up to 300s / 5 minutes). If not specified, commands will timeout after 60s (1 minute).\n' +
            '- If the output exceeds 30000 characters, output will be truncated before being returned to you.\n' +
            '- When issuing multiple commands:\n' +
            '  - If the commands are independent and can run in parallel, make multiple executeCommand tool calls in a single message. For example, if you need to run "git status" and "git diff", send a single message with two executeCommand tool calls in parallel.\n' +
            '  - If the commands depend on each other and must run sequentially, use a single executeCommand call with \'&&\' to chain them together (e.g., `git add . && git commit -m "message" && git push`). For instance, if one operation must complete before another starts (like mkdir before cp, Write before executeCommand for git operations, or git add before git commit), run these operations sequentially instead.\n' +
            "  - Use ';' only when you need to run commands sequentially but don't care if earlier commands fail\n" +
            '  - DO NOT use newlines to separate commands (newlines are ok in quoted strings)\n' +
            "- You shall avoid use the markdown code block syntax (backtick, '`') in your command, as it will be interpreted as a command substitution.\n" +
            "- Before using this tool, you must first think about the context provided in <system-reminder> to understand the user's environment and tailor your commands to ensure they are compatible with their system. You must also consider if the command you need to run should be executed in a specific directory rather than the current working directory, and properly set the `cwd` if necessary.\n" +
            '\n' +
            '# Committing changes with git\n' +
            '\n' +
            'Only create commits when requested by the user. If unclear, ask first. When the user asks you to create a new git commit, follow these steps carefully:\n' +
            '\n' +
            'Git Safety Protocol:\n' +
            '- NEVER update the git config\n' +
            "- NEVER run destructive git commands (push --force, reset --hard, checkout ., restore ., clean -f, branch -D) unless the user explicitly requests these actions. Taking unauthorized destructive actions is unhelpful and can result in lost work, so it's best to ONLY run these commands when given direct instructions \n" +
            '- NEVER skip hooks (--no-verify, --no-gpg-sign, etc) unless the user explicitly requests it\n' +
            '- NEVER run force push to main/master, warn the user if they request it\n' +
            '- CRITICAL: Always create NEW commits rather than amending, unless the user explicitly requests a git amend. When a pre-commit hook fails, the commit did NOT happen  — so --amend would modify the PREVIOUS commit, which may result in destroying work or losing previous changes. Instead, after hook failure, fix the issue, re-stage, and create a NEW commit\n' +
            '- When staging files, prefer adding specific files by name rather than using "git add -A" or "git add .", which can accidentally include sensitive files (.env, credentials) or large binaries\n' +
            '- NEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked, otherwise the user will feel that you are being too proactive\n' +
            '\n' +
            '1. You can call multiple tools in a single response. When multiple independent pieces of information are requested and all commands are likely to succeed, run multiple tool calls in parallel for optimal performance. run the following bash commands in parallel, each using the executeCommand tool:\n' +
            '  - Run a git status command to see all untracked files. IMPORTANT: Never use the -uall flag as it can cause memory issues on large repos.\n' +
            '  - Run a git diff command to see both staged and unstaged changes that will be committed.\n' +
            "  - Run a git log command to see recent commit messages, so that you can follow this repository's commit message style.\n" +
            '2. Analyze all staged changes (both previously staged and newly added) and draft a commit message:\n' +
            '  - Summarize the nature of the changes (eg. new feature, enhancement to an existing feature, bug fix, refactoring, test, docs, etc.). Ensure the message accurately reflects the changes and their purpose (i.e. "add" means a wholly new feature, "update" means an enhancement to an existing feature, "fix" means a bug fix, etc.).\n' +
            '  - Do not commit files that likely contain secrets (.env, credentials.json, etc). Warn the user if they specifically request to commit those files\n' +
            '  - Draft a concise (1-2 sentences) commit message that focuses on the "why" rather than the "what"\n' +
            '  - Ensure it accurately reflects the changes and their purpose\n' +
            '3. You can call multiple tools in a single response. When multiple independent pieces of information are requested and all commands are likely to succeed, run multiple tool calls in parallel for optimal performance. run the following commands:\n' +
            '   - Add relevant untracked files to the staging area.\n' +
            '   - Create the commit with a message ending with:\n' +
            '   šŸ¤– Generated with [Pochi](https://getpochi.com) | [Task](<Share URL>)\n' +
            '\n' +
            '   Co-Authored-By: Pochi <noreply@getpochi.com>\n' +
            '\n' +
            '   Note: Replace <Share URL> with the Share URL from system information if available. If not available, omit the " | [Task](...)" part.\n' +
            '\n' +
            '   - Run git status after the commit completes to verify success.\n' +
            '   Note: git status depends on the commit completing, so run it sequentially after the commit.\n' +
            '4. If the commit fails due to pre-commit hook changes, retry the commit ONCE to include these automated changes. If it fails again, it usually means a pre-commit hook is preventing the commit. If the commit succeeds but you notice that files were modified by the pre-commit hook, you MUST amend your commit to include them.\n' +
            '\n' +
            'Important notes:\n' +
            '- NEVER update the git config\n' +
            '- NEVER run additional commands to read or explore code, besides git bash commands\n' +
            '- DO NOT push to the remote repository unless the user explicitly asks you to do so\n' +
            '- IMPORTANT: Never use git commands with the -i flag (like git rebase -i or git add -i) since they require interactive input which is not supported.\n' +
            '- IMPORTANT: Do not use --no-edit with git rebase commands, as the --no-edit flag is not a valid option for git rebase.\n' +
            '- If there are no changes to commit (i.e., no untracked files and no modifications), do not create an empty commit\n' +
            '- In order to ensure good formatting, ALWAYS pass the commit message via a HEREDOC, a la this example:\n' +
            '<example>\n' +
            `git commit -m "$(cat <<'EOF'\n` +
            'Commit message here.\n' +
            '\n' +
            'šŸ¤– Generated with [Pochi](https://getpochi.com) | [Task](<Share URL>)\n' +
            '\n' +
            'Co-Authored-By: Pochi <noreply@getpochi.com>\n' +
            'EOF\n' +
            ')"\n' +
            '</example>\n' +
            '\n' +
            '# Creating pull requests\n' +
            'Use the gh command via the executeCommand tool for ALL GitHub-related tasks including working with issues, pull requests, checks, and releases. If given a Github URL use the gh command to get the information needed.\n' +
            '\n' +
            'IMPORTANT: When the user asks you to create a pull request, follow these steps carefully:\n' +
            '\n' +
            '1. You can call multiple tools in a single response. When multiple independent pieces of information are requested and all commands are likely to succeed, run multiple tool calls in parallel for optimal performance. run the following bash commands in parallel using the executeCommand tool, in order to understand the current state of the branch since it diverged from the main branch:\n' +
            '   - Run a git status command to see all untracked files (never use -uall flag)\n' +
            '   - Run a git diff command to see both staged and unstaged changes that will be committed\n' +
            '   - Check if the current branch tracks a remote branch and is up to date with the remote, so you know if you need to push to the remote\n' +
            '   - Run a git log command and `git diff [base-branch]...HEAD` to understand the full commit history for the current branch (from the time it diverged from the base branch)\n' +
            '2. Analyze all changes that will be included in the pull request, making sure to look at all relevant commits (NOT just the latest commit, but ALL commits that will be included in the pull request!!!), and draft a pull request title and summary:\n' +
            '   - Keep the PR title short (under 70 characters)\n' +
            '   - Use the description/body for details, not the title\n' +
            '3. You can call multiple tools in a single response. When multiple independent pieces of information are requested and all commands are likely to succeed, run multiple tool calls in parallel for optimal performance. run the following commands in parallel:\n' +
            '   - Create new branch if needed\n' +
            '   - Push to remote with -u flag if needed\n' +
            '   - Create PR using gh pr create with the format below. Use a HEREDOC to pass the body to ensure correct formatting.\n' +
            '<example>\n' +
            `gh pr create --title "the pr title" --body "$(cat <<'EOF'\n` +
            '## Summary\n' +
            '<1-3 bullet points>\n' +
            '\n' +
            '## Test plan\n' +
            '[Checklist of TODOs for testing the pull request...]\n' +
            '\n' +
            'šŸ¤– Generated with [Pochi](https://getpochi.com) | [Task](<Share URL>)\n' +
            'EOF\n' +
            ')"\n' +
            '</example>\n' +
            '\n' +
            'Important:\n' +
            '- NEVER update the git confi'... 355 more characters,
          parameters: {
            type: 'object',
            properties: {
              command: {
                type: 'string',
                description: 'The CLI command to execute. This should be valid for the current operating system.'
              },
              cwd: {
                type: 'string',
                description: 'The working directory to execute the command in.'
              },
              timeout: {
                type: 'number',
                minimum: 1,
                maximum: 300,
                description: 'Optional timeout in seconds, max 300 seconds. By default the timeout is 120 seconds.'
              }
            },
            required: [
              'command'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'globFiles',
          description: 'Request to find files matching a glob pattern within a specified directory. Use this to get a list of files based on a pattern.',
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path of the directory to search in (relative to the current working directory, or an absolute path)'
              },
              globPattern: {
                type: 'string',
                description: "The glob pattern to match files against (e.g., '*.ts', '**/*.js')"
              }
            },
            required: [
              'path',
              'globPattern'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'listFiles',
          description: 'Request to list files and directories within the specified directory. If recursive is true, it will list all files and directories recursively. If recursive is false or not provided, it will only list the top-level contents. Do not use this tool to confirm the existence of files you may have created, as the user will let you know if the files were created successfully or not.',
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path of the directory to list contents for (relative to the current working directory, or an absolute path)'
              },
              recursive: {
                type: 'boolean',
                description: 'Whether to list files and directories recursively.'
              }
            },
            required: [
              'path'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'readFile',
          description: 'Request to read the contents of a file at the specified path. Use this when you need to examine the contents of an existing file you do not know the contents of, for example to analyze code, review text files, extract information from configuration files.\n' +
            '',
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path of the file to read (relative to the current working directory, or an absolute path)'
              },
              startLine: {
                type: 'number',
                description: 'The starting line number to read from (1-based). If not provided, it starts from the beginning of the file.'
              },
              endLine: {
                type: 'number',
                description: 'The ending line number to read to (1-based, inclusive). If not provided, it reads to the end of the file.'
              }
            },
            required: [
              'path'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'useSkill',
          description: 'Execute a skill within the main conversation\n' +
            '\n' +
            'When users ask you to perform tasks, check if any of the available skills below can help complete the task more effectively. Skills provide specialized capabilities and domain knowledge.\n' +
            '\n' +
            'When users ask about a SPECIFIC skill (e.g., "How does the pdf skill work?", "What does the commit skill do?"), you must call this tool to get detailed information about that skill.\n' +
            '\n' +
            'When users ask general questions like "What skills are available?" or "List all skills", simply refer to the "Available skills" section below - do NOT call this tool.\n' +
            '\n' +
            "This tool returns the skill's detailed instructions which you must then follow to complete the task. The instructions contain step-by-step guidance on how to perform the specific task or workflow.\n" +
            '\n' +
            'How to invoke:\n' +
            '- Use this tool with the skill name\n' +
            '- Example: `skill: "pdf-processing"` - invoke the pdf-processing skill\n' +
            "- The tool will return the skill's instructions\n" +
            '- Follow the returned instructions carefully to complete the task\n' +
            '\n' +
            'Important:\n' +
            '- When a skill is relevant for a task OR when users ask about a SPECIFIC skill, you must invoke this tool IMMEDIATELY as your first action\n' +
            '- For general questions about available skills, simply refer to the "Available skills" list below without calling this tool\n' +
            '- NEVER just announce or mention a skill in your text response without actually calling this tool (except for general skill listing requests)\n' +
            '- This is a BLOCKING REQUIREMENT: invoke the relevant Skill tool BEFORE generating any other response about a specific skill or task\n' +
            '- Only use skills listed in "Available skills" below\n' +
            '- Check compatibility requirements before using a skill - ensure the skill is compatible with the current OS/environment\n' +
            '- After calling this tool, follow the returned instructions step by step\n' +
            '- The skill file location is shown in the [Location: filepath] section of each skill listing below - use this information to understand where the skill is defined\n' +
            "- Use the directory containing the skill's source file as the base directory for resolving any resource files mentioned in the instructions\n" +
            '- Proactively explore the skill directory for optional resources that enhance task completion:\n' +
            '  * scripts/ - executable code that agents can run (Python, Bash, JavaScript, etc.)\n' +
            '  * references/ - on-demand documentation (REFERENCE.md, FORMS.md, domain-specific files)\n' +
            '  * assets/ - static resources (templates, images, data files, schemas)\n' +
            '  Use these resources when they exist and are relevant to the current task\n' +
            '\n' +
            'Available skills:\n' +
            '\n' +
            '- **find-skills**: Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill. [Location: _builtIn_]\n' +
            '- **create-skill**: Helps users create new custom agent skills. Use when the user wants to create a new skill, automate a workflow, or package specialized knowledge for reuse. [Location: _builtIn_]',
          parameters: {
            type: 'object',
            properties: {
              skill: {
                type: 'string',
                description: 'The name of the skill to use.'
              }
            },
            required: [
              'skill'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'searchFiles',
          description: '- Fast content search tool that works with any codebase size\n' +
            '- Searches file contents using regular expressions\n' +
            '- Supports Rust regex syntax (eg. "log.*Error", "functions+w+", etc.)\n' +
            '- Filter files by pattern with the include parameter (eg. "*.js", "*.{ts,tsx}")\n' +
            '- Returns file paths with at least one match sorted by modification time\n' +
            '- Use this tool when you need to find files containing specific patterns\n' +
            '- Craft your regex patterns carefully to balance specificity and flexibility.\n' +
            "- Based on the user's task you may use it to find code patterns, TODO comments, function definitions, or any text-based information across the project. The results include context, so analyze the surrounding code to better understand the matches. Leverage the this tool in combination with other tools for more comprehensive analysis. For example, use it to find specific code patterns, then use readFile to examine the full context of interesting matches before using applyDiff or writeToFile to make informed changes.",
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path of the directory to search in (relative to the current working directory, or an absolute path).'
              },
              regex: {
                type: 'string',
                description: 'The regular expression pattern to search for in file contents. Uses Rust regex syntax.'
              },
              filePattern: {
                type: 'string',
                description: 'File pattern to include in the search (e.g. "*.js", "*.{ts,tsx}"). If not provided, it will search all files.'
              }
            },
            required: [
              'path',
              'regex'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'todoWrite',
          description: 'Use this tool to create and manage a structured task list for your current coding session. This helps you track progress, organize complex tasks, and demonstrate thoroughness to the user.\n' +
            'It also helps the user understand the progress of the task and overall progress of their requests.\n' +
            '\n' +
            '## When to Use This Tool\n' +
            'Use this tool proactively in these scenarios:\n' +
            '\n' +
            '1. Complex multi-step tasks - When a task requires 3 or more distinct steps or actions\n' +
            '2. Non-trivial and complex tasks - Tasks that require careful planning or multiple operations\n' +
            '3. User explicitly requests todo list - When the user directly asks you to use the todo list\n' +
            '4. User provides multiple tasks - When users provide a list of things to be done (numbered or comma-separated)\n' +
            '5. After receiving new instructions - Immediately capture user requirements as todos. Feel free to edit the todo list based on new information.\n' +
            '6. After completing a task - Mark it complete and add any new follow-up tasks\n' +
            '7. When you start working on a new task, mark the todo as in-progress. Ideally you should only have one todo as in-progress at a time. Complete existing tasks before starting new ones.\n' +
            '\n' +
            '## When NOT to Use This Tool\n' +
            '\n' +
            'Skip using this tool when:\n' +
            '1. There is only a single, straightforward task\n' +
            '2. The task is trivial and tracking it provides no organizational benefit\n' +
            '3. The task can be completed in less than 3 trivial steps\n' +
            '4. The task is purely conversational or informational\n' +
            '\n' +
            'NOTE that you should use should not use this tool if there is only one trivial task to do. In this case you are better off just doing the task directly.\n' +
            '\n' +
            '## Examples of When to Use the Todo List\n' +
            '\n' +
            '<example>\n' +
            "User: I want to add a dark mode toggle to the application settings. Make sure you run the tests and build when you're done!\n" +
            "Assistant: I'll help add a dark mode toggle to your application settings. Let me create a todo list to track this implementation.\n" +
            '*Creates todo list with the following items:*\n' +
            '1. Create dark mode toggle component in Settings page\n' +
            '2. Add dark mode state management (context/store)\n' +
            '3. Implement CSS-in-JS styles for dark theme\n' +
            '4. Update existing components to support theme switching\n' +
            '5. Run tests and build process, addressing any failures or errors that occur\n' +
            '*Begins working on the first task*\n' +
            '\n' +
            '<reasoning>\n' +
            'The assistant used the todo list because:\n' +
            '1. Adding dark mode is a multi-step feature requiring UI, state management, and styling changes\n' +
            '2. The user explicitly requested tests and build be run afterward\n' +
            '3. The assistant inferred that tests and build need to pass by adding "Ensure tests and build succeed" as the final task\n' +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '<example>\n' +
            'User: Help me rename the function getCwd to getCurrentWorkingDirectory across my project\n' +
            "Assistant: Let me first search through your codebase to find all occurrences of 'getCwd'.\n" +
            '*Uses grep or search tools to locate all instances of getCwd in the codebase*\n' +
            "Assistant: I've found 15 instances of 'getCwd' across 8 different files. Let me create a todo list to track these changes.\n" +
            '*Creates todo list with specific items for each file that needs updating*\n' +
            '\n' +
            '<reasoning>\n' +
            'The assistant used the todo list because:\n' +
            '1. First, the assistant searched to understand the scope of the task\n' +
            '2. Upon finding multiple occurrences across different files, it determined this was a complex task with multiple steps\n' +
            '3. The todo list helps ensure every instance is tracked and updated systematically\n' +
            '4. This approach prevents missing any occurrences and maintains code consistency\n' +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '\n' +
            '<example>\n' +
            'User: I need to implement these features for my e-commerce site: user registration, product catalog, shopping cart, and checkout flow.\n' +
            "Assistant: I'll help implement these features. First, let's add all the features to the todo list.\n" +
            '*Creates a todo list breaking down each feature into specific tasks based on the project architecture*\n' +
            "Assistant: Let's start with user registration. This will involve creating database models, API endpoints, and frontend forms that integrate with your existing authentication system.\n" +
            '\n' +
            '<reasoning>\n' +
            'The assistant used the todo list because:\n' +
            '1. The user provided multiple complex features to implement in a comma separated list\n' +
            '2. The todo list helps organize these large features into manageable tasks\n' +
            '3. This approach allows for tracking progress across the entire implementation\n' +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '<example>\n' +
            "User: Can you help optimize my React application? It's rendering slowly and has performance issues.</user>\n" +
            "Assistant: I'll help optimize your React application. First, let me examine your codebase to identify potential performance bottlenecks.\n" +
            '*Reviews component structure, render patterns, state management, and data fetching*\n' +
            "Assistant: After analyzing your codebase, I've identified several performance issues. Let me create a todo list to track our optimization efforts.\n" +
            '*Creates todo list with items like: 1) Implement memoization for expensive calculations in ProductList, 2) Add virtualization for long lists in Dashboard, 3) Optimize image loading in Gallery component, 4) Fix state update loops in ShoppingCart, 5) Review bundle size and implement code splitting*\n' +
            "Let's start by implementing memoization for the expensive calculations in your ProductList component.</assistant>\n" +
            '\n' +
            '<reasoning>\n' +
            'The assistant used the todo list because:\n' +
            '1. First, the assistant examined the codebase to identify specific performance issues\n' +
            '2. Based on this analysis, it identified multiple optimization opportunities\n' +
            '3. Performance optimization is a non-trivial task requiring multiple steps\n' +
            '4. The todo list helps methodically track improvements across different components\n' +
            '5. This systematic approach ensures all performance bottlenecks are addressed\n' +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '## Examples of When NOT to Use the Todo List\n' +
            '\n' +
            '<example>\n' +
            "User: How do I print 'Hello World' in Python?\n" +
            'Assistant: In Python, you can print "Hello World" with this simple code:\n' +
            '\n' +
            'python\n' +
            'print("Hello World")\n' +
            '\n' +
            'This will output the text "Hello World" to the console when executed.</assistant>\n' +
            '\n' +
            '<reasoning>\n' +
            "The assistant did not use the todo list because this is a single, trivial task that can be completed in one step. There's no need to track multiple tasks or steps for such a straightforward request.\n" +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '<example>\n' +
            'User: What does the git status command do?\n' +
            "Assistant: The git status command shows the current state of your working directory and staging area. It displays which changes have been staged, which haven't, and which files aren't being tracked by Git. This is a fundamental command for understanding the current state of your repository before making commits.\n" +
            '\n' +
            '<reasoning>\n' +
            'The assistant did not use the todo list because this is an informational request with no actual coding task to complete. The user is simply asking for an explanation, not for the assistant to perform multiple steps or tasks.\n' +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '<example>\n' +
            'User: Can you add a comment to the calculateTotal function to explain what it does?\n' +
            'Assistant: Sure, let me add a comment to the calculateTotal function to explain what it does.\n' +
            '* Uses the Edit tool to add a comment to the calculateTotal function *\n' +
            '\n' +
            '<reasoning>\n' +
            "The assistant did not use the todo list because this is a single, straightforward task confined to one location in the code. Adding a comment doesn't require tracking multiple steps or systematic organization.\n" +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '<example>\n' +
            'User: Run npm install for me and tell me what happens.\n' +
            "Assistant: I'll run the npm install command for you.\n" +
            '\n' +
            '*Executes: npm install*\n' +
            '\n' +
            "The command completed successfully. Here's the output:\n" +
            '[Output of npm install command]\n' +
            '\n' +
            'All dependencies have been installed according to your package.json file.\n' +
            '\n' +
            '<reasoning>\n' +
            'The assistant did not use the todo list because this is a single command execution with immediate results. There are no multiple steps to track or organize, making the todo list unnecessary for this straightforward task.\n' +
            '</reasoning>\n' +
            '</example>\n' +
            '\n' +
            '## Task States and Management\n' +
            '\n' +
            '1. **Task States**: Use these states to track progress:\n' +
            '   - pending: Task not yet started\n' +
            '   - in-progress: Currently working on (limit to ONE task at a time)\n' +
            '   - completed: Task finished successfully\n' +
            '   - cancelled: Task no longer needed\n' +
            '\n' +
            '2. **Task Management**:\n' +
            '   - Update task status in real-time as you work\n' +
            "   - Mark tasks complete IMMEDIATELY after finishing (don't batch completions)\n" +
            '   - Only have ONE task in-progress at any time\n' +
            '   - Complete current tasks before starting new ones\n' +
            '   - Cancel tasks that become irrelevant\n' +
            '\n' +
            '3. **Task Breakdown**:\n' +
            '   - Create specific, actionable items\n' +
            '   - Break complex tasks into smaller, manageable steps\n' +
            '   - Use clear, descriptive task names\n' +
            '\n' +
            'When in doubt, use this tool. Being proactive with task management demonstrates attentiveness and ensures you complete all requirements successfully.',
          parameters: {
            type: 'object',
            properties: {
              todos: {
                type: 'array',
                items: {
                  type: 'object',
                  properties: {
                    id: {
                      type: 'string',
                      description: 'The unique identifier of the task, e.g "collect-information".'
                    },
                    content: {
                      type: 'string',
                      description: 'The content of the task.'
                    },
                    status: {
                      type: 'string',
                      enum: [
                        'pending',
                        'in-progress',
                        'completed',
                        'cancelled'
                      ],
                      description: 'The status of the task.'
                    },
                    priority: {
                      type: 'string',
                      enum: [
                        'low',
                        'medium',
                        'high'
                      ],
                      description: 'The priority of the task.'
                    }
                  },
                  required: [
                    'id',
                    'content',
                    'status',
                    'priority'
                  ],
                  additionalProperties: false
                }
              }
            },
            required: [
              'todos'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'writeToFile',
          description: 'Request to write full content to a file at the specified path.\n' +
            'If the file exists, it will be overwritten with the provided content.\n' +
            "If the file doesn't exist, it will be created. This tool will automatically create any directories needed to write the file.\n" +
            '\n' +
            'You may see the following fields in the result:\n' +
            '- autoFormattingEdits: If the auto-formatter makes any changes, this field will contain a diff against the file content after your edits and any user edits have been applied.\n' +
            '- newProblems: If any new problems are found after the edit, this field will contain information about them.',
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path of the file to write to (relative to the current working directory, or an absolute path).'
              },
              content: {
                type: 'string',
                description: 'The content to write to the file.'
              }
            },
            required: [
              'path',
              'content'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'editNotebook',
          description: 'Edit a specific cell in a Jupyter notebook (.ipynb file) by its cell ID',
          parameters: {
            type: 'object',
            properties: {
              path: {
                type: 'string',
                description: 'The path to the notebook file (relative to the current working directory, or an absolute path)'
              },
              cellId: {
                type: 'string',
                description: 'The ID of the cell to edit'
              },
              content: {
                type: 'string',
                description: 'The new content of the cell'
              }
            },
            required: [
              'path',
              'cellId',
              'content'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'newTask',
          description: 'Launch a new agent to handle complex, multi-step tasks autonomously.\n' +
            'When using the newTask tool, you may specify a agentType parameter to select which agent type to use.\n' +
            'Available agent types and the tools they have access to:\n' +
            '\n' +
            '### planner\n' +
            'Engage this agent to formulate comprehensive, technical implementation strategies for feature development, system refactoring, or defect resolution.\n' +
            'This agent is strictly limited to planning and architectural design; it DOES NOT execute code modifications.\n' +
            '\n' +
            'Examples of user requests this agent shall trigger:\n' +
            '- "create a plan to implement the user authentication feature"\n' +
            '- "how should we refactor the database schema"\n' +
            '- "design a solution for the memory leak issue"\n' +
            '\n' +
            '### browser\n' +
            'Web browser automation agent for navigating websites, interacting with pages, and extracting information. Uses agent-browser CLI for headless browser control.\n' +
            '\n' +
            '### reviewer\n' +
            'Engage this agent to perform code reviews and leave inline comments.\n' +
            'This agent can analyze code and create review comments on specific lines.\n' +
            '\n' +
            'Examples of user requests this agent shall trigger:\n' +
            '- "review the code in src/auth"\n' +
            '- "add review comments to this file"\n' +
            '- "check this code and leave feedback"\n' +
            '\n' +
            '### walkthrough\n' +
            'Engage this agent to create a summary of the changes made in the current task.\n' +
            'This agent is strictly limited to documentation and explanation; it DOES NOT execute code modifications.\n' +
            '\n' +
            'Examples of user requests this agent shall trigger:\n' +
            '- "summarize what we have done"\n' +
            '- "create a walkthrough for the changes"\n' +
            '- "explain the changes made in this task"\n' +
            '\n' +
            '### explore\n' +
            'Use this agent to explore the codebase when you need to: understand project structure, find where features are implemented, locate specific functions or classes, analyze code patterns, investigate how something works, search for examples or usage, or gather information before making changes.\n' +
            '\n' +
            'Examples of questions this agent shall trigger:\n' +
            '- "where is the authentication logic implemented"\n' +
            '- "find all usages of the config parser"\n' +
            '- "how does the ignore-walk module work"\n' +
            '\n' +
            '\n' +
            'Always include a reminder in your prompt to ensure the result will be submitted through the `attemptCompletion` tool.\n' +
            'If the task stops without submitting the result, it will return an error message.\n' +
            '\n' +
            'You can optionally run agents in the background using the runAsync parameter. You can continue working while background agents run.\n' +
            '\n' +
            'When NOT to use the newTask tool:\n' +
            '- If you want to read a specific file path, use the readFile or globFiles tool instead of the newTask tool, to find the match more quickly\n' +
            '- If you are searching for a specific class definition like "class Foo", use the globFiles tool instead, to find the match more quickly\n' +
            '- If you are searching for code within a specific file or set of 2-3 files, use the readFile tool instead of the newTask tool, to find the match more quickly\n' +
            '- Other tasks that are not related to the agent descriptions above\n' +
            '\n' +
            'Usage notes:\n' +
            '1. Launch multiple agents tools concurrently whenever possible to maximize performance; to do that, use a single message with multiple tool uses\n' +
            '2. When the agent is done, it will return a single message back to you. The result returned by the agent is not visible to the user. To show the user the result, you should send a text message back to the user with a concise summary of the result.\n' +
            '3. Each agent invocation is stateless. You will not be able to send additional messages to the agent, nor will the agent be able to communicate with you outside of its final report. Therefore, your prompt should contain a highly detailed task description for the agent to perform autonomously and you should specify exactly what information the agent should return back to you in its final and only message to you.\n' +
            "4. The agent's outputs should generally be trusted\n" +
            "5. Clearly tell the agent whether you expect it to write code or just to do research (search, file reads, web fetches, etc.), since it is not aware of the user's intent\n" +
            '6. If the agent description mentions that it should be used proactively, then you should try your best to use it without the user having to ask for it first. Use your judgement.',
          parameters: {
            type: 'object',
            properties: {
              description: {
                type: 'string',
                description: 'A short description of the task.'
              },
              prompt: {
                type: 'string',
                description: 'The detailed prompt for the task to be performed.'
              },
              agentType: {
                type: 'string',
                description: 'The type of the specialized agent to use for the task.'
              },
              runAsync: {
                type: 'boolean',
                description: 'Set to true to run this agent in the background.'
              }
            },
            required: [
              'description',
              'prompt'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'startBackgroundJob',
          description: 'Start a background job to execute a bash command, which allows you to continue working while the job runs.\n' +
            '\n' +
            'Before starting the background job, please follow these steps:\n' +
            '\n' +
            '1. Directory Verification:\n' +
            '   - If the command will create new directories or files, first use the listFiles tool to verify the parent directory exists and is the correct location\n' +
            '   - For example, before running "mkdir foo/bar", first use listFiles to check that "foo" exists and is the intended parent directory\n' +
            '\n' +
            '2. Job Execution:\n' +
            '   - After ensuring proper quoting, start the background job.\n' +
            '\n' +
            'Usage notes:\n' +
            '- The command argument is required.\n' +
            '- Use readBackgroundJobOutput to monitor the output and status of the job.\n' +
            '- Use killBackgroundJob to terminate the job if needed.\n' +
            '- If the output exceeds 30000 characters, output will be truncated before being returned to you.\n' +
            '\n' +
            'Common use cases and examples:\n' +
            '- Development servers: `npm run dev`, `yarn start`, `bun run dev`\n' +
            '- Build processes: `npm run build`, `make`, `cargo build`\n' +
            '- File watchers: `npm run watch`, `tsc --watch`\n' +
            '- Testing: `npm run test:watch`, `jest --watch`\n' +
            '- Database services: `docker run -p 5432:5432 postgres`\n' +
            '\n' +
            'Command execution rules:\n' +
            "- Never run 'sleep' as it will return immediately.\n" +
            "- You do not need to use '&' at the end of the command.\n" +
            "- When issuing multiple commands, use the ';' or '&&' operator to separate them. DO NOT use newlines (newlines are ok in quoted strings).\n" +
            "- You shall avoid use the markdown code block syntax (backtick, '`') in your command, as it will be interpreted as a command substitution.",
          parameters: {
            type: 'object',
            properties: {
              command: {
                type: 'string',
                description: 'The CLI command to execute. This should be valid for the current operating system.'
              },
              cwd: {
                type: 'string',
                description: 'The working directory to execute the command in.'
              }
            },
            required: [
              'command'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'readBackgroundJobOutput',
          description: '- Retrieves output from a running or completed background job or async task\n' +
            '- Takes a backgroundJobId parameter identifying the job or task\n' +
            '- For terminal jobs, returns only new output since the last check\n' +
            '- For task IDs, returns the latest attemptCompletion result once completed\n' +
            '- Returns stdout and stderr output along with job status\n' +
            '- Supports optional regex filtering to show only lines matching a pattern\n' +
            '- Use this tool when you need to monitor or check the output of a long-running background job',
          parameters: {
            type: 'object',
            properties: {
              backgroundJobId: {
                type: 'string',
                description: 'The ID of the background job to get output from'
              },
              regex: {
                type: 'string',
                description: 'Optional regular expression to filter the output lines. Only lines matching this regex will be included in the result. Any lines that do not match will no longer be available to read.'
              }
            },
            required: [
              'backgroundJobId'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'killBackgroundJob',
          description: '- Kills a running background job by its ID\n' +
            '- Takes a backgroundJobId parameter identifying the job to kill\n' +
            '- Returns a success or failure status\n' +
            '- Use this tool when you need to terminate a long-running background job',
          parameters: {
            type: 'object',
            properties: {
              backgroundJobId: {
                type: 'string',
                description: 'The ID of the background job to kill.'
              }
            },
            required: [
              'backgroundJobId'
            ],
            additionalProperties: false,
            '$schema': 'http://json-schema.org/draft-07/schema#'
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'webFetch',
          description: '- Fetches content from a specified URL and converts HTML to markdown\n' +
            '- Use this tool when you need to retrieve and analyze web content\n' +
            '\n' +
            'Usage notes:\n' +
            '  - IMPORTANT: If an MCP-provided web fetch tool is available, prefer using that tool instead of this one, as it may have fewer restrictions.\n' +
            '  - The URL must be a fully-formed valid URL\n' +
            '  - The prompt should describe what information you want to extract from the page\n' +
            '  - This tool is read-only and does not modify any files\n' +
            '  - Includes a self-cleaning 10-minute cache for faster responses when repeatedly accessing the same URL',
          parameters: {
            '$schema': 'https://json-schema.org/draft/2020-12/schema',
            type: 'object',
            properties: {
              url: {
                type: 'string',
                format: 'uri'
              }
            },
            required: [
              'url'
            ],
            additionalProperties: false
          }
        }
      },
      {
        type: 'function',
        function: {
          name: 'webSearch',
          description: '- Allows Pochi to search the web and use the results to inform responses\n' +
            '- Provides up-to-date information for current events and recent data\n' +
            '- Returns search result information formatted as search result blocks, including links as markdown hyperlinks\n' +
            '- Searches are performed automatically within a single API call\n' +
            '\n' +
            'CRITICAL REQUIREMENT - You MUST follow this:\n' +
            `  - After answering the user's question, you MUST include a "Sources:" section at the end of your response\n` +
            '  - In the Sources section, list all relevant URLs from the search results as markdown hyperlinks: [Title](URL)\n' +
            '  - This is MANDATORY - never skip including sources in your response\n' +
            '  - Example format:\n' +
            '\n' +
            '    [Your answer here]\n' +
            '\n' +
            '    Sources:\n' +
            '    - [Source Title 1](https://example.com/1)\n' +
            '    - [Source Title 2](https://example.com/2)\n' +
            '\n' +
            'Usage notes:\n' +
            `  - Account for "Today's date" in <system-reminder>. For example, if <system-reminder> says "Today's date: 2025-07-01", and the user wants the latest docs, do not use 2024 in the search query. Use 2025.`,
          parameters: {
            '$schema': 'https://json-schema.org/draft/2020-12/schema',
            type: 'object',
            properties: {
              query: {
                description: 'The search query to perform',
                type: 'string'
              },
              country: {
                description: "Country code to filter search results by, e.g. 'US', 'GB', 'JP'",
                type: 'string'
              }
            },
            required: [
              'query'
            ],
            additionalProperties: false
          }
        }
      }
    ],
    tool_choice: 'auto',
    stream: true
  }
}
2026-03-19 09:19:52.507	DEBUG	/$bunfs/pochi:454339	listFiles	Listing workspace files from /root with maxItems 500
2026-03-19 09:20:09.057	DEBUG	/$bunfs/pochi:454339	listFiles	Listing workspace files from /root with maxItems 500
2026-03-19 09:20:14.075	DEBUG	/$bunfs/pochi:454339	listFiles	Listing workspace files from /root with maxItems 500
2026-03-19 09:20:19.908	DEBUG	/$bunfs/pochi:454339	listFiles	Listing workspace files from /root with maxItems 500
2026-03-19 09:20:25.507	DEBUG	/$bunfs/pochi:454339	listFiles	Listing workspace files from /root with maxItems 500
2026-03-19 09:20:30.585	DEBUG	/$bunfs/pochi:454339	listFiles	Listing workspace files from /root with maxItems 500
Hit:1 http://security.ubuntu.com/ubuntu noble-security InRelease
Hit:2 http://archive.ubuntu.com/ubuntu noble InRelease
Hit:3 http://archive.ubuntu.com/ubuntu noble-updates InRelease
Hit:4 http://archive.ubuntu.com/ubuntu noble-backports InRelease
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
curl is already the newest version (8.5.0-2ubuntu10.8).
0 upgraded, 0 newly installed, 0 to remove and 13 not upgraded.
downloading uv 0.9.5 x86_64-unknown-linux-gnu
no checksums to verify
installing to /root/.local/bin
  uv
  uvx
everything's installed!

To add $HOME/.local/bin to your PATH, either restart your shell or run:

    source $HOME/.local/bin/env (sh, bash, zsh)
    source $HOME/.local/bin/env.fish (fish)
Downloading pygments (1.2MiB)
 Downloading pygments
Installed 5 packages in 29ms
============================= test session starts ==============================
platform linux -- Python 3.12.3, pytest-8.4.1, pluggy-1.6.0 -- /root/.cache/uv/archive-v0/XjCe-6t8uET6TfLwXEpAE/bin/python
cachedir: .pytest_cache
rootdir: /tests
collecting ... collected 5 items

../../tests/test_final_state.py::test_jj_directory_exists PASSED         [ 20%]
../../tests/test_final_state.py::test_jj_bookmark_exists PASSED          [ 40%]
../../tests/test_final_state.py::test_git_branch_exists PASSED           [ 60%]
../../tests/test_final_state.py::test_head_commit_description FAILED     [ 80%]
../../tests/test_final_state.py::test_feature_file_exists_and_content PASSED [100%]

=================================== FAILURES ===================================
_________________________ test_head_commit_description _________________________

    def test_head_commit_description():
        result = run_cmd("jj", "log", "--no-graph", "-r", "@", "-T", "description")
        assert result.returncode == 0, f"jj log failed: {result.stderr}"
>       assert "Add feature.txt" in result.stdout, f"Expected commit description 'Add feature.txt', but got: {result.stdout.strip()}"
E       AssertionError: Expected commit description 'Add feature.txt', but got: 
E       assert 'Add feature.txt' in ''
E        +  where '' = CompletedProcess(args=['jj', 'log', '--no-graph', '-r', '@', '-T', 'description'], returncode=0, stdout='', stderr='').stdout

/tests/test_final_state.py:27: AssertionError
=========================== short test summary info ============================
FAILED ../../tests/test_final_state.py::test_head_commit_description - Assert...
========================= 1 failed, 4 passed in 0.06s ==========================