Skip to content

[BUG] Url mentions don't seem to be functional #12089

@eliannelavoie

Description

@eliannelavoie

Problem (one or two sentences)

Pasting a URL to fetch it's content in a @ mention doesn't work. The model is not given the contents of the page in the API request.

Context (who is affected and when)

Happens to users trying to give a web page as context to their agent

Reproduction steps

  1. VS Code Extension, Windows 11
  2. Start a new task
  3. Write a prompt with a URL mention

My exact test prompt is:

@https://docs.roocode.com/basic-usage/context-mentions 

What's in the above page?

Expected result

The model receives the markdownified contents of the page and gives a brief summary

Actual result

The model only sees the url and attempts to read the page with an external tool (ie. curl)

Variations tried (optional)

No response

App Version

3.52.0

API Provider (optional)

None

Model Used (optional)

No response

Roo Code Task Links (optional)

No response

Relevant logs or errors (optional)

I used the "Enable debug mode" toggle to get the API History of my test conversation.

We can see the the first "user" message doesn't send the contents of the page to the API. I would expect there to be an additional text content object showing the contents of the mention, just like what happens when we mention a file.


[
  {
    "role": "user",
    "content": [
      {
        "type": "text",
        "text": "<user_message>\n'https://docs.roocode.com/basic-usage/context-mentions' \n\nWhat's in the above page?\n</user_message>"
      },
      {
        "type": "text",
        "text": "<environment_details>Cleared for privacy...</environment_details>"
      }
    ],
    "ts": 1775726555085
  },
  {
    "role": "assistant",
    "content": [
      {
        "type": "tool_use",
        "id": "tool_execute_command_3861XvsLetyeUFr9efsh",
        "name": "execute_command",
        "input": {
          "command": "curl -L https://docs.roocode.com/basic-usage/context-mentions"
        }
      }
    ],
    "ts": 1775726561154,
    "reasoning_details": [
      {
        "type": "reasoning.encrypted",
        "text": "The user wants to know the content of the page `https://docs.roocode.com/basic-usage/context-mentions`.\nI don't have a tool to directly browse the web, but I can use `execute_command` to run a command that fetches the content of the URL, such as `curl` or `powershell`'s `Invoke-WebRequest`.\n\nSince I am on Windows 11, I can use `curl` (which is available in cmd.exe) or PowerShell.\n\nPlan:\n1. Use `execute_command` to fetch the content of the URL.\n2. Analyze the fetched content and summarize it for the user.",
        "id": "tool_execute_command_3861XvsLetyeUFr9efsh",
        "format": "google-gemini-v1",
        "index": 0
      },
      {
        "type": "reasoning.encrypted",
        "data": "EiYKJGUyNDgzMGE3LTVjZDYtNDJmZS05OThiLWVlNTM5ZTcyYjljMw==",
        "id": "tool_execute_command_3861XvsLetyeUFr9efsh",
        "format": "google-gemini-v1",
        "index": 0
      }
    ]
  },
  {
    "role": "user",
    "content": [
      {
        "type": "tool_result",
        "tool_use_id": "tool_execute_command_3861XvsLetyeUFr9efsh",
        "content": "{\"status\":\"error\",\"message\":\"The tool execution failed\",\"error\":\"Tool \\\"execute_command\\\" is not allowed in architect mode.\"}",
        "is_error": true
      },
      {
        "type": "text",
        "text": "<environment_details>Cleared for privacy...</environment_details>"
      }
    ],
    "ts": 1775726561505
  },
  {
    "role": "assistant",
    "content": [
      {
        "type": "tool_use",
        "id": "tool_switch_mode_LGRJECozuNxG5sGrdv1F",
        "name": "switch_mode",
        "input": {
          "mode_slug": "code",
          "reason": "I need to use `execute_command` to fetch the content of the provided URL using `curl`, and this tool is not available in Architect mode."
        }
      }
    ],
    "ts": 1775726584661,
    "reasoning_details": [
      {
        "type": "reasoning.encrypted",
        "text": "The user wants to know the content of the page `https://docs.roocode.com/basic-usage/context-mentions`.\nI tried to use `execute_command` with `curl`, but it failed because `execute_command` is not allowed in `architect` mode.\n\nI need to find a way to get the content of that URL.\nSince I am in `architect` mode and cannot use `execute_command`, I should check if there are other tools available.\nWait, the system prompt says: \"Some modes have restrictions on which files they can edit.\" but it doesn't explicitly say `execute_command` is restricted in `architect` mode in the *general* rules, but the tool execution error clearly stated: `Tool \"execute_command\" is not allowed in architect mode.`\n\nI need to switch to a mode that allows `execute_command` or has a tool to fetch web content.\nActually, `code` mode or `ask` mode might allow it, but usually, `execute_command` is for system operations.\nWait, if I can't use `execute_command` in `architect` mode, I should switch to a mode that can.\nHowever, the user just asked \"What's in the above page?\". This is an informational request.\n`ask` mode is for explanations, documentation, or answers to technical questions.\nLet's try switching to `ask` mode or `code` mode.\nActually, `code` mode is usually more permissive with tools.\n\nBut wait, I can just use `switch_mode` to `ask` or `code`.\nLet's try `ask` mode first as it's more aligned with \"What's in the above page?\".\nWait, if `execute_command` is restricted in `architect`, is it restricted in `ask`?\nThe prompt says: \"You have access to tools that let you execute CLI commands on the user's computer...\".\nIf I switch to `code` mode, I can probably use `curl`.\n\nActually, I should check if I can use `execute_command` in `ask` mode.\nBut the most direct way to get the content of a URL if I don't have a `fetch` tool is `curl` via `execute_command`.\n\nLet's try switching to `code` mode to use `curl`.\n\nWait, I can also try to see if there's any other way.\nThe user is asking about Roo Code documentation.\nMaybe I can just switch to `ask` mode and see if it has better capabilities or if I can use `execute_command` there.\nActually, `code` mode is the safest bet for tool access.\n\nWait, I'll try to switch to `ask` mode first because it's a question. If that fails, I'll go to `code`.\nActually, let's just go to `code` mode to be sure I can run the command.\n\nWait, I should explain why I'm switching.\n\"I need to fetch the content of the URL, and `execute_command` is not available in Architect mode. I will switch to Code mode to use `curl` and retrieve the page content.\"\n\nActually, let's try `ask` mode first.\nNo, `code` mode is definitely allowed to run commands.\n\nWait, I can just use `switch_mode` to `code`.",
        "id": "tool_switch_mode_LGRJECozuNxG5sGrdv1F",
        "format": "google-gemini-v1",
        "index": 0
      },
      {
        "type": "reasoning.encrypted",
        "data": "EiYKJGUyNDgzMGE3LTVjZDYtNDJmZS05OThiLWVlNTM5ZTcyYjljMw==",
        "id": "tool_switch_mode_LGRJECozuNxG5sGrdv1F",
        "format": "google-gemini-v1",
        "index": 0
      }
    ]
  }
]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions