claude-code - 💡(How to fix) Fix [BUG] typescript-lsp pushes stale diagnostics on 2.1.158 (post-#17979) in TS project-references/composite workspaces

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

On Claude Code 2.1.158 — i.e. after the stale-diagnostics fix that shipped in 2.1.111 (#17979, CLOSED/completed) — the typescript-lsp plugin (typescript-language-server, --stdio) still pushes stale diagnostics to the agent. Errors already fixed in the file keep arriving via <new-diagnostics>, and errors from a transient intermediate edit state persist after the file is correct. The agent then "fixes" already-correct code or chases phantom errors.

This re-files the TypeScript case as a regression/incomplete-fix, mirroring how #57840 re-filed the Swift case (the #17979 fix was only verified for TS, yet appears not to hold in large TS project-references workspaces).

Error Message

  • After an edit fixes an error, the previously-reported diagnostic keeps being
  • Net effect: wasted turns, phantom-error reasoning, occasional reversions of

Root Cause

Likely-still-open root cause

RAW_BUFFERClick to expand / collapse

Summary

On Claude Code 2.1.158 — i.e. after the stale-diagnostics fix that shipped in 2.1.111 (#17979, CLOSED/completed) — the typescript-lsp plugin (typescript-language-server, --stdio) still pushes stale diagnostics to the agent. Errors already fixed in the file keep arriving via <new-diagnostics>, and errors from a transient intermediate edit state persist after the file is correct. The agent then "fixes" already-correct code or chases phantom errors.

This re-files the TypeScript case as a regression/incomplete-fix, mirroring how #57840 re-filed the Swift case (the #17979 fix was only verified for TS, yet appears not to hold in large TS project-references workspaces).

Project setup (where this reproduces)

  • Large Nx monorepo (pnpm workspaces), many projects.
  • TypeScript project references + composite projects throughout (references, composite: true, .tsbuildinfo).
  • Cross-project types resolved through the reference graph + emitted .d.ts.
  • Mixed emit (tsdowndist/, tsgoout/), so declarations the LSP consumes can lag a source edit.

Behavior

  • After an edit fixes an error, the previously-reported diagnostic keeps being injected for some time (server serves cached/lagged diagnostics for the open doc and dependent projects).
  • tsc -b / nx typecheck are correct; the LSP push is the stale source.
  • Net effect: wasted turns, phantom-error reasoning, occasional reversions of correct code.

Likely-still-open root cause

#30622 (CLOSED/duplicate) reported that the LSP client sends a constant version on every textDocument/didChange (never increments), which breaks the version-correlation that servers use to discard stale diagnostics. That was closed as a duplicate of #17979, but is a distinct client-side correctness bug and a plausible reason the fix doesn't hold here. #24443 (CLOSED/duplicate) has a clean TS race-condition repro.

Expected

Diagnostics pushed to the agent should reflect current file state — or be withheld until the server has caught up — in project-references + composite workspaces, not just simple single-project cases.

Environment

  • Claude Code: 2.1.158
  • Platform: Windows 11, Git Bash (MSYS2) shell
  • Plugin: typescript-lsp@claude-plugins-official v1.0.0
  • typescript-language-server --stdio

Related

  • #17979 (CLOSED/completed) — original fix, 2.1.111; verified TS only.
  • #57840 (OPEN) — same symptom re-filed for Swift after the fix.
  • #30622 (CLOSED/dup) — constant didChange version (candidate root cause).
  • #24443 (CLOSED/dup) — TS race-condition repro.
  • #41637, #21297 (CLOSED) — earlier TS staleness reports.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [BUG] typescript-lsp pushes stale diagnostics on 2.1.158 (post-#17979) in TS project-references/composite workspaces