Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[deepseek] A native max_tokens stop is rejected before classification, so the Turn fails instead of reporting length

Aperta Adatta ai principianti
#524 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
85/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
ai, backend

Direzione di ricerca

Il filtro di ammissione è in packages/worker-shim/src/adapters/deepseek.ts:1746-1753; aggiungi max_tokens alle ragioni di stop consentite lì. Il classificatore in deepseek.ts:241-242 mappa già ciò a length. Aggiungi un test di regressione in deepseek.test.ts che invia una risposta prompt max_tokens e asserisci lo stato Turn length e la chiusura con successo. Fatto quando il Turn si stabilizza come length e il nuovo test passa.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug doc-audit

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 as length, rather than error; never completed success."
  • Decision: docs/decisions/20261009-truthful_native_stop_classification.md requires a proved native output or context limit to stay length.
  • Code:
    • packages/worker-shim/src/adapters/deepseek.ts:241-242@547887980 classifies the value: if (input.stopReason === 'max_tokens') return { assistantText: null, status: 'length', stopReason: 'max_tokens' };
    • packages/worker-shim/src/adapters/deepseek.ts:1746-1753@547887980 runs first on the prompt response and rejects every stop reason outside ['end_turn', 'cancelled', ...FAILED_STOP_REASONS], then calls this.poisonNativeEvidence(this.turn).
    • packages/worker-shim/src/adapters/deepseek.ts:69@547887980: FAILED_STOP_REASONS = new Set(['max_turn_requests', 'refusal']), so max_tokens is not admitted.
    • poisonNativeEvidence (deepseek.ts:1649-1661) clears the close proof, sets unknownIdentity, 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:196 covers only the pure classifier. No test sends a real max_tokens prompt 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.

Lingua principale
TypeScript
Stelle
0
Fork
1
Merge medio
3h 54m
PR unite (30g)
5

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di lingkaix/openkit

Tutte le issue di lingkaix/openkit

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.