fix(deepseek): normalize tool result adjacency - #1334
Conversation
📝 WalkthroughWalkthroughThe change adds provider-aware Responses history normalization. Enabled providers move uniquely matched tool results directly after their calls. DeepSeek enables the capability, while explicit provider settings remain authoritative. ChangesResponses tool-result adjacency
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant ProviderRegistry
participant Router
participant OpenAIResponsesAdapter
participant DeepSeek
ProviderRegistry->>Router: provide adjacency capability
Router->>OpenAIResponsesAdapter: construct provider configuration
OpenAIResponsesAdapter->>OpenAIResponsesAdapter: normalize unique tool call/result pairs
OpenAIResponsesAdapter->>DeepSeek: send reordered Responses input
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
✅ Deterministic PR hygiene checks passed. |
|
Landed on Verified before merge: Thanks — the stale-config backfill and the tolerant-provider control test are what make the capability plumbing convincing rather than just plausible. |
Summary
Verification
taskset -c 0-1 bun run typecheck— passed on the rebased exact head.taskset -c 0-1 bun test tests/deepseek-inbound-wire.test.ts tests/openai-responses-passthrough.test.ts tests/deepseek-reasoning-replay.test.ts tests/deepseek-reasoning-replay-gaps.test.ts tests/config.test.ts tests/provider-registry-parity.test.ts tests/config-save-boundary.test.ts— 277 passed, 0 failed on the rebased exact head.git diff --check origin/dev...HEAD— passed.Decision Log
Checklist
Closes #1292
Summary by CodeRabbit