Skip to content

[Bug/错误]: ClaudeCode 中使用 anphropic 格式报错 API Error: Content block not found #1655

@crd2333

Description

@crd2333

Pre-submission Checklist / 提交前检查

  • I have searched the existing issues and this bug has not been reported / 我已搜索现有 issues,此 Bug 尚未被报告
  • I have read the documentation / 我已阅读文档
  • I am using the latest version of AxonHub / 我正在使用 AxonHub 的最新版本

FAQ Check / FAQ 检查

  • I have checked the FAQ and this bug is not covered there / 我已查阅 FAQ,此 Bug 未被覆盖

Bug Description / Bug 描述

在 CC 中调用一个从 kiro 反代来的 claude 中转站,如果我直接在 cc 中调用对方的链接和 api,是可以正常使用没有问题的。但是套了一层 Axonhub 就会报错 API Error: Content block not found,axonhub 中的日志则是 context canceled。在 AxonHub 中使用的协议为 Anphropic messages,没有开启透传。

在 l 站搜了一下有类似的帖子:https://linux.do/t/topic/1996734。说是翻译 v1/chat/completion 格式到 v1/messages 格式的时候丢掉了 content_block_start 这个事件。但理论上来说我这里应该不涉及 openai 格式的转换?但丢掉了 content_block_start 这个问题应该是没错的。

Steps to Reproduce / 复现步骤

如上

Expected Behavior / 期望行为

正常调用无报错

Error Message / 错误消息

Operating System / 操作系统

Linux (Ubuntu/Debian) / Linux(Ubuntu/Debian)

AxonHub Version / AxonHub 版本

v0.9.42

Usage Scenario / 使用场景

Claude Code

API Format / API 格式

Anthropic - Messages (/v1/messages) / Anthropic Messages

Channel Type / 渠道类型

Anthropic / Anthropic

Logs / 日志

Additional Context / 其他补充信息

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions