Add Cursor Agent engine + per-engine model picker#397
Open
hugobiais wants to merge 11 commits into
Open
Conversation
Wraps `agent -p --output-format stream-json --stream-partial-output` so sessions can be driven by Cursor's CLI alongside Claude Code and Codex. Self-registers via the existing engine registry, so the EnginePicker and engineLogin IPC pick it up with no UI changes.
- Engine adapters expose listModels(); a 24h on-disk cache (engine-model-cache.json) lives in userData with in-flight request de-duplication - Picker dropdown gains a two-step Provider → Model navigation, per-engine selection persisted via localStorage, and selected model rendered as a subline under the engine name - SpawnContext / RunEngineOptions carry an optional model id through to runEngine and the session DB so a chosen model is honored end-to-end
Filtering with txt.trim() drops chunks that are just spaces/newlines, which can run adjacent words together when Cursor splits its partial output across deltas. Only skip truly empty strings now, and keep lastNarrative anchored to non-whitespace text.
The dropdown previously sized itself to the viewport, which made the pill's small window clip it and wasted space in the hub. Both views (provider + model) now share a deterministic 200px box; the inner list scrolls when entries don't fit. The picker auto-flips between opening up and opening down based on the toggle's distance from the viewport top, and exports its menu height as a constant so the pill can grow its window to exactly the room needed when the menu is open. Adds the model count to the search placeholder so the user knows how many models the catalog returned.
There was a problem hiding this comment.
5 issues found across 25 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="app/src/renderer/pill/pill.css">
<violation number="1" location="app/src/renderer/pill/pill.css:750">
P2: Removing the focus outline here leaves engine picker items without a visible keyboard focus indicator.</violation>
</file>
<file name="app/src/renderer/hub/EnginePicker.tsx">
<violation number="1" location="app/src/renderer/hub/EnginePicker.tsx:362">
P2: `labelMode="model"` hides the engine name but never renders the model label, so the picker toggle can end up with no visible text.</violation>
</file>
<file name="app/src/renderer/hub/TaskInput.tsx">
<violation number="1" location="app/src/renderer/hub/TaskInput.tsx:166">
P2: Selected models can be saved under the wrong engine because `onModelChange` uses the stale `engine` state instead of the engine being selected in the same interaction.</violation>
</file>
<file name="app/src/main/index.ts">
<violation number="1" location="app/src/main/index.ts:1135">
P2: Fallback model loading bypasses the TTL check and can return expired cached model lists whenever listModels() fails.</violation>
</file>
<file name="app/src/renderer/hub/ConnectionsPane.tsx">
<violation number="1" location="app/src/renderer/hub/ConnectionsPane.tsx:278">
P2: Cursor logout does not invalidate the 24h engine model cache, so stale `cursor-agent` model lists can survive sign-out and be reused by the next session.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.
Collaborator
|
will take a look at this in a bit! |
There was a problem hiding this comment.
1 issue found across 9 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="app/src/main/index.ts">
<violation number="1" location="app/src/main/index.ts:1164">
P2: Invalidating engine models does not prevent an already-running model-list request from writing stale results back to the cache.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.
Author
|
hey @Cheggin |
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.
Summary
agent) alongside Claude Code and Codex: login/auth, stream-json parsing, Connections-pane card, engine-picker logo.listModels(); results cached 24h inengine-model-cache.json(userData) with in-flight de-dup.SpawnContext/RunEngineOptionsso sessions honor the user's choice; per-engine selection persisted inlocalStorage.Test plan
Risk + rollback
New cache file under userData (auto-rebuilt if deleted). The `model?` field on `SpawnContext` / `RunEngineOptions` is optional; adapters fall back to their CLI default when unset.