Repository navigation
feat(provider): forward cursorParams to Cursor SDK model params - #132
Merged
Merged
Conversation
Owner
|
Thanks mate for the PR. The plugin now forwards OpenCode’s per-model settings to the Cursor SDK through cheers, RAMA |
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.
What
Adds an optional
cursorParamsfield that flows from the opencode request body into Cursor SDKmodel.params, so per-model parameters (reasoning effort, fast mode, context size, thinking) become selectable from opencode.Why
The Cursor SDK catalog already exposes per-model parameters, e.g.
claude-opus-5:effort=[low|medium|high|xhigh|max],thinking=[false|true],context=[300k|1m],fast=[false|true]gpt-5.6-sol:reasoning=[none|low|medium|high|xhigh|max]composer-2.5:fast=[false|true]and
Agent.create({ model: { id, params: [{ id, value }] } })accepts them (ModelSelection.params). Today the plugin drops all of it — the model id is carried as a plain string from the proxy to the runner.How
cursorParamsrides the same channel as the existingcursorModelfield (opencode modeloptions/variants.<name>→ provider request body):{ "models": { "claude-opus-5": { "name": "Claude Opus 5", "options": { "cursorModel": "claude-opus-5", "cursorParams": "effort=high" }, "variants": { "max": { "cursorParams": "effort=max,fast=true" } } } } }Accepted forms (normalized to
[{ id, value }]):"effort=high,fast=true"(comma/space separatedk=vpairs)'[{"id":"effort","value":"high"}]'{ id, value }{ "effort": "high" }Implementation (4 layers, minimal diff):
src/provider/boundary.ts— new pureresolveRuntimeParams()(tested)src/plugin.ts— readbody.cursorParamsat both handler sitessrc/client/sdk-child.ts— carryparamsin the NDJSON request (only when non-empty)scripts/sdk-runner.mjs—buildModelSelection()→model: { id, params }Compatibility
cursorParamspresent → byte-for-byte identical behavior to todaycursor-agentbackend: params are not representable there and are ignoredTests
undefined, dedupe last-wins; NDJSON payload presence/absence; runner model-selection buildingexitCode=0,done=true, no error events)Notes
Cursor.models.list()(parametersper model, plus presetvariants).variantsfrom catalogparameters, and documenting the parameter matrix.Re-submission note
This is a re-submission: the previous PR (#130) was closed pending local verification on real hardware. GitHub refuses to reopen it (
state cannot be changed — the branch was force-pushed or recreated), so a new PR is opened from the same branch. Branch content is unchanged (1 commit ahead ofmain, 0 behind). Now verified locally before submitting.