Gemini doesn't find edit tool #2783

Open
opened 2026-02-16 17:37:14 -05:00 by yindo · 7 comments
Owner

Originally created by @ssoteloserrano on GitHub (Nov 11, 2025).

Originally assigned to: @rekram1-node on GitHub.

Description

An error occurred during a process run by the build agent, which uses the Gemini 2.5 Pro model. The model attempted to call the edit tool, but this tool appears to be unavailable in the agent's environment. This resulted in an "invalid tool" error.

Full Error Message:
⚙ invalid [error=Model tried to call unavailable tool 'edit'. Available tools: invalid, bash, webfetch, glob, grep, list, read, todowrite, todoread, task, architecture_scan, testing_scan, config_scan, playwright_browser_close, playwright_browser_resize, playwright_browser_console_messages, playwright_browser_handle_dialog, playwright_browser_evaluate, playwright_browser_file_upload, playwright_browser_fill_form, playwright_browser_install, playwright_browser_press_key, playwright_browser_type, playwright_browser_navigate, playwright_browser_navigate_back, playwright_browser_network_requests, playwright_browser_take_screenshot, playwright_browser_snapshot, playwright_browser_click, playwright_browser_drag, playwright_browser_hover, playwright_browser_select_option, playwright_browser_tabs, playwright_browser_wait_for., tool=edit]

OpenCode version

1.0.55

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

Arch linux

Terminal

Kitty

Originally created by @ssoteloserrano on GitHub (Nov 11, 2025). Originally assigned to: @rekram1-node on GitHub. ### Description An error occurred during a process run by the **build agent**, which uses the Gemini 2.5 Pro model. The model attempted to call the **edit** tool, but this tool appears to be unavailable in the agent's environment. This resulted in an "invalid tool" error. Full Error Message: ` ⚙ invalid [error=Model tried to call unavailable tool 'edit'. Available tools: invalid, bash, webfetch, glob, grep, list, read, todowrite, todoread, task, architecture_scan, testing_scan, config_scan, playwright_browser_close, playwright_browser_resize, playwright_browser_console_messages, playwright_browser_handle_dialog, playwright_browser_evaluate, playwright_browser_file_upload, playwright_browser_fill_form, playwright_browser_install, playwright_browser_press_key, playwright_browser_type, playwright_browser_navigate, playwright_browser_navigate_back, playwright_browser_network_requests, playwright_browser_take_screenshot, playwright_browser_snapshot, playwright_browser_click, playwright_browser_drag, playwright_browser_hover, playwright_browser_select_option, playwright_browser_tabs, playwright_browser_wait_for., tool=edit] ` ### OpenCode version 1.0.55 ### Steps to reproduce _No response_ ### Screenshot and/or share link _No response_ ### Operating System Arch linux ### Terminal Kitty
yindo added the model-problem label 2026-02-16 17:37:14 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Nov 11, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #266: Similar Gemini edit tool issues ("gemini doesn't handle edit tool very well")
  • #4164: Edit and write tools returning errors in build agent ("Write and Edit Tools Constantly Return TypeError")

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Nov 11, 2025): This issue might be a duplicate of existing issues. Please check: - #266: Similar Gemini edit tool issues ("gemini doesn't handle edit tool very well") - #4164: Edit and write tools returning errors in build agent ("Write and Edit Tools Constantly Return TypeError") Feel free to ignore if none of these address your specific case.
Author
Owner

@rekram1-node commented on GitHub (Nov 11, 2025):

Was it in plan mode?

@rekram1-node commented on GitHub (Nov 11, 2025): Was it in plan mode?
Author
Owner

@ssoteloserrano commented on GitHub (Nov 11, 2025):

Nope, it happens in build mode

Image
@ssoteloserrano commented on GitHub (Nov 11, 2025): Nope, it happens in build mode <img width="1908" height="544" alt="Image" src="https://github.com/user-attachments/assets/624aa660-f018-4e8d-93d3-a129049531fc" />
Author
Owner

@rekram1-node commented on GitHub (Nov 11, 2025):

Hm can u show me opencode debug config

@rekram1-node commented on GitHub (Nov 11, 2025): Hm can u show me `opencode debug config`
Author
Owner

@muness commented on GitHub (Dec 30, 2025):

I see the same issue. opencode debug config output:

{
  "agent": {
    "superego-eval": {
      "prompt": "<stripped>",
      "tools": {
        "write": false,
        "edit": false,
        "bash": false
      },
      "description": "Superego evaluation agent - verifies conversations without taking action",
      "mode": "subagent",
      "name": "superego-eval"
    }
  },
  "mode": {},
  "plugin": [],
  "command": {
    "story": {
      "template": "<stripped>",
      "description": "Start working on a story from Azure Boards"
    }
  },
  "username": "muness",
  "keybinds": {
    "leader": "ctrl+x",
    "app_exit": "ctrl+c,ctrl+d,<leader>q",
    "editor_open": "<leader>e",
    "theme_list": "<leader>t",
    "sidebar_toggle": "<leader>b",
    "scrollbar_toggle": "none",
    "username_toggle": "none",
    "status_view": "<leader>s",
    "session_export": "<leader>x",
    "session_new": "<leader>n",
    "session_list": "<leader>l",
    "session_timeline": "<leader>g",
    "session_fork": "none",
    "session_rename": "none",
    "session_share": "none",
    "session_unshare": "none",
    "session_interrupt": "escape",
    "session_compact": "<leader>c",
    "messages_page_up": "pageup",
    "messages_page_down": "pagedown",
    "messages_half_page_up": "ctrl+alt+u",
    "messages_half_page_down": "ctrl+alt+d",
    "messages_first": "ctrl+g,home",
    "messages_last": "ctrl+alt+g,end",
    "messages_next": "none",
    "messages_previous": "none",
    "messages_last_user": "none",
    "messages_copy": "<leader>y",
    "messages_undo": "<leader>u",
    "messages_redo": "<leader>r",
    "messages_toggle_conceal": "<leader>h",
    "tool_details": "none",
    "model_list": "<leader>m",
    "model_cycle_recent": "f2",
    "model_cycle_recent_reverse": "shift+f2",
    "model_cycle_favorite": "none",
    "model_cycle_favorite_reverse": "none",
    "command_list": "ctrl+p",
    "agent_list": "<leader>a",
    "agent_cycle": "tab",
    "agent_cycle_reverse": "shift+tab",
    "variant_cycle": "ctrl+t",
    "input_clear": "ctrl+c",
    "input_paste": "ctrl+v",
    "input_submit": "return",
    "input_newline": "shift+return,ctrl+return,alt+return,ctrl+j",
    "input_move_left": "left,ctrl+b",
    "input_move_right": "right,ctrl+f",
    "input_move_up": "up",
    "input_move_down": "down",
    "input_select_left": "shift+left",
    "input_select_right": "shift+right",
    "input_select_up": "shift+up",
    "input_select_down": "shift+down",
    "input_line_home": "ctrl+a",
    "input_line_end": "ctrl+e",
    "input_select_line_home": "ctrl+shift+a",
    "input_select_line_end": "ctrl+shift+e",
    "input_visual_line_home": "alt+a",
    "input_visual_line_end": "alt+e",
    "input_select_visual_line_home": "alt+shift+a",
    "input_select_visual_line_end": "alt+shift+e",
    "input_buffer_home": "home",
    "input_buffer_end": "end",
    "input_select_buffer_home": "shift+home",
    "input_select_buffer_end": "shift+end",
    "input_delete_line": "ctrl+shift+d",
    "input_delete_to_line_end": "ctrl+k",
    "input_delete_to_line_start": "ctrl+u",
    "input_backspace": "backspace,shift+backspace",
    "input_delete": "ctrl+d,delete,shift+delete",
    "input_undo": "ctrl+-,super+z",
    "input_redo": "ctrl+.,super+shift+z",
    "input_word_forward": "alt+f,alt+right,ctrl+right",
    "input_word_backward": "alt+b,alt+left,ctrl+left",
    "input_select_word_forward": "alt+shift+f,alt+shift+right",
    "input_select_word_backward": "alt+shift+b,alt+shift+left",
    "input_delete_word_forward": "alt+d,alt+delete,ctrl+delete",
    "input_delete_word_backward": "ctrl+w,ctrl+backspace,alt+backspace",
    "history_previous": "up",
    "history_next": "down",
    "session_child_cycle": "<leader>right",
    "session_child_cycle_reverse": "<leader>left",
    "session_parent": "<leader>up",
    "terminal_suspend": "ctrl+z",
    "terminal_title_toggle": "none",
    "tips_toggle": "<leader>h"
  }
}

I wonder if the agent directive to strip tools is messing with the coding agent too?

@muness commented on GitHub (Dec 30, 2025): I see the same issue. `opencode debug config` output: ```json { "agent": { "superego-eval": { "prompt": "<stripped>", "tools": { "write": false, "edit": false, "bash": false }, "description": "Superego evaluation agent - verifies conversations without taking action", "mode": "subagent", "name": "superego-eval" } }, "mode": {}, "plugin": [], "command": { "story": { "template": "<stripped>", "description": "Start working on a story from Azure Boards" } }, "username": "muness", "keybinds": { "leader": "ctrl+x", "app_exit": "ctrl+c,ctrl+d,<leader>q", "editor_open": "<leader>e", "theme_list": "<leader>t", "sidebar_toggle": "<leader>b", "scrollbar_toggle": "none", "username_toggle": "none", "status_view": "<leader>s", "session_export": "<leader>x", "session_new": "<leader>n", "session_list": "<leader>l", "session_timeline": "<leader>g", "session_fork": "none", "session_rename": "none", "session_share": "none", "session_unshare": "none", "session_interrupt": "escape", "session_compact": "<leader>c", "messages_page_up": "pageup", "messages_page_down": "pagedown", "messages_half_page_up": "ctrl+alt+u", "messages_half_page_down": "ctrl+alt+d", "messages_first": "ctrl+g,home", "messages_last": "ctrl+alt+g,end", "messages_next": "none", "messages_previous": "none", "messages_last_user": "none", "messages_copy": "<leader>y", "messages_undo": "<leader>u", "messages_redo": "<leader>r", "messages_toggle_conceal": "<leader>h", "tool_details": "none", "model_list": "<leader>m", "model_cycle_recent": "f2", "model_cycle_recent_reverse": "shift+f2", "model_cycle_favorite": "none", "model_cycle_favorite_reverse": "none", "command_list": "ctrl+p", "agent_list": "<leader>a", "agent_cycle": "tab", "agent_cycle_reverse": "shift+tab", "variant_cycle": "ctrl+t", "input_clear": "ctrl+c", "input_paste": "ctrl+v", "input_submit": "return", "input_newline": "shift+return,ctrl+return,alt+return,ctrl+j", "input_move_left": "left,ctrl+b", "input_move_right": "right,ctrl+f", "input_move_up": "up", "input_move_down": "down", "input_select_left": "shift+left", "input_select_right": "shift+right", "input_select_up": "shift+up", "input_select_down": "shift+down", "input_line_home": "ctrl+a", "input_line_end": "ctrl+e", "input_select_line_home": "ctrl+shift+a", "input_select_line_end": "ctrl+shift+e", "input_visual_line_home": "alt+a", "input_visual_line_end": "alt+e", "input_select_visual_line_home": "alt+shift+a", "input_select_visual_line_end": "alt+shift+e", "input_buffer_home": "home", "input_buffer_end": "end", "input_select_buffer_home": "shift+home", "input_select_buffer_end": "shift+end", "input_delete_line": "ctrl+shift+d", "input_delete_to_line_end": "ctrl+k", "input_delete_to_line_start": "ctrl+u", "input_backspace": "backspace,shift+backspace", "input_delete": "ctrl+d,delete,shift+delete", "input_undo": "ctrl+-,super+z", "input_redo": "ctrl+.,super+shift+z", "input_word_forward": "alt+f,alt+right,ctrl+right", "input_word_backward": "alt+b,alt+left,ctrl+left", "input_select_word_forward": "alt+shift+f,alt+shift+right", "input_select_word_backward": "alt+shift+b,alt+shift+left", "input_delete_word_forward": "alt+d,alt+delete,ctrl+delete", "input_delete_word_backward": "ctrl+w,ctrl+backspace,alt+backspace", "history_previous": "up", "history_next": "down", "session_child_cycle": "<leader>right", "session_child_cycle_reverse": "<leader>left", "session_parent": "<leader>up", "terminal_suspend": "ctrl+z", "terminal_title_toggle": "none", "tips_toggle": "<leader>h" } } ``` I wonder if the agent directive to strip tools is messing with the coding agent too?
Author
Owner

@rekram1-node commented on GitHub (Dec 30, 2025):

can u share a session of this happening?

@rekram1-node commented on GitHub (Dec 30, 2025): can u share a session of this happening?
Author
Owner

@starcraft66 commented on GitHub (Jan 16, 2026):

@rekram1-node Here's an example of it happening with Claude. I've only seen this happen since I started using oh-my-opencode this morning: https://opncd.ai/share/gxGWfMcs

I realize that this is happening because I'm in plan mode and the agent doesn't seem to be aware of it. I'm guessing that's an issue with the agent's prompt.

@starcraft66 commented on GitHub (Jan 16, 2026): @rekram1-node Here's an example of it happening with Claude. I've only seen this happen since I started using oh-my-opencode this morning: https://opncd.ai/share/gxGWfMcs I realize that this is happening because I'm in plan mode and the agent doesn't seem to be aware of it. I'm guessing that's an issue with the agent's prompt.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2783