Skip to content

Haiku 4.5 appears unable to browse project files #8314

@yinso

Description

@yinso

Before submitting your bug report

Relevant environment info

- OS: macOS
- Continue version: 1.2.9
- IDE version: VSCodium 1.88.1
- Model: Claude Haiku 4.5
- config:
  
  models:
    - name: Claude Haiku 4.5
    provider: anthropic
    model: claude-haiku-4-5-20251001
  
  OR link to agent in Continue hub:

Description

When Haiku 4.5 tried to browse the project files (via ls) - the anthropic API errored out with:

{"type":"invalid_request_error","message":"messages: text content blocks must be non-empty"}

When I switch it back to Sonnet 4.5 - it works like a charm.

I dug into the message and it looks like there is an extra empty text block in the assistant's side when it tries to call the tool. I don't know whether this was generated by the assistant or not, but I copied out the messages to test them manually via curl, it works when I remove the empty text block.

Perhaps this is an Anthropic issue, but for now Continue cannot work with Haiku unless the empty block is not included when sent back to Antropic.

The messages look like below - note there is an empty text block right right before the tool calling.

{
  "msg": {
    "messageId": "2327c304-023f-45e1-9530-0f675310aa56",
    "messageType": "llm/streamChat",
    "data": {
      "completionOptions": {
        "reasoning": true,
        "reasoningBudgetTokens": 2048
      },
      "title": "Claude Haiku 4.5",
      "messages": [
        {
          "role": "system",
          "content": "<important_rules>\n  You are in agent mode.\n\n ..."
        },
        {
          "role": "user",
          "content": [
            {
              "type": "text",
              "text": "explore the project structures"
            }
          ]
        },
        {
          "role": "thinking",
          "content": "The user wants me to explore the project structure. I should start by listing the files in the current directory to get an overview of what's there. I'll use the ls tool to explore the root directory recursively to see the project structure.",
          "signature": "..."
        },
        {
          "role": "assistant",
          "content": [
            {
              "type": "text",
              "text": ""
            },
            {
              "type": "text",
              "text": "```tool\nTOOL_NAME: ls\nBEGIN_ARG: dirPath\n\".\"\nEND_ARG\nBEGIN_ARG: recursive\ntrue\nEND_ARG\n```"
            }
          ]
        },
        {
          "role": "user",
          "content": [
            {
              "type": "text",
              "text": "Tool output for ls tool call:\n\n.git/\n.gitignore\n..."
            }
          ]
        }
      ],
      "messageOptions": {
        "precompiled": true
      }
    }
  }

To reproduce

  1. Configure Continue for Haiku 4.5 (use the config from above)
  2. Ask Haiku to browse the local files

Log output

See the message detail in the description 

workbench.desktop.main.js:1647 [@continuedev] error: HTTP 400 Bad Request from https://api.anthropic.com/v1/messages
{"type":"error","error":{"type":"invalid_request_error","message":"messages: text content blocks must be non-empty"},"request_id":"req_011CUDEHpjbhH4uQEWM5EwdP"} {"context":"llm_fetch","url":"https://api.anthropic.com/v1/messages","method":"POST","model":"claude-haiku-4-5-20251001","provider":"anthropic"}
[@continuedev] error: HTTP 400 Bad Request from https://api.anthropic.com/v1/messages
{"type":"error","error":{"type":"invalid_request_error","message":"messages: text content blocks must be non-empty"},"request_id":"req_011CUDEHpjbhH4uQEWM5EwdP"} {"context":"llm_stream_chat","model":"claude-haiku-4-5-20251001","provider":"anthropic","useOpenAIAdapter":false,"streamEnabled":true,"templateMessages":false}

Metadata

Metadata

Labels

area:chatRelates to chat interfaceide:vscodeRelates specifically to VS Code extensionkind:bugIndicates an unexpected problem or unintended behavioros:macHappening specifically on Mac

Type

No type

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions