Repository navigation
fix(relaykit): 修复 Claude stop 字符串数组及混合类型转换 - #141
Merged
Merged
Conversation
Port upstream bc795cc (QuantumNous#7935). Refs #138
This was referenced Nov 5, 2026
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 #138
上游:bc795cc1185a0ecef0ca51f73d337667026ec62f(QuantumNous#7935)。
🚀 变更类型 / Type of change
📝 变更描述 / Description
移植上游补丁:OpenAI → Claude 转换保留字符串及
[]stringstop;混合数组只保留字符串,避免非字符串元素导致 panic。保留空字符串及原有顺序,仅修改转换实现和对应测试,保留 fork 其余行为。补丁 stable patch-id 与上游一致。本 PR 由 Codex AI 辅助移植与验证,提交供维护者审阅;不代替维护者声明已完成人工确认。
📸 运行证明 / Proof of Work
在当前 worktree 根目录执行(Go 1.27.2):
GOWORK=off GOMAXPROCS=2 go -C relaykit test -p=2 ./relayconvert/internal/oai_chat/ -count=1 -run '^TestOpenAIChatRequestToClaudeMessagesStopSequences$' -v:退出 1,复现字符串数组丢失和混合数组 panic。GOWORK=off GOMAXPROCS=2 go -C relaykit test -p=2 ./relayconvert/internal/oai_chat/ -count=1 -run 'Stop|Claude' -v:退出 0,5 个 stop 案例及现有 Claude 定向测试通过。GOWORK=off GOMAXPROCS=2 go -C relaykit build -p=2 ./...:退出 0,relaykit 脱离 workspace 独立构建通过。git diff --check:通过。未运行全仓测试或真实上游请求;本改动不涉及数据库、鉴权、计费或前端。
✅ 提交前检查项 / Checklist