-
Notifications
You must be signed in to change notification settings - Fork 2
Cursor Sdk Cleanup #360
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cursor Sdk Cleanup #360
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,7 @@ import os from "node:os"; | |
| import path from "node:path"; | ||
| import { afterEach, describe, expect, it, vi } from "vitest"; | ||
| import type { AgentChatEventEnvelope } from "../../../../desktop/src/shared/types/chat"; | ||
| import { cancelSteerMessage, createChatSession, DEFAULT_CODEX_REASONING_EFFORT, dispatchSteerMessage, discoverProjectSlashCommands, editSteerMessage, latestGoal, latestTokenStats, listLaneDiffStats, listPrsByLane, listTerminalSessions, sendChatMessage, signalTerminal, startClaudeTerminalSession, steerChatMessage } from "../adeApi"; | ||
| import { cancelSteerMessage, createChatSession, DEFAULT_CODEX_REASONING_EFFORT, dispatchSteerMessage, discoverProjectSlashCommands, editSteerMessage, getAvailableModels, latestGoal, latestTokenStats, listLaneDiffStats, listPrsByLane, listTerminalSessions, sendChatMessage, signalTerminal, startClaudeTerminalSession, steerChatMessage } from "../adeApi"; | ||
| import type { AdeCodeConnection } from "../types"; | ||
|
|
||
| const tmpPaths: string[] = []; | ||
|
|
@@ -232,6 +232,51 @@ describe("discoverProjectSlashCommands", () => { | |
| expect.objectContaining({ name: "/ship" }), | ||
| ])); | ||
| }); | ||
|
|
||
| it("includes Cursor command files and subagents", () => { | ||
| const projectRoot = makeTmpRoot("ade-code-cursor-command-"); | ||
| const commandsDir = path.join(projectRoot, ".cursor", "commands"); | ||
| const agentsDir = path.join(projectRoot, ".cursor", "agents"); | ||
| fs.mkdirSync(commandsDir, { recursive: true }); | ||
| fs.mkdirSync(agentsDir, { recursive: true }); | ||
| fs.writeFileSync(path.join(commandsDir, "review-code.md"), "Review code.\n"); | ||
| fs.writeFileSync(path.join(agentsDir, "verifier.md"), [ | ||
| "---", | ||
| "description: Verify the change", | ||
| "---", | ||
| "", | ||
| "Verify.", | ||
| "", | ||
| ].join("\n")); | ||
|
|
||
| const commands = discoverProjectSlashCommands(projectRoot); | ||
| expect(commands).toEqual(expect.arrayContaining([ | ||
| expect.objectContaining({ name: "/review-code", description: "Review code." }), | ||
| expect.objectContaining({ name: "/verifier", description: "Verify the change" }), | ||
| ])); | ||
| }); | ||
|
Comment on lines
+236
to
+257
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add dual-path ADE CLI verification for these new API behaviors. These tests validate payload wiring, but they don’t verify the required headless mode and desktop socket-backed ADE RPC paths. Please add one assertion path per mode for these added behaviors to prevent transport-specific regressions. As per coding guidelines, "For ADE CLI changes, verify both headless mode and the desktop socket-backed ADE RPC path". Also applies to: 260-279 🤖 Prompt for AI Agents |
||
| }); | ||
|
|
||
| describe("getAvailableModels", () => { | ||
| it("activates dynamic Cursor model discovery for TUI model lists", async () => { | ||
| const calls: Array<{ domain: string; action: string; args?: Record<string, unknown> }> = []; | ||
| const connection = { | ||
| action: vi.fn(async (domain: string, action: string, args?: Record<string, unknown>) => { | ||
| calls.push({ domain, action, args }); | ||
| return []; | ||
| }), | ||
| } as any; | ||
|
|
||
| await getAvailableModels(connection, "cursor"); | ||
|
|
||
| expect(calls).toEqual([ | ||
| { | ||
| domain: "chat", | ||
| action: "getAvailableModels", | ||
| args: { provider: "cursor", activateRuntime: true }, | ||
| }, | ||
| ]); | ||
| }); | ||
| }); | ||
|
|
||
| describe("createChatSession", () => { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reject contradictory include-in-pr flags
Passing both
--include-in-prand--no-include-in-prcurrently succeeds and silently picks the later assignment. Please fail fast on conflicting flags to avoid ambiguous CLI behavior.Suggested fix
📝 Committable suggestion
🤖 Prompt for AI Agents