mirror of
https://github.com/7836246/cursor2api.git
synced 2026-05-23 04:52:37 +08:00
核心修复: - cursor-client.ts: 固定总超时 → 空闲超时,防止长输出被截断 (#12) - converter.ts: tolerantParse 三级修复策略,处理截断 JSON (#13) - types.ts: 新增 AnthropicToolChoice 类型,补齐 tool_choice 字段 - converter.ts: buildToolInstructions 支持 tool_choice,注入 MANDATORY 约束 - handler.ts: tool_choice=any 时检测无工具调用 → 自动追加强制消息重试 测试覆盖: - test/unit-tolerant-parse.mjs: 18 个单元测试(tolerantParse/parseToolCalls) - test/e2e-chat.mjs: 16 个 E2E 测试(基础问答、工具调用、流式、边界防御) - test/e2e-agentic.mjs: 7 个 Agentic 压测(完整 Claude Code 工具链模拟) - package.json: 新增 test:unit / test:e2e / test:agentic 快捷命令