opencode icon indicating copy to clipboard operation
opencode copied to clipboard

Gemini doesn't find edit tool

Open ssoteloserrano opened this issue 2 months ago • 6 comments

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

ssoteloserrano avatar Nov 11 '25 16:11 ssoteloserrano

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] avatar Nov 11 '25 16:11 github-actions[bot]

Was it in plan mode?

rekram1-node avatar Nov 11 '25 16:11 rekram1-node

Nope, it happens in build mode

Image

ssoteloserrano avatar Nov 11 '25 16:11 ssoteloserrano

Hm can u show me opencode debug config

rekram1-node avatar Nov 12 '25 03:11 rekram1-node

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 avatar Dec 30 '25 20:12 muness

can u share a session of this happening?

rekram1-node avatar Dec 31 '25 00:12 rekram1-node

@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 avatar Jan 16 '26 16:01 starcraft66