Add cursor agent support, reject unknown agents, fix ACP alias collision#430
Add cursor agent support, reject unknown agents, fix ACP alias collision#430
Conversation
GetAvailable() now returns an error for unrecognized agent names (typos like "claud") instead of silently falling back. Known-but- unavailable agents (binary not installed) still fall back as before. Fix isConfiguredACPAgentName() to use exact comparison instead of alias-resolved comparison, preventing the "agent" → "cursor" alias from incorrectly matching ACP config when acp.name = "agent". Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…test Make TestGetAvailableFallsBackForKnownUnavailable deterministic by isolating the registry and PATH instead of relying on ambient state. Add TestACPNameDoesNotMatchCanonicalRequest to lock the contract that acp.name="claude" matches request "claude" but not "claude-code". Add clarifying comment to isConfiguredACPAgentName explaining exact match semantics. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Append .exe on Windows so exec.LookPath resolves the stub binary via PATHEXT, matching the pattern used in other agent tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add UnknownAgentError typed error so callers can distinguish typos (bad request) from genuinely unavailable agents (service unavailable). Server enqueue and fix endpoints now return 400 with "invalid agent" for unknown names instead of 503 with "no review agent available". Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
7de28c4 to
e55336c
Compare
roborev: Combined Review (
|
|
"Invalid. The file compiles cleanly and the test passes. The reviewer's agents are mangling Go escape sequences
Not sure what is up with github actions, I'll see if it comes back on later |
Add TestHandleFixJobAgentAvailability covering the 400/503 split in handleFixJob: unknown fix agent returns 400, no agents returns 503. Replace unnecessary fmt.Errorf().Error() with fmt.Sprintf in UnknownAgentError.Error() to avoid allocating a throwaway error. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
e55336c to
5c15163
Compare
roborev: Combined Review (
|
TestSelectRefineAgentCodexFallbackUsesRequestedReasoning was passing "nonexistent-agent" which now correctly errors. Use "gemini" (a registered but unavailable agent) to test the fallback path. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
roborev: Combined Review (
|
|
"No, same false positive as before. The review agents are interpreting Go escape sequences (", \n, $@) instead of |
Summary
"agent"CLI binary and"agent" → "cursor"alias--agent claud) with a clear error listing known agents, instead of silently falling back to a different agentacp.name = "agent"would incorrectly intercept cursor requests via alias resolution —isConfiguredACPAgentNamenow uses exact matching on the raw (pre-alias) nameUnknownAgentErrorso HTTP handlers can distinguish the two cases🤖 Generated with Claude Code