fix(pool): fallback to SDK runner when cursor-agent binary not found on Windows#113
Merged
Nomadcxx merged 6 commits intoJun 28, 2026
Conversation
Owner
|
This is really helpful man, thank you. I'm reviewing now, just want to make sure it will not conflict with next slice of changes I have planned for the plugin. At the moment I'm thinking of just biting the bullet and developing a very small hook and rule for cursor-agent so it can steer models better.. at the moment.. converting one set of tooling to another has become a nightmare.. malformed writes here and there (mostly with Composer if not exclusively at this point). |
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.
Summary
When
CURSOR_ACP_AGENT_POOL=1is enabled on Windows andcursor-agent.cmdis not installed at the expected path (%LOCALAPPDATA%\cursor-agent\cursor-agent.cmd),resolveCursorAgentBinary()returns the bare name without a full path. The pool runner then callsspawn("cursor-agent.cmd", ..., { shell: true })which fails with an opaquecmd.exeerror:This PR adds:
BinaryNotFoundErrorwith a descriptive message (path attempted +CURSOR_AGENT_EXECUTABLEhint)resolveCursorAgentBinaryStrict) used exclusively by the pool — the originalresolveCursorAgentBinaryis untouched (15 call sites)warnlog emitted once per pool keyThe pool is opt-in (
CURSOR_ACP_AGENT_POOLnot set = no change). macOS/Linux behavior is unchanged.Changes
src/utils/errors.tsBinaryNotFoundErrorwithattemptedPathfieldsrc/utils/binary.tsresolveCursorAgentBinaryStrict()— throws on win32 when binary missingsrc/client/cursor-agent-child.tsBinaryNotFoundError, log warn once, fall back to SDK runner; fix async throw in error handlersrc/plugin.tssdkApiKeyto pool child for SDK fallbacktests/unit/binary-strict.test.tstests/unit/cursor-agent-fallback.test.tspackage.json--isolateto test scripts (required for module-mocking isolation); register new test files in CITesting
485/486 pass — the single failure (
Plugin entry moduleESM resolution) is pre-existing onmain.