环境
- Clawith 版本: 1.11.3 (main branch, commit from 2026-08-12)
- 部署方式: Docker Compose (单节点, APP_WORKERS=1)
- 系统: Amazon Linux 2023 ARM64 (t4g.large)
- Redis: 7-alpine (容器内)
- PostgreSQL: 15-alpine (容器内)
问题描述
Agent Runtime V2 在单 worker 部署下,LLM 调用成功返回 200,但 WebSocket stream 报 ChatRuntimeStreamError: Runtime delivery receipt does not resolve to this Web Chat session,导致:
- 前端看不到 AI 的回复
- 刷新页面后消息完全丢失(chat_messages 未持久化)
复现步骤
- 全新 Docker Compose 部署(AGENT_RUNTIME_V2_ENABLED=true)
- 创建 Agent,配置 DeepSeek 模型(deepseek-v4-pro)
- 新建对话,发送任何消息
- 后端日志显示 LLM 返回 200 OK
- 但随后报
ChatRuntimeStreamError: Runtime delivery receipt does not resolve to this Web Chat session
- 前端收到 "Runtime execution continues, but its live event stream was interrupted"
- 刷新后对话为空
关键日志
[RuntimeModelRequest] provider=deepseek model=deepseek-v4-pro HTTP Request: POST https://api.deepseek.com/v1/chat/completions "HTTP/1.1 200 OK" [Token Cache] API Provider -> Created: 0 tokens, Read: 7680 tokens
ERROR | app.api.websocket:1154 - [WS] Runtime event stream failed: Runtime delivery receipt does not resolve to this Web Chat session File "/app/app/services/agent_runtime/chat_stream.py", line 72, in _load_delivered_message raise ChatRuntimeStreamError(
附加问题
- 设置
AGENT_RUNTIME_V2_ENABLED=false 后,Agent 的 native runtime 类型完全不处理消息(WS 收到内容但不调用 LLM)
- 问题在每次新 session 中 100% 复现
其他已发现的代码问题
db: Any = None 依赖注入缺失 — app/api/enterprise.py 等 35+ 个文件中的路由函数 db 参数没有 Depends(get_db)
- UUID 类型错误 —
enterprise.py:401 中 uuid.UUID(tid) 对已经是 UUID 类型的 tid 调用导致 'UUID' object has no attribute 'replace'
- Alembic migration 冲突 —
f061_enterprise_info_tenant_id 尝试 ADD COLUMN tenant_id,但 initial_schema 已经创建了该列
环境
问题描述
Agent Runtime V2 在单 worker 部署下,LLM 调用成功返回 200,但 WebSocket stream 报
ChatRuntimeStreamError: Runtime delivery receipt does not resolve to this Web Chat session,导致:复现步骤
ChatRuntimeStreamError: Runtime delivery receipt does not resolve to this Web Chat session关键日志
[RuntimeModelRequest] provider=deepseek model=deepseek-v4-pro HTTP Request: POST https://api.deepseek.com/v1/chat/completions "HTTP/1.1 200 OK" [Token Cache] API Provider -> Created: 0 tokens, Read: 7680 tokens
ERROR | app.api.websocket:1154 - [WS] Runtime event stream failed: Runtime delivery receipt does not resolve to this Web Chat session File "/app/app/services/agent_runtime/chat_stream.py", line 72, in _load_delivered_message raise ChatRuntimeStreamError(
附加问题
AGENT_RUNTIME_V2_ENABLED=false后,Agent 的 native runtime 类型完全不处理消息(WS 收到内容但不调用 LLM)其他已发现的代码问题
db: Any = None依赖注入缺失 —app/api/enterprise.py等 35+ 个文件中的路由函数db参数没有Depends(get_db)enterprise.py:401中uuid.UUID(tid)对已经是 UUID 类型的 tid 调用导致'UUID' object has no attribute 'replace'f061_enterprise_info_tenant_id尝试 ADD COLUMNtenant_id,但initial_schema已经创建了该列