Skip to content

fix(agents): add missing DeepSeek V4 proxy models to reasoning_content replay set#86551

Closed
liaoyl830 wants to merge 1 commit into
openclaw:mainfrom
liaoyl830:fix/deepseek-reasoning-content-proxy
Closed

fix(agents): add missing DeepSeek V4 proxy models to reasoning_content replay set#86551
liaoyl830 wants to merge 1 commit into
openclaw:mainfrom
liaoyl830:fix/deepseek-reasoning-content-proxy

Conversation

@liaoyl830

Copy link
Copy Markdown
Contributor

Summary

  • DeepSeek V4 models (deepseek-v4-flash-free, big-pickle) accessed through proxy providers (e.g. OpenCode Zen) lose reasoning_content in assistant message replay, causing 500 errors from the API
  • isDeepSeek detection only checks endpointClass === "deepseek-native" which doesn't match proxy endpoints (opencode-native)
  • The model ID fallback set REASONING_CONTENT_REPLAY_MODEL_IDS was missing these model variants

Fix:

  • Add deepseek-v4-flash-free and big-pickle to REASONING_CONTENT_REPLAY_MODEL_IDS in both openai-transport-stream.ts and transcript-policy.ts
  • Add regression tests for DeepSeek V4 Flash Free and Big Pickle via proxy

Fixes #86521

Test plan

  • npx vitest run src/agents/openai-transport-stream.test.ts — 392 passing (includes 2 new tests)
  • npx vitest run src/agents/transcript-policy.test.ts — 98 passing (includes 4 new model IDs)
  • New tests: preserves reasoning_content replay for DeepSeek V4 Flash Free via proxy
  • New tests: preserves reasoning_content replay for Big Pickle via proxy

Real behavior proof

This fix targets the model ID fallback path in shouldPreserveReasoningContentReplay. The model ID check already works for proxy endpoints — the issue was simply that deepseek-v4-flash-free and big-pickle were missing from the set. The new unit tests cover both proxy model configurations. A live reproduction would require an OpenCode Zen (or similar) proxy configured with a DeepSeek V4 model.

…t replay set

When DeepSeek V4 models (deepseek-v4-flash-free, big-pickle) are accessed
through proxy providers like OpenCode Zen, the reasoning_content field is
stripped from assistant message replay, causing the API to return 500
errors because these models require reasoning_content to be echoed back.

The root cause is that `isDeepSeek` detection only checks endpoint class
(deepseek-native) which doesn't match proxy endpoints (opencode-native).
The model ID fallback set REASONING_CONTENT_REPLAY_MODEL_IDS also didn't
include these model variants.

Fix:
- Add deepseek-v4-flash-free and big-pickle to REASONING_CONTENT_REPLAY_MODEL_IDS
  in both openai-transport-stream.ts and transcript-policy.ts
- Add regression tests for DeepSeek V4 Flash Free and Big Pickle via proxy

Fixes openclaw#86521
@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: S triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 25, 2026
@clawsweeper

clawsweeper Bot commented May 25, 2026

Copy link
Copy Markdown
Contributor

Thanks for the context here. I swept through the related work, and this is now duplicate or superseded.

Close: this PR is superseded by the merged, proof-backed OpenCode Zen DeepSeek replay fix at #87593. The remaining big-pickle and transcript-policy additions are unproven and are better preserved on #86521 or in a new narrow proof-backed PR.

Canonical path: Close this branch, keep #87593 as the canonical shipped fix, and handle any remaining big-pickle or transcript-policy evidence through #86521 or a new narrow proof-backed PR.

So I’m closing this here and keeping the remaining discussion on #87593 and #86521.

Review details

Best possible solution:

Close this branch, keep #87593 as the canonical shipped fix, and handle any remaining big-pickle or transcript-policy evidence through #86521 or a new narrow proof-backed PR.

Do we have a high-confidence way to reproduce the issue?

Yes for the original deepseek-v4-flash-free failure through the merged canonical PR's live OpenCode proof; on current main that path is covered and no longer reproduces as a failing path. No comparable high-confidence proof is present for the remaining big-pickle or transcript-policy additions in this branch.

Is this the best way to solve the issue?

No, this branch is no longer the best way to solve the issue. Current main's suffix-normalized fix is the safer canonical solution for deepseek-v4-flash-free, while the remaining alias/policy work needs narrower proof before a new PR.

Security review:

Security review cleared: The diff only changes in-repo TypeScript replay allowlists and tests; no dependency, workflow, secret, permission, package, or code-execution surface is introduced.

AGENTS.md: found and applied where relevant.

What I checked:

  • Repository policy read: The root review policy was read fully and applied; it requires deep PR review, scoped AGENTS.md, real behavior proof for user-visible fixes, and compatibility review for provider/replay behavior. (AGENTS.md:1, 8ded75628437)
  • Scoped agents policy read: The scoped agents guide was read fully; its agent runtime test/performance guidance applies to the touched src/agents files. (src/agents/AGENTS.md:1, 8ded75628437)
  • PR diff reviewed: The PR adds exact deepseek-v4-flash-free and big-pickle transport allowlist entries plus DeepSeek/big-pickle transcript-policy entries and tests. (src/agents/openai-transport-stream.ts:3372, 9c1b60d4a615)
  • Current main transport fix: Current main already strips narrow tier suffixes before checking replay allowlist candidates, so deepseek-v4-flash-free matches the base deepseek-v4-flash replay contract without this branch's exact alias. (src/agents/openai-transport-stream.ts:4018, 8ded75628437)
  • Current main regression coverage: Current main has regression coverage for OpenCode Zen deepseek-v4-flash-free and other tier-suffixed replay-required IDs preserving reasoning_content. (src/agents/openai-transport-stream.test.ts:11008, 8ded75628437)
  • Canonical merged PR proof: The canonical merged PR added suffix-normalized transport replay and a live OpenCode DeepSeek replay probe; it merged as ad3e3cb7d2d3a432454a80309f642462fb784e9a on 2026-05-28. (extensions/opencode/opencode.live.test.ts:62, ad3e3cb7d2d3)

Likely related people:

  • Pluviobyte: Authored the merged suffix-normalization commits that cover the central deepseek-v4-flash-free transport replay path. (role: recent adjacent contributor; confidence: high; commits: 2acd256c9d12, 2474911e4d92, ad3e3cb7d2d3; files: src/agents/openai-transport-stream.ts, src/agents/openai-transport-stream.test.ts)
  • steipete: Authored the OpenCode live replay probe commits and supplied the pre-merge verification for the canonical provider route. (role: merger and live proof contributor; confidence: high; commits: 9e977d159039, 7685a75fb681, ad3e3cb7d2d3; files: extensions/opencode/opencode.live.test.ts, src/agents/openai-transport-stream.ts)
  • Alex Knight: Earlier Kimi replay work changed both the OpenAI transport and transcript-policy replay surfaces that this PR also touches. (role: adjacent replay-fix contributor; confidence: medium; commits: f8b7008f7c53; files: src/agents/openai-transport-stream.ts, src/agents/transcript-policy.ts, extensions/kimi-coding/stream.ts)

Codex review notes: model internal, reasoning high; reviewed against 8ded75628437; fix evidence: release v2026.6.6, commit ad3e3cb7d2d3.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. labels May 25, 2026
@clawsweeper

clawsweeper Bot commented May 25, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper PR egg

🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat.

Where did the egg go?
  • The egg game starts only after the PR passes the real-behavior proof check.
  • Before that, no creature or rarity is rolled. The treat waits for real proof.
  • This is still just collectible flavor: proof affects review readiness, not creature quality.

@omarshahine

Copy link
Copy Markdown
Contributor

Thanks for the PR. Before this can move forward, please add live proof from the affected surface, not just unit tests, mocked tests, or source inspection.

A useful proof update should include:

  • the exact build/SHA tested
  • the real environment used
  • the command, UI flow, channel flow, provider request, or other live path exercised
  • before/after symptom evidence where applicable
  • the observed result after the patch
  • any remaining proof gaps

Please redact secrets, tokens, phone numbers, and private message content from logs or screenshots.

@BingqingLyu

This comment was marked as spam.

@clawsweeper clawsweeper Bot added rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels May 29, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. and removed rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. labels May 29, 2026
@clawsweeper

clawsweeper Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

@liaoyl830 thanks for the PR. ClawSweeper is still waiting on real behavior proof before this can move forward.

Useful proof can be a screenshot, short video, terminal output, copied live output, linked artifact, or redacted logs that show the changed behavior after the fix. Please redact private tokens, phone numbers, private endpoints, customer data, and anything else sensitive.

Once proof is added to the PR body or a comment, ClawSweeper or a maintainer can re-check it.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 15, 2026
@vincentkoc

Copy link
Copy Markdown
Member

Thanks @liaoyl830 for the DeepSeek replay coverage here. I am closing this because the same affected OpenCode Zen / DeepSeek reasoning_content replay path is now covered by the merged fix in #87593: #87593

This PR remains part of the audit trail at #86551, and Clownfish is preserving the contributor credit and context from your branch while keeping validation and follow-up on the landed fix path.

If the specific big-pickle or transcript-policy case here still reproduces after #87593, please reply and we can reopen or split the remaining surface back out.

@vincentkoc vincentkoc closed this Jun 16, 2026
@vincentkoc vincentkoc added the clownfish Tracked by Clownfish automation label Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling clownfish Tracked by Clownfish automation merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: preserve reasoning_content for DeepSeek models through proxy providers (opencode-native)

5 participants