Skip to content

fix(agents): enable cursor/windows in e2e matrix#381

Open
blackpc wants to merge 18 commits intomainfrom
fix/cursorcli-windows-e2e
Open

fix(agents): enable cursor/windows in e2e matrix#381
blackpc wants to merge 18 commits intomainfrom
fix/cursorcli-windows-e2e

Conversation

@blackpc
Copy link
Contributor

@blackpc blackpc commented Mar 16, 2026

Summary

  • Direct node.exe invocation on Windows: Bypass the PowerShell nesting chain that hangs on CI. New resolveCursorBinary() finds cursor's bundled node.exe + index.js directly.
  • Inject CURSOR_API_KEY from authConfig: Factory now passes authConfig to CursorExecutorService, which injects CURSOR_API_KEY into subprocess env via buildEnv(). Was previously missing — cursor had no credentials on Windows.
  • Re-enable cursor/windows in E2E matrix: 9/9 combos now active.

Test plan

  • 42 cursor executor unit tests pass
  • 3912 total unit tests pass
  • pnpm validate clean (lint + format + typecheck + tsp)
  • Gitleaks clean
  • Local Windows test: direct invocation exits cleanly
  • Shep E2E: cursor/windows-latest passes

🤖 Generated with Claude Code

@github-actions
Copy link

Dev Release Published

Artifact Version Install
npm 1.118.0-pr381.402b548 npm install -g @shepai/cli@1.118.0-pr381.402b548

Published from commit 7dacdd9 | View CI

@blackpc blackpc force-pushed the fix/cursorcli-windows-e2e branch from 31f0259 to a6763e6 Compare March 16, 2026 11:02
@github-actions
Copy link

Dev Release Published

Artifact Version Install
npm 1.119.0-pr381.415b252 npm install -g @shepai/cli@1.119.0-pr381.415b252

Published from commit a6763e6 | View CI

@github-actions
Copy link

Dev Release Published

Artifact Version Install
npm 1.120.0-pr381.69e0404 npm install -g @shepai/cli@1.120.0-pr381.69e0404

Published from commit a528e7f | View CI

@blackpc blackpc force-pushed the fix/cursorcli-windows-e2e branch from 6439e3b to eccf04d Compare March 16, 2026 12:41
@github-actions
Copy link

Dev Release Published

Artifact Version Install
npm 1.121.0-pr381.1f06300 npm install -g @shepai/cli@1.121.0-pr381.1f06300

Published from commit 4761284 | View CI

@blackpc blackpc force-pushed the fix/cursorcli-windows-e2e branch from 4761284 to f48d724 Compare March 16, 2026 14:51
@github-actions
Copy link

Dev Release Published

Artifact Version Install
npm 1.122.2-pr381.9e94e60 npm install -g @shepai/cli@1.122.2-pr381.9e94e60

Published from commit f48d724 | View CI

@github-actions
Copy link

Dev Release Published

Artifact Version Install
npm 1.122.2-pr381.7d9e407 npm install -g @shepai/cli@1.122.2-pr381.7d9e407

Published from commit 0450022 | View CI

@github-actions
Copy link

Dev Release Published

Artifact Version Install
npm 1.122.2-pr381.078d7df npm install -g @shepai/cli@1.122.2-pr381.078d7df

Published from commit b684fc8 | View CI

arielshad and others added 14 commits March 16, 2026 21:57
two root causes fixed:

1. powershell nesting hang: agent.cmd -> powershell -> cursor-agent.ps1
   -> node.exe chain hangs on windows ci. new resolveCursorBinary()
   finds bundled node.exe + index.js directly, bypassing all wrappers.
   falls back to powershell if resolution fails.

2. missing api key: cursor executor never received authconfig from
   factory - CURSOR_API_KEY was absent from subprocess env. on
   linux/macos this was masked by ci step env inheritance. now injects
   key via buildEnv() helper across all spawn paths.

re-enables cursor/windows in e2e matrix (9/9 combos).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
adds heartbeat, stdout/stderr chunk counters, env verification,
and process lifecycle logging to debug zero-output hang on windows ci.
will be removed once cursor/windows is stable.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- log every edge case: unknown event types, is_error results, non-json
  lines, zero-output exits, empty results, stream lifecycle events
- log executeStream with heartbeat and chunk counters (was zero logging)
- log resolveCursorBinary failure reasons (was silent undefined returns)
- log powershell fallback spawn details
- increase e2e wait from 10min to 20min and step timeout from 15 to 25
  (cursor on windows takes 125s+ per api call, needs 250s+ for full flow)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…cally

when no push/pr is needed (local-only mode), the merge node now commits
changes in the worktree using programmatic git commands instead of
calling the agent executor. this eliminates the second cursor cli call
that hangs indefinitely on windows.

adds commitAll dep to merge node, wired via gitPrService.commitAll.
agent call 1 now only runs when push or openPr is requested.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…mit path

tests now reflect that push=false + openPr=false skips the agent call
and uses commitAll instead. agent-path tests set push=true explicitly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
reduce expected executor call counts by 1 in merge/evidence/rejection
flow tests since local-only mode no longer calls the agent for commit.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
default stage timeout was 1_800_000ms (30min) which let hung cursor
processes run forever. reduced to 600_000ms (10min) per call. with
3 retries that's 30min max per phase - still generous for all agents
but kills stuck processes instead of waiting forever.

reverted ci e2e wait from 20min back to 10min and step timeout from
25 back to 15min now that executor kills hung processes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
the stage timeout change was unintended - only e2e ci timeouts should
be adjusted, not the shep application defaults.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
cursor cli on windows sometimes starts but never produces output,
hanging indefinitely. adds a zero-output watchdog that kills the
process after 3 minutes of silence so retryExecute can retry.

resets silence timer on every stdout/stderr chunk. logs silence
duration in heartbeat. cursor-specific, does not affect other agents.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
'Agent execution timed out' was in NON_RETRYABLE_RE which prevented
retryExecute from retrying after the silence watchdog kills a hung
cursor process. moved to retryable-network category so the 3-retry
loop actually works.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
direct node.exe invocation hangs 100% on windows server ci with api
key auth (0 output, 3/3 retries failed). powershell + temp file
approach (attempt 13) previously worked for the implement phase.

reverts to powershell as primary windows spawn method. goes through
agent.cmd which sets up cursor environment properly. combined with
programmatic merge (no second cursor call) and silence watchdog.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… dialog

powershell `& agent` triggers windows "open with" gui dialog when agent
isn't on PATH, causing zero output and silent failure. reverts to direct
node.exe invocation as primary. powershell fallback now uses full path
to agent.cmd to avoid the dialog.

locally verified: direct node.exe + api key auth completes full e2e
(implement + programmatic merge + squash) on windows.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
heartbeat now uses process.kill(pid, 0) to verify child process is
actually running, not just checking proc.killed which only reflects
our explicit kills. also logs node.exe/index.js existence, cwd
validity, and warns if spawn returns no pid.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@blackpc blackpc force-pushed the fix/cursorcli-windows-e2e branch from aad045e to 4ee145d Compare March 16, 2026 19:57
arielshad and others added 2 commits March 16, 2026 22:22
cursor cli on windows server hangs when long prompts are passed as
spawn arguments (zero output, process alive but silent). piping the
prompt via stdin (matching claude-code executor pattern) fixes this.

verified locally: direct node.exe + api key + stdin pipe completes
full e2e in 12s on windows.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
separate workflow with only cursor/windows job. uses shep feat logs
for real-time log streaming instead of polling feat show with sleep.
detects terminal states from log content for fast failure.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link

Dev Release Published

Artifact Version Install
npm 1.124.0-pr381.b527c16 npm install -g @shepai/cli@1.124.0-pr381.b527c16

Published from commit 651e2e3 | View CI

shep resolves cursor node.exe directly via resolveCursorBinary().
having agent.cmd on path may cause internal cursor self-invocation
issues or windows open-with dialogs inside the cursor process.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link

Dev Release Published

Artifact Version Install
npm 1.124.0-pr381.0230a11 npm install -g @shepai/cli@1.124.0-pr381.0230a11

Published from commit 6cde267 | View CI

shep settings agent validates the binary via agent --version which
needs cursor-agent on path. reverting path removal.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link

Dev Release Published

Artifact Version Install
npm 1.124.0-pr381.1811a4e npm install -g @shepai/cli@1.124.0-pr381.1811a4e

Published from commit b0d4dff | View CI

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.

2 participants