{"record":{"id":"1abcb70978314d4d","repo":"deepseek-ai/deepseek-harness","slug":"invalid-prepared-call","errorCode":"INVALID_PREPARED_CALL","errorMessage":"a prepared LLM call can only be dispatched once","messagePattern":"a prepared LLM call can only be dispatched once","errorType":"exception","errorClass":"LlmError","httpStatus":null,"severity":"error","filePath":"packages/llm/llm/src/index.ts","lineNumber":852,"sourceCode":"      ...config.reasoningEffort === undefined && resolvedConfig.reasoningEffort !== undefined\n        ? { reasoningEffort: true }\n        : {},\n      ...config.maxTokens === undefined && resolvedConfig.maxTokens !== undefined\n        ? { maxTokens: true }\n        : {},\n    })\n    let dispatched = false\n    return Object.freeze({\n      config: resolvedConfig,\n      retryPolicy: registration.retryPolicy,\n      adapterDefaults,\n      ...context === undefined ? {} : { context },\n      ...modelInfo.inputModalities === undefined\n        ? {}\n        : { inputModalities: Object.freeze([...modelInfo.inputModalities]) },\n      stream: (options: GenerateOptions): AsyncIterable<StreamChunk> => {\n        if (dispatched) {\n          throw new LlmError('a prepared LLM call can only be dispatched once', 'INVALID_PREPARED_CALL')\n        }\n        if (!callConfigEquals(options, resolvedConfig)) {\n          throw new LlmError(\n            'prepared LLM call config changed before adapter dispatch',\n            'INVALID_PREPARED_CALL',\n          )\n        }\n        dispatched = true\n        return this.streamWithRegistration(options, {\n          registration,\n          config: resolvedConfig,\n          modelInfo,\n          dispatch: options => adapterCall.stream(options),\n        })\n      },\n    })\n  }\n","sourceCodeStart":834,"sourceCodeEnd":870,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/llm/llm/src/index.ts#L834-L870","documentation":"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.","triggerScenarios":"Thrown at packages/llm/llm/src/index.ts:852 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Prepare a new call for the second dispatch","Audit the caller for duplicate dispatch of the same handle"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}