Where does the bug appear (feature/product)?
Cursor SDK
Describe the Bug
Model parameters must travel in params as {id, value} pairs. A parameter written as a top-level key, such as { id: "grok-4.5", effort: "high", fast: true }, is discarded with no error. In dist/esm/357.js the request proto is built from { modelId: t.model.id, parameters: (t.model.params ?? []).map(...) }, so nothing else on the selection is read. Values inside params are unvalidated too. Worst of all, run.model returns the object I passed rather than the resolved selection, so a dropped parameter is undetectable. Six of my pinned agents ran at default effort for months before I noticed.
Steps to Reproduce
Create a local agent with model: { id: "grok-4.5", effort: "high", fast: true }, send a prompt, and read run.model. It returns my object verbatim, including effort: "not-a-real-effort" if I substitute that. Reading dist/esm/357.js confirms why: the proto is new G4({ modelId: t.model.id, parameters: (t.model.params ?? []).map(...) }), and that value becomes runOptions.requestedModel, which the executor maps to modelParams. Top-level keys never enter the chain. Separately, params: [{ id: "effort", value: "not-a-real-effort" }] also runs to completion with no error.
Expected Behavior
Reject unrecognized fields on ModelSelection, and unknown parameter ids or values inside params, instead of dropping them silently. Failing that, make run.model report the resolved selection so a discarded parameter is at least observable.
Version Information
@cursor/sdk 1.0.24, Node 20.11.0, Linux 6.12.67. Local agents via Agent.create with JsonlLocalAgentStore. Models: grok-4.5, claude-opus-5.