feat(integration): put the user's own coding agent first in the picker - #52
Conversation
There was a problem hiding this comment.
LGTM: verified by execution — the picker front-loads and pre-highlights Cursor when config.agent === 'cursor' (PTY run: initial marker on Cursor (API key · your coding agent), Enter picks it), stale/unknown ids drop to undefined in the loader (isAgentId) so the worst case really is today's unprioritized list, ordering of all other options is untouched, and the registry∩picker overlap is exactly {cursor}. CI green at 3584207 across Node 20/22/24 and reproduced locally (typecheck and lint clean, 276/276 tests passing on Node 22).
Non-blocking notes (details inline):
- (Minor, test gap) Nothing asserts
prioritizeCodeAgentleaves its input unmutated —TYPE_OPTIONSis module-shared (success label and--typehelp), and an in-place-splice implementation would pass the current suite. Consider snapshotting the input in the test or freezing the fixture. - (Nit) The hint hardcodes the
API key ·prefix instead of deriving from the option's hint — accurate for cursor today, could drift if a non-API-key code-agent ever overlaps. - (Heads-up, coordination) #50 rewrites the same
execute()prologue lines — a trivial but guaranteed merge conflict for whichever lands second; worth a re-run of the suite after resolving.
Generated by Claude Code
There was a problem hiding this comment.
Auto-approved: Claude reviewed this PR and posted an LGTM verdict (see its review). A repo admin enabled this via the auto-approve workflow.
Generated by Claude Code
config.agent (persisted by setup) is matched against the code-agent integration types; on a hit that option moves to the front of its category, gets a 'your coding agent' hint, and is pre-highlighted. Exact id match only, so today this fires for cursor. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ted; derive the hint Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
f9430d4 to
784bfe5
Compare
polylane setupalready persists the user's primary local agent asconfig.agent, butintegration connectnever used that signal. Now, when that id also exists as a cloud code-agent integration, the picker:API key · your coding agentpromptSelectOrBackgained an optionalinitialValue, threaded to clack)Exact id match only — no fuzzy mapping — so today this fires for
cursorand is a no-op for everyone else. If the ids ever diverge, the worst case is the unprioritized list we ship today.🤖 Generated with Claude Code