Repository navigation
fix(relaykit): 保留 Claude 工具参数数字精度 - #142
Merged
Merged
Conversation
Port upstream 4d962e4 (QuantumNous#7996). Closes #137
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔗 关联任务 / Related Issue
Closes #137
上游:QuantumNous@4d962e4
🚀 变更类型 / Type of change
📝 变更描述 / Description
将 Claude 工具参数对象的值保留为 json.RawMessage,避免大整数及高精度小数经过 float64 后失真。空值、非法 JSON 和非对象输入继续输出空对象。仅移植上游三个文件,稳定 patch-id 与上游一致,保留 fork 既有行为。
本 PR 由 AI 辅助移植和验证;提交身份 woncc 与仓库历史主要作者一致。对本次提交的技术说明和验证记录负责;人工审阅留待维护者完成。
📸 运行证明 / Proof of Work
GOMAXPROCS=2 GOWORK=off go test -p=2 ./relayconvert/internal/oai_chat/ -count=1 -run TestResponseOpenAI2ClaudeToolUseInputIsObject:先仅应用测试,3 个精度用例失败,例如 9007199254740993 变为 9007199254740992。GOMAXPROCS=2 GOWORK=off go test -p=2 ./relayconvert/internal/oai_chat/ -count=1:修复后通过。GOMAXPROCS=2 GOWORK=off go build -p=2 ./...:独立构建通过。GOMAXPROCS=2 GOWORK=off go test -p=2 ./relay/channel/claude/ -count=1:通过。git diff --check通过;三个文件gofmt -l无输出。未运行全量矩阵或真实上游端到端测试;未改变数据库、认证、用量和计费行为。✅ 提交前检查项 / Checklist