{"record":{"id":"576f1258f8c9a0d7","repo":"deepseek-ai/deepseek-harness","slug":"lsp-query-aborted","errorCode":null,"errorMessage":"LSP query aborted","messagePattern":"LSP query aborted","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/lsp/lsp-stdio/src/abort.ts","lineNumber":26,"sourceCode":"/**\n * Build an abort Error carrying the signal's reason and preserving timeout classification.\n * @param signal - the aborted signal whose reason to surface.\n * @returns the timeout reason if present, else the Error reason, else a generic aborted Error.\n */\nexport function abortError(signal: AbortSignal): Error {\n  const timeout = timeoutOf(signal)\n  if (timeout !== undefined) return timeout\n  const reason: unknown = signal.reason\n  if (reason instanceof Error) return reason\n  return new Error('LSP query aborted')\n}\n\n/**\n * Throw the signal's classified abort error when it has already fired.\n * @param signal - the optional query cancellation signal.\n */\nexport function throwIfAborted(signal?: AbortSignal): void {\n  if (signal?.aborted) throw abortError(signal)\n}\n\n/**\n * Await work while allowing a query signal to abandon its wait; the underlying work keeps its own\n * handlers and continues to its owner-defined quiescence boundary.\n * @param work - the owned asynchronous work.\n * @param signal - optional query cancellation.\n * @returns the work result, or a rejection carrying the classified abort reason.\n */\nexport function abortable<T>(work: Promise<T>, signal?: AbortSignal): Promise<T> {\n  if (signal === undefined) return work\n  if (signal.aborted) return Promise.reject(abortError(signal))\n  const canceled = Promise.withResolvers<never>()\n  const onAbort = (): void => { canceled.reject(abortError(signal)) }\n  signal.addEventListener('abort', onAbort, { once: true })\n  const normalized = work.catch((error: unknown) => {\n    /* v8 ignore next -- owned LSP promises reject with Error; coercion defends the generic helper. */\n    throw error instanceof Error ? error : new Error(String(error))","sourceCodeStart":8,"sourceCodeEnd":44,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/lsp/lsp-stdio/src/abort.ts#L8-L44","documentation":"Error \"LSP query aborted\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/lsp/lsp-stdio/src/abort.ts:26 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-issue the LSP query; the abort was requested or the language server was restarting."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}