Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go

fix(agent/cursor): remove obsolete 'chat' subcommand from argv (#3077) (#3092)

Kaguraf02bc56e70e8
diff --git a/server/pkg/agent/cursor.go b/server/pkg/agent/cursor.go
index e5f1acf5fd..f2bfa26e37 100644
--- a/server/pkg/agent/cursor.go
+++ b/server/pkg/agent/cursor.go
@@ -396,12 +396,11 @@ var cursorBlockedArgs = map[string]blockedArgMode{
// buildCursorArgs assembles the argv for a one-shot cursor-agent invocation.
//
-// Usage: cursor-agent chat -p <prompt> --output-format stream-json
+// Usage: cursor-agent -p <prompt> --output-format stream-json
//
// --workspace <cwd> --yolo [--model <m>] [--resume <id>]
func buildCursorArgs(prompt string, opts ExecOptions, logger *slog.Logger) []string {
args := []string{
- "chat",
"-p", prompt,
"--output-format", "stream-json",
"--yolo",
diff --git a/server/pkg/agent/cursor_invocation_test.go b/server/pkg/agent/cursor_invocation_test.go
index ecd16d2f2e..316d1b8d21 100644
--- a/server/pkg/agent/cursor_invocation_test.go
+++ b/server/pkg/agent/cursor_invocation_test.go
@@ -18,7 +18,7 @@ func TestChooseCursorInvocation_PassthroughForNonLauncher(t *testing.T) {
execName := "cursor-agent"
lookedUp := filepath.Join(t.TempDir(), "cursor-agent") // no .cmd / .bat
- args := []string{"chat", "-p", "hello\nworld", "--output-format", "stream-json", "--yolo"}
+ args := []string{"-p", "hello\nworld", "--output-format", "stream-json", "--yolo"}
gotExec, gotArgs := chooseCursorInvocation(execName, lookedUp, args, logger)
diff --git a/server/pkg/agent/cursor_invocation_windows_test.go b/server/pkg/agent/cursor_invocation_windows_test.go
index e43c26a740..c55b2afe84 100644
--- a/server/pkg/agent/cursor_invocation_windows_test.go
+++ b/server/pkg/agent/cursor_invocation_windows_test.go
@@ -45,7 +45,6 @@ func TestPlatformCursorInvocation_RewritesCmdLauncherToPowerShellFile(t *testing
stubPowerShell(t, fakePS, true)
args := []string{
- "chat",
"-p", "line1\nline2\nline3",
"--output-format", "stream-json",
"--yolo",
@@ -84,7 +83,7 @@ func TestPlatformCursorInvocation_SkipsWhenNotCmdOrBat(t *testing.T) {
stubPowerShell(t, filepath.Join(dir, "powershell.exe"), true)
logger := slog.New(slog.NewTextHandler(io.Discard, nil))
- if _, _, ok := platformCursorInvocation(exePath, []string{"chat"}, logger); ok {
+ if _, _, ok := platformCursorInvocation(exePath, []string{"-p", "hello"}, logger); ok {
t.Fatalf("expected ok=false for non-.cmd/.bat launcher")
}
}
@@ -101,7 +100,7 @@ func TestPlatformCursorInvocation_SkipsWhenPS1Missing(t *testing.T) {
stubPowerShell(t, filepath.Join(dir, "powershell.exe"), true)
logger := slog.New(slog.NewTextHandler(io.Discard, nil))
- if _, _, ok := platformCursorInvocation(cmdPath, []string{"chat"}, logger); ok {
+ if _, _, ok := platformCursorInvocation(cmdPath, []string{"-p", "hello"}, logger); ok {
t.Fatalf("expected ok=false when cursor-agent.ps1 is missing")
}
}
@@ -119,7 +118,7 @@ func TestPlatformCursorInvocation_SkipsWhenPowerShellMissing(t *testing.T) {
stubPowerShell(t, "", false)
logger := slog.New(slog.NewTextHandler(io.Discard, nil))
- if _, _, ok := platformCursorInvocation(cmdPath, []string{"chat"}, logger); ok {
+ if _, _, ok := platformCursorInvocation(cmdPath, []string{"-p", "hello"}, logger); ok {
t.Fatalf("expected ok=false when no powershell host is available")
}
}
diff --git a/server/pkg/agent/cursor_test.go b/server/pkg/agent/cursor_test.go
index 9390885c41..e63af50ec7 100644
--- a/server/pkg/agent/cursor_test.go
+++ b/server/pkg/agent/cursor_test.go
@@ -27,7 +27,6 @@ func TestBuildCursorArgs(t *testing.T) {
}, slog.Default())
expected := []string{
- "chat",
"-p", "do something",
"--output-format", "stream-json",
"--yolo",
@@ -67,7 +66,7 @@ func TestBuildCursorArgsMinimal(t *testing.T) {
t.Parallel()
args := buildCursorArgs("hello", ExecOptions{}, slog.Default())
- expected := []string{"chat", "-p", "hello", "--output-format", "stream-json", "--yolo"}
+ expected := []string{"-p", "hello", "--output-format", "stream-json", "--yolo"}
if len(args) != len(expected) {
t.Fatalf("expected %d args, got %d: %v", len(expected), len(args), args)