deepseek-ai/deepseek-harness · error · LlmError
INVALID_PREPARED_CALL
INVALID_PREPARED_CALL
Error message
a prepared LLM call can only be dispatched once
What it means
Single-use invariant on the prepared-call object: stream() was invoked a second time on an already-dispatched prepared LLM call. Prepared calls bind config, retry policy, and replay state for exactly one dispatch; the guard freezes out accidental double-sends.
Solutions
- Prepare a new call for the second dispatch
- Audit the caller for duplicate dispatch of the same handle
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at packages/llm/llm/src/index.ts:852 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of deepseek-ai/deepseek-harness@b150a551b8 (2026-08-24).
Data as JSON: /api/errors/1abcb70978314d4d.
Report an issue: GitHub.
Appendix: source
Thrown at packages/llm/llm/src/index.ts:852
...config.reasoningEffort === undefined && resolvedConfig.reasoningEffort !== undefined
? { reasoningEffort: true }
: {},
...config.maxTokens === undefined && resolvedConfig.maxTokens !== undefined
? { maxTokens: true }
: {},
})
let dispatched = false
return Object.freeze({
config: resolvedConfig,
retryPolicy: registration.retryPolicy,
adapterDefaults,
...context === undefined ? {} : { context },
...modelInfo.inputModalities === undefined
? {}
: { inputModalities: Object.freeze([...modelInfo.inputModalities]) },
stream: (options: GenerateOptions): AsyncIterable<StreamChunk> => {
if (dispatched) {
throw new LlmError('a prepared LLM call can only be dispatched once', 'INVALID_PREPARED_CALL')
}
if (!callConfigEquals(options, resolvedConfig)) {
throw new LlmError(
'prepared LLM call config changed before adapter dispatch',
'INVALID_PREPARED_CALL',
)
}
dispatched = true
return this.streamWithRegistration(options, {
registration,
config: resolvedConfig,
modelInfo,
dispatch: options => adapterCall.stream(options),
})
},
})
}
View on GitHub (pinned to b150a551b8)