Skip to content

fix: strip orphaned tool_calls to prevent DeepSeek 400 error on conversation interrupt#9

Open
Electricitysheep wants to merge 1 commit into
SurgeSeeker:mainfrom
Electricitysheep:fix-orphaned-toolcalls
Open

fix: strip orphaned tool_calls to prevent DeepSeek 400 error on conversation interrupt#9
Electricitysheep wants to merge 1 commit into
SurgeSeeker:mainfrom
Electricitysheep:fix-orphaned-toolcalls

Conversation

@Electricitysheep

Copy link
Copy Markdown
Collaborator

When Claude Code is interrupted mid-conversation or a second conversation is started, DeepSeek rejects orphaned tool_calls (no matching tool_results). This fix strips trailing tool_calls from the last message to prevent the 400 error. Also includes crypto/rand fix for generateID to prevent test collisions. 5 new test cases for stripOrphanedToolCalls. go build + go test -race all pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant