Skip to content

fix(cursor): keep buildHeaders synchronous so it honors the BaseExecutor contract - #15731

Merged
diegosouzapw merged 3 commits into
release/v3.8.52from
fix/cursor-buildheaders-contract
Oct 7, 2026
Merged

diegosouzapw merged 3 commits into
release/v3.8.52from
fix/cursor-buildheaders-contract

Conversation

@diegosouzapw

Copy link
Copy Markdown
Owner

ef3b71c6 (#15642) made CursorExecutor.buildHeaders async to read the refreshable Cursor CLI client version. That override no longer matches BaseExecutor.buildHeaders (sync, returns Record<string,string>), which turned the API Route Typecheck job red on the release tip (TS2416 in executors/cursor.ts and TS2322 x8 in executors/{credential,index}.ts) and would hand a Promise to any caller that uses the result directly (e.g. the base-class paths in base.ts).

The async was never needed: getCursorAgentCliVersion() awaits nothing — it answers from env, a local install, the disk cache or the pin, and fires the installer scrape in the background.

Fix (behavior unchanged):

  • expose the same lookup as getCursorAgentCliVersionSync();
  • keep getCursorAgentCliVersion() as an async wrapper for existing callers;
  • make CursorExecutor.buildHeaders synchronous again.

Validation (TDD, Hard Rule #18): tests/unit/cursor-build-headers-sync-contract.test.ts fails on the tip (buildHeaders returns a Promise; the sync lookup does not exist) and passes with the change. 41/41 across the Cursor suites; check-api-typecheck exits 0 (the 4 Cursor/executor regressions are gone); typecheck:core and check:open-sse-typecheck pass.

⚠️ base-red inherited, unrelated to this change: check-mutation-test-coverage lists 13 covering tests missing from stryker.conf.json on the tip, and check-env-doc-sync reports NEXT_MANUAL_SIG_HANDLE / OMNIROUTE_ESTIMATOR_CALIBRATION missing from .env.example.

…tor contract

ef3b71c made CursorExecutor.buildHeaders async to read the refreshable CLI
client version, but the lookup never awaits anything (it answers from env, a
local install, the disk cache or the pin and refreshes in the background).
The async override broke the BaseExecutor signature (TS2416 / TS2322 in
executors/{cursor,credential,index}.ts, red API Route Typecheck) and would hand
a Promise to any caller that uses the result directly.

Expose the same lookup as getCursorAgentCliVersionSync, keep
getCursorAgentCliVersion as an async wrapper for existing callers, and make the
override synchronous again. Behavior is unchanged.
@diegosouzapw
diegosouzapw merged commit d60dd67 into release/v3.8.52 Oct 7, 2026
10 of 13 checks passed
@diegosouzapw
diegosouzapw deleted the fix/cursor-buildheaders-contract branch October 7, 2026 18:00
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

CI Coverage Report

  • Coverage job: skipped
  • PR test policy: success

Coverage artifact was not available for this run.

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.

1 participant