deepseek-ai/deepseek-harness · error · Error
source " " could not be read
Error message
source "${filePath}" could not be read: ${messageOf(error)} What it means
Thrown when the LSP stdio host cannot read a workspace source file while serving a document request: the fs capability's streamText failed (missing file, permission denial, decode error). Wraps the underlying provider message so the LSP client sees a diagnostic naming the requested path.
Solutions
- Check that the file exists and is readable per the included OS error.
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at packages/lsp/lsp-stdio/src/host.ts:108 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/10cc1feb83b85ba5.
Report an issue: GitHub.
Appendix: source
Thrown at packages/lsp/lsp-stdio/src/host.ts:108
throwIfAborted(signal)
if (!fs.contains(workspace.target, target)) {
throw new Error(`source "${filePath}" resolves outside the workspace`)
}
const chunks: string[] = []
let bytes = 0
try {
// XXX(lsp-source-replacement): Revisit stable-handle identity only if a real query observes
// replacement between canonical containment and the provider opening this stream.
const stream = await fs.streamText(target, signal)
for await (const chunk of stream) {
throwIfAborted(signal)
bytes += Buffer.byteLength(chunk)
if (bytes > maxDocumentBytes) break
chunks.push(chunk)
}
} catch (error: unknown) {
throwIfAborted(signal)
throw new Error(`source "${filePath}" could not be read: ${messageOf(error)}`, { cause: error })
}
if (bytes > maxDocumentBytes) {
throw new Error(
`source "${filePath}" exceeds the ${maxDocumentBytes}-byte limit; reading stopped after ${bytes} bytes`,
)
}
throwIfAborted(signal)
return {
fileUrl: fs.fileUrl(target),
text: chunks.join(''),
}
}
function messageOf(error: unknown): string {
return error instanceof Error ? error.message : String(error)
}
View on GitHub (pinned to b150a551b8)