Skip to content

feat(integration): put the user's own coding agent first in the picker - #52

Merged
justinhelmer merged 2 commits into
mainfrom
feat/code-agent-priority
Aug 20, 2026
Merged

feat(integration): put the user's own coding agent first in the picker#52
justinhelmer merged 2 commits into
mainfrom
feat/code-agent-priority

Conversation

@justinhelmer

Copy link
Copy Markdown
Contributor

polylane setup already persists the user's primary local agent as config.agent, but integration connect never used that signal. Now, when that id also exists as a cloud code-agent integration, the picker:

  • moves it to the front of the code-agent group (category grouping preserved)
  • hints it as API key · your coding agent
  • pre-highlights it (promptSelectOrBack gained an optional initialValue, threaded to clack)

Exact id match only — no fuzzy mapping — so today this fires for cursor and 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

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 prioritizeCodeAgent leaves its input unmutated — TYPE_OPTIONS is module-shared (success label and --type help), 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

Comment thread test/integration-connect-priority.test.ts
Comment thread src/commands/integration/connect.ts Outdated

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Justin Helmer and others added 2 commits August 19, 2026 18:05
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>
@justinhelmer
justinhelmer force-pushed the feat/code-agent-priority branch from f9430d4 to 784bfe5 Compare August 20, 2026 01:06
@justinhelmer
justinhelmer merged commit 41cb322 into main Aug 20, 2026
3 checks passed
@justinhelmer
justinhelmer deleted the feat/code-agent-priority branch August 20, 2026 01:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant