Repository navigation
feat(agents): TypeScript 7 code intelligence for coding agents, load-aware tsrs checkers - #33408
Merged
Merged
Conversation
…aware tsrs checkers The stock agent TypeScript plugin needs a compiler build TS 7 no longer ships, so agents in this repo got no diagnostics or ran some other TypeScript. - config/scripts/agent-typescript-lsp.mjs starts the repo's own TS 7 language server (tsrs on Apple Silicon and Linux, the typescript package's tsc elsewhere) and turns its pull-only diagnostics into pushed publishDiagnostics for push-only clients. - .claude/settings.json registers a repo-local plugin marketplace (config/agent-plugins) and enables the orca-typescript LSP plugin; opencode.json runs the same server. - Local tsrs typechecks now pass --checkers, splitting the cores the load average leaves idle between concurrent projects (floor 4); ORCA_TYPECHECK_CHECKERS pins it.
nwparker
marked this pull request as ready for review
October 25, 2026 05:53
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 12 seconds. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The stock agent TypeScript plugin needs a compiler build that TS 7 no longer ships. In this repo, agents either got no diagnostics or quietly used some other TypeScript. The TS 7 language servers (
tsc --lsp --stdio,tsrs --lsp --stdio) only serve pull diagnostics (textDocument/diagnostic), but the agent client only accepts pushedpublishDiagnostics. I checked this by probing the protocol directly: with no pull capability, neither server pushes anything.What
config/scripts/agent-typescript-lsp.mjs: starts the repo's own TS 7 language server and sits between it and the agent:pnpm tc), otherwise thetypescriptpackage'stsc(Windows, Intel macOS).ORCA_TYPESCRIPT_LSP=tsrs|tscoverrides it.workspace/diagnostic/refresh. Results are sent back as versionedpublishDiagnostics. A result that a newer edit has outdated is dropped..claude/settings.jsonregisters a repo-local directory marketplace (config/agent-plugins) and enablesorca-typescript@orca-agent-plugins. It also turns off the stocktypescript-lspfor this repo so it can't take over.tsfiles. The plugin's.lsp.jsonrunsnode ${CLAUDE_PROJECT_DIR}/config/scripts/agent-typescript-lsp.mjs, so it always uses the current worktree's script andnode_modules, even when the per-user marketplace registration points at another worktree. The marketplace loads after the user accepts the workspace trust dialog.opencode.jsonturns off the built-in TypeScript server and runs the same script.pnpm tcruns two projects at once, so 32 checker threads on a 16-core machine. That's before counting other agents. Local tsrs checks now pass--checkers, splitting the cores the 1-minute load average leaves idle between the projects in flight, with a floor of 4. On Windows the load average reads 0, so it splits all cores.ORCA_TYPECHECK_CHECKERS=<n>pins the value.Measurements (M-series, 16 cores, 128 GB; load average 55–70 during runs)
Idle CPU after the first check is about 0%.
End-to-end in Claude Code with the plugin: the server starts on the first edit of a
.tsfile. After the next edit, the agent was shownType 'number' is not assignable to type 'string'. [2322] (ts)and the unused-variable warnings. Under heavy load, the first project load took about 6 s, so the very first edit of a session can come back before diagnostics are ready. Later edits get them.tsrs --checkersonconfig/tsconfig.node.json(load ~60):Watch-daemon investigation (not shipped)
I measured a hot per-worktree
tsrs --watchagainst today's incrementalpnpm tcpath:There is no 2x win, and the memory cost doesn't fit hundreds of worktrees. Whole-project
pnpm tcis mostly fixed overhead: about 1.9 s ofbuild:packagesplus about 1.3 s of no-change tsrs. For the edit-and-check loop, the per-session language server above is already the hot path, with 130–190 ms per-file diagnostics after an edit.Validation
pnpm tcpasses.pnpm test config/scripts/agent-typescript-lsp.test.mjs config/scripts/run-typecheck-projects-in-parallel.test.mjs config/scripts/tsrs-typecheck-compiler.test.mjspasses (46 tests).pnpm run check:code-quality:changedpasses.claude plugin validatepasses for both the marketplace and the plugin.