[deepseek] A native max_tokens stop is rejected before classification, so the Turn fails instead of reporting length
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 85/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
Research direction
The admission filter is in packages/worker-shim/src/adapters/deepseek.ts:1746-1753; add max_tokens to the allowed stop reasons there. The classifier at deepseek.ts:241-242 already maps it to length. Add a regression test in deepseek.test.ts sending a max_tokens prompt response and assert Turn status length and successful close. Done when the Turn settles as length and the new test passes.
Written by the indexing model from the issue text.
Description
Found by the independent documentation audit (DeepSeek Worker Adapter specification, on branch audit/independent-docs-20261023).
- Spec clause:
docs/specs/20260930-deepseek_worker_adapter.md:104@547887980b6fd3ef730ecc669d39a3092f731408, section "Native Output Mapping": "max_tokens| Proved output/context limit carried aslength, rather thanerror; never completed success." - Decision:
docs/decisions/20261009-truthful_native_stop_classification.mdrequires a proved native output or context limit to staylength. - Code:
packages/worker-shim/src/adapters/deepseek.ts:241-242@547887980classifies the value:if (input.stopReason === 'max_tokens') return { assistantText: null, status: 'length', stopReason: 'max_tokens' };packages/worker-shim/src/adapters/deepseek.ts:1746-1753@547887980runs first on the prompt response and rejects every stop reason outside['end_turn', 'cancelled', ...FAILED_STOP_REASONS], then callsthis.poisonNativeEvidence(this.turn).packages/worker-shim/src/adapters/deepseek.ts:69@547887980:FAILED_STOP_REASONS = new Set(['max_turn_requests', 'refusal']), somax_tokensis not admitted.poisonNativeEvidence(deepseek.ts:1649-1661) clears the close proof, setsunknownIdentity, and marks the Turn terminal-poisoned.
- Upstream: the pinned
@deepseek-ai/[email protected]emits this value (lib/index.js:542,case "max-tokens": return "max_tokens";). - Tests:
packages/worker-shim/src/adapters/deepseek.test.ts:196covers only the pure classifier. No test sends a realmax_tokensprompt response through the admission path.
Observed versus required
Required: a native max_tokens terminal settles the Turn as length. Observed: the admission filter treats it as invalid native evidence, so the Turn fails, the binding loses its identity proof, and close cannot succeed. The length branch of the classifier is unreachable in production.
Adjudication
The code differs from the current accepted specification and decision. Classification: implementation defect.
Repair direction
Admit max_tokens in the prompt-response admission set so that the existing classifier maps it to length. Add a regression that sends a max_tokens prompt response through the resident adapter and checks the Turn status and a successful close.
Severity hint
Wrong terminal classification and a fenced binding on a normal model limit. Not a blocking candidate: no retained format, credential, or authorization effect.
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 1
- Avg merge
- 3h 54m
- Merged PRs (30d)
- 5
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from lingkaix/openkit
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
bug doc-audit
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
bug doc-audit
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
bug doc-audit
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
bug doc-audit
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
lingkaix/openkit#491 · 1 comment ·
Maintainers usually reply within 1 day
All issues in lingkaix/openkit
Similar issues
-
fix(worker): keep normal prepare waiting states failure-freePossibly taken @LichKing-2234 claimed this today. Openagent:codex priority:P1
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
AgoraIO-Extensions/agent-infra#3745 ·
Maintainers usually reply within 1 day
-
The five-line work window can drop its oldest line: the per-line byte share ignores the JSON framingPossibly taken @Eapp1e claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
makecindy/cindy#7973 · 1 comment ·
Maintainers usually reply within 1 day
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 78/100
lingdojo/kana-dojo#33337 · 1 comment · 5 reactions ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
code-yeongyu/senpi#4917 · 1 comment ·
Maintainers usually reply within 1 day