{"record":{"id":"5de548b7cfa5d338","repo":"deepseek-ai/deepseek-harness","slug":"server-negotiated-unsupported-position-encoding","errorCode":null,"errorMessage":"server negotiated unsupported position encoding \"${encoding}\"; this host requires utf-16","messagePattern":"server negotiated unsupported position encoding \"(.+?)\"; this host requires utf-16","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/lsp/lsp-stdio/src/translate.ts","lineNumber":99,"sourceCode":"  if (typeof sync === 'number') return isOpenCloseKind(sync)\n  return sync.openClose === true\n}\n\n/** Legacy enum: `Full` (1) or `Incremental` (2) imply open/close support; `None` (0) does not. */\nfunction isOpenCloseKind(kind: WireTextDocumentSyncKind): boolean {\n  return kind === 1 || kind === 2\n}\n\n/**\n * Normalize the negotiated position encoding. An omitted encoding defaults to `utf-16`; any value\n * other than `utf-16` is a protocol error this host does not support.\n * @param encoding - the server's advertised `positionEncoding`, if any.\n * @returns the string `'utf-16'`.\n * @throws Error for any non-`utf-16` encoding.\n */\nexport function negotiatePositionEncoding(encoding: string | undefined): 'utf-16' {\n  if (encoding === undefined || encoding === 'utf-16') return 'utf-16'\n  throw new Error(`server negotiated unsupported position encoding \"${encoding}\"; this host requires utf-16`)\n}\n\n/** Convert a wire range to the seam's range (structurally identical, but re-shaped as `readonly`). */\nfunction toRange(range: WireRange): LspRange {\n  return {\n    start: { line: range.start.line, character: range.start.character },\n    end: { line: range.end.line, character: range.end.character },\n  }\n}\n\n/** Whether a record is a `LocationLink` (has `targetUri` + `targetSelectionRange`). */\nfunction isLocationLink(value: Record<string, unknown>): boolean {\n  return typeof value.targetUri === 'string' && isRange(value.targetSelectionRange)\n}\n\n/** Whether a record is a `Location` (has string `uri` + a range). */\nfunction isLocation(value: Record<string, unknown>): boolean {\n  return typeof value.uri === 'string' && isRange(value.range)","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/lsp/lsp-stdio/src/translate.ts#L81-L117","documentation":"Error \"server negotiated unsupported position encoding \"${encoding}\"; this host requires utf-16\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/lsp/lsp-stdio/src/translate.ts:99 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a language server that supports utf-16 position encoding."],"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"}