Skip to content

[Bug]: Bedrock API 400 Error: "text content blocks must be non-empty" when using custom provider #9486

@zero-dora

Description

@zero-dora

Bug Description

API call failed (attempt 1/3): BadRequestError [HTTP 400]
Provider: custom Model: claude-opus-4-6
Endpoint: https://api.opc.ren/v1
Error: HTTP 400: InvokeModelWithResponseStream: operation error Bedrock Runtime:
InvokeModelWithResponseStream, https response error StatusCode: 400,
ValidationException: messages: text content blocks must be non-empty

Steps to Reproduce

Image

Expected Behavior

能正常调用模型

Actual Behavior

第三方模型接口报错提示: {'error': {'message': 'InvokeModelWithResponseStream: operation error Bedrock Runtime: InvokeModelWithResponseStream, https
response error StatusCode: 400, RequestID: b9fcfa4a-bf07-4b5e-8fa1-276cdc1dc5be, ValidationException: messages: text content blocks must be non-empty
(request id: 202604140649155220758428268d9d6MH366L5D)', 'type': 'aws_invoke_error', 'param': '', 'code': None}}

Affected Component

CLI (interactive chat)

Messaging Platform (if gateway-related)

No response

Debug Report

Debug report uploaded:
  Report     https://paste.rs/TbGS6
  agent.log  https://paste.rs/tiV0I

Operating System

Ubuntu 24.04

Python Version

No response

Hermes Version

No response

Additional Logs / Traceback (optional)

Root Cause Analysis (optional)

No response

Proposed Fix (optional)

No response

Are you willing to submit a PR for this?

  • I'd like to fix this myself and submit a PR

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions