feat(integration): the code-agent picker opens with an opt-in question - #50
Conversation
Interactive runs of --category code-agent get one short line of why (autofixes run on Polylane's executor by default; connecting your agent moves them to your account) and a yes/no before the picker. Declining exits cleanly. --type and non-interactive runs are unchanged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
0c0346d to
5ee46a7
Compare
There was a problem hiding this comment.
LGTM: opt-in gate verified by execution — decline exits 0 without a workspace, non-interactive/CI/piped stdin skip the offer with no hang, gate correctly scoped to interactive --category code-agent; CI 3/3 green and local typecheck/lint/tests pass at head.
What was verified (two-stage review — investigate + independent verify — at head 5ee46a7):
- Execution-based probes against the built binary: piped stdin and CI=1 with no workspace skip the offer and exit 2 with no hang (non-interactive behavior unchanged); TTY decline (
n) exits 0 with the pointer message and never hitsrequireWorkspace; accept default (Enter) proceeds to the workspace check as before; Ctrl+C and stdin EOF mid-prompt exit cleanly with no hang;--category observabilitygoes straight to the picker (gate correctly scoped); category typos still error (now slightly earlier — a small ordering improvement). - Every PR-body claim checked against code and behavior — all hold. One wording note: "silently reroutes" is slightly stale since the post-connect executor notice at connect.ts:542-544; body-only, no code impact.
- Local checks at head:
npm ci, codegen, typecheck, lint all clean; 271/271 tests pass; build smoke OK. CI 3/3 green (Node 20/22/24) at the same head. - Callers:
shouldOfferCodeAgentis new (execute() + the new test only);resolveTypeOptionssignature unchanged, other callers unaffected;promptConfirmOrBack/outroare pre-existing utilities with untouched call sites.
Findings are one Minor and two Nits, all inline and all non-blocking.
Informational, for merge ordering (not blocking): this PR overlaps with #52 (high textual conflict — both rewrite the same execute() lines around resolveTypeOptions, and #52's context assumes the old requireWorkspace ordering) and lightly with #48 (adjacent hunks only). Semantically all three are compatible — whichever lands last just rebases by hand.
Generated by Claude Code
| if (wants !== true) { | ||
| outro('Skipped. Connect later with `polylane integration connect --category code-agent`.'); | ||
| return; | ||
| } |
There was a problem hiding this comment.
Minor (non-blocking): Ctrl+C at the offer prompt is indistinguishable from an explicit "No" — promptConfirmOrBack maps the clack cancel to BACK (src/utils/prompt.ts:119), and wants !== true folds it into the decline path, printing the cheerful "Skipped. Connect later…" outro. Exit 0 on interrupt matches repo convention (cancel at the picker also exits 0 via cancel('Nothing connected.')), so only the message choice is debatable — an interrupt reading as a deliberate skip is worth a distinct, cancel()-styled message on BACK. Fine to ship as-is or as a follow-up.
Generated by Claude Code
| true | ||
| ); | ||
| if (wants !== true) { | ||
| outro('Skipped. Connect later with `polylane integration connect --category code-agent`.'); |
There was a problem hiding this comment.
Nit: this decline-path outro prints even with --quiet. Consistent with other clack output in the repo, so cosmetic at most.
Generated by Claude Code
| import assert from 'node:assert/strict'; | ||
| import { shouldOfferCodeAgent } from '../src/commands/integration/connect'; | ||
|
|
||
| describe('shouldOfferCodeAgent', () => { |
There was a problem hiding this comment.
Nit: nice coverage — these four tests exercise the pure gate (shouldOfferCodeAgent) across all its axes. The interactive prompt flow itself (note → confirm → skip/proceed) is untested, though the repo has no pty/e2e harness, so that matches existing convention. Noting for completeness only.
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
Interactive
polylane integration connect --category code-agentnow always opens with an offer instead of dropping users straight into a picker (no flag needed — per review feedback, the earlier--offerflag guarded an invocation nothing uses yet):Notes:
requireWorkspace, so declining never errors on a missing workspace.--typeskips the offer (the user already decided), as do non-interactive runs — today's behavior there is unchanged.🤖 Generated with Claude Code