Skip to content

fix(check-types): batch getDiagnostic calls to avoid overwhelming tsserver#10180

Merged
davidfirst merged 1 commit intomasterfrom
fix/check-types-batch-diagnostics
Feb 3, 2026
Merged

fix(check-types): batch getDiagnostic calls to avoid overwhelming tsserver#10180
davidfirst merged 1 commit intomasterfrom
fix/check-types-batch-diagnostics

Conversation

@davidfirst
Copy link
Copy Markdown
Member

Summary

When running bit check-types on workspaces with many components, tsserver can become overwhelmed and fail to detect type errors. This fix batches the getDiagnostic calls into groups of 50 files.

Bonus: ~35% performance improvement (33 sec vs 50 sec for 138 components).

Changes

  • Add optional batchSize parameter to getDiagnostic() method
  • Use batching in check-types command for large file sets

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a performance and reliability issue where tsserver becomes overwhelmed when type-checking workspaces with many components. The fix implements batching for getDiagnostic calls, processing files in groups of 50, which resolves the tsserver overload issue and provides a ~35% performance improvement (33s vs 50s for 138 components).

Changes:

  • Added optional batchSize parameter to getDiagnostic() method in TsserverClient
  • Implemented batch processing logic that splits large file sets into smaller chunks
  • Applied batching in the check-types command when file count exceeds 50

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
scopes/typescript/typescript/cmds/check-types.cmd.ts Added batch size constant and conditional batching logic to avoid overwhelming tsserver with large file sets
scopes/typescript/ts-server/ts-server-client.ts Extended getDiagnostic with optional batching capability, processing files in chunks when batch size is specified

@davidfirst davidfirst merged commit bb4616b into master Feb 3, 2026
18 checks passed
@davidfirst davidfirst deleted the fix/check-types-batch-diagnostics branch February 3, 2026 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants