Skip to content

fix: pipe the whole generate-spec prompt through stdin in the cursor provider#2959

Open
sobanieca-redocly wants to merge 1 commit into
mainfrom
worktree-generate-spec-ai-tests
Open

fix: pipe the whole generate-spec prompt through stdin in the cursor provider#2959
sobanieca-redocly wants to merge 1 commit into
mainfrom
worktree-generate-spec-ai-tests

Conversation

@sobanieca-redocly

@sobanieca-redocly sobanieca-redocly commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

What/Why/How?

Fixes after testing generate-spec with Cursor and OpenAI providers

Reference

Testing

Screenshots (optional)

Check yourself

  • This PR follows the contributing guide
  • All new/updated code is covered by tests
  • Core code changed? - Tested with other Redocly products (internal contributions only)
  • New package installed? - Tested in different environments (browser/node)
  • Documentation update has been considered

Security

  • The security impact of the change has been considered
  • Code follows company security practices and guidelines

Note

Low Risk
Scoped to the Cursor provider path in generate-spec with matching test updates; no auth, data, or broad CLI behavior changes.

Overview
Fixes generate-spec when using the Cursor AI provider so the model receives both system instructions and the user refinement text, not just the system portion.

The Cursor CLI drops piped stdin when a prompt is passed on the command line, so runCursor no longer appends request.system to the cursor-agent args. It now sends system + user on stdin (same pattern as Codex), with args limited to -p, --output-format, --trust, and optional --model.

Provider tests were tightened so the spawn stub records stdin via pipedInput, and the Cursor case asserts the combined prompt and updated argv.

Reviewed by Cursor Bugbot for commit 2494bee. Bugbot is set up for automated code reviews on this repo. Configure here.

@changeset-bot

changeset-bot Bot commented Jul 23, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2494bee

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@redocly/cli Patch
@redocly/openapi-core Patch
@redocly/respect-core Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

Copy link
Copy Markdown
Contributor

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 71.97% (🎯 69%) 8676 / 12055
🔵 Statements 71.65% (🎯 69%) 9027 / 12598
🔵 Functions 76.63% (🎯 73%) 1719 / 2243
🔵 Branches 63.48% (🎯 61%) 5844 / 9205
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/cli/src/commands/generate-spec/ai/providers.ts 64.86% 43.33% 69.23% 64.86% 49-50, 57, 60-67, 72-77, 112, 118, 121, 147, 150, 162, 174-185, 191, 194, 211
Generated in workflow #10823 for commit 2494bee by the Vitest Coverage Report Action

@github-actions

Copy link
Copy Markdown
Contributor

Performance Benchmark (Lower is Faster)

CLI Version Bundle Lint Check Config
cli-latest ▓ 1.00x (Fastest) ▓ 1.00x ± 0.01 ▓ 1.00x ± 0.02
cli-next ▓ 1.00x ± 0.02 ▓ 1.00x (Fastest) ▓ 1.00x (Fastest)

@sobanieca-redocly
sobanieca-redocly marked this pull request as ready for review July 23, 2026 10:30
@sobanieca-redocly
sobanieca-redocly requested review from a team as code owners July 23, 2026 10:30
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