test: freeze tool-call contract semantics

Lock the current Anthropic streaming asymmetry so future refactors do not silently synthesize tool blocks. Align schema and docs with the actual support level to avoid over-promising forced-tool fallback.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
GitHub Actions
2026-04-22 10:56:21 +08:00
parent e3d3a63492
commit d081743924
6 changed files with 55 additions and 9 deletions

View File

@@ -5,6 +5,7 @@
- OpenAI`/v1/models``/v1/chat/completions`(含 stream
- Anthropic`/v1/messages``/v1/messages/count_tokens`(含 stream
- 内置多实例池、会话复用、Prometheus 指标、登录态 bundle 注入
- 工具事件桥接Lingma 上游返回 `tool` 事件时,网关会输出为 OpenAI `tool_calls`stream/non-stream和 Anthropic `tool_use` / `tool_result`stream/non-stream请求侧 `tools` / `tool_choice` 仅在 `TOOL_FORWARD_ENABLED=true` 时透传(默认关闭)
- 多模态降级OpenAI `image_url` / `input_image``[image]``input_audio``[audio]`Anthropic `image``[image]`
> 架构设计与二开细节请看 [`DESIGN.md`](./DESIGN.md)。
@@ -200,7 +201,7 @@ curl -s "http://127.0.0.1:${PORT}/healthz"
| `healthz` 正常但请求失败 | 用错端口 | 以 `.env``PORT` 为准,`docker compose ps` 再确认 |
| `git pull` 提示 not on a branch | 处于 detached HEAD | 执行 `git checkout -B main origin/main` |
| 自动登录不稳定 | 浏览器流程波动 | 优先使用 `LINGMA_SESSION_BUNDLE(_FILE)` |
| 工具调用未触发 | 模型未选择工具 | 使用 `tool_choice` 强制,必要时约束输出 JSON |
| 工具调用未触发 | 模型未选择工具或当前协议路径不支持合成回退 | OpenAI 可配合 `tool_choice` 强制约束输出 JSONAnthropic 当前仅 non-stream 支持合成 `tool_use` / `tool_result` 回退 |
---