Skip to content

feat(integration): the code-agent picker opens with an opt-in question - #50

Merged
justinhelmer merged 1 commit into
mainfrom
feat/code-agent-offer
Aug 20, 2026
Merged

feat(integration): the code-agent picker opens with an opt-in question#50
justinhelmer merged 1 commit into
mainfrom
feat/code-agent-offer

Conversation

@justinhelmer

@justinhelmer justinhelmer commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Interactive polylane integration connect --category code-agent now always opens with an offer instead of dropping users straight into a picker (no flag needed — per review feedback, the earlier --offer flag guarded an invocation nothing uses yet):

  1. one short line of why: "Optional. Polylane runs autofixes on its own executor; connect your coding agent to run them in your account instead."
  2. "Connect a cloud coding agent?" (default Yes)
  3. Yes → the existing code-agent picker; No → clean exit 0 with a pointer to come back later

Notes:

  • The offer runs before requireWorkspace, so declining never errors on a missing workspace.
  • --type skips the offer (the user already decided), as do non-interactive runs — today's behavior there is unchanged.
  • Connecting a code agent silently reroutes autofix execution to it (since feat(integration): connecting a coding agent always becomes the autofix executor #39), which is why this step explains itself in one line rather than none.

🤖 Generated with Claude Code

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>
@justinhelmer
justinhelmer force-pushed the feat/code-agent-offer branch from 0c0346d to 5ee46a7 Compare August 20, 2026 00:40
@justinhelmer justinhelmer changed the title feat(integration): --offer asks before the code-agent picker feat(integration): the code-agent picker opens with an opt-in question Aug 20, 2026

@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: 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 hits requireWorkspace; accept default (Enter) proceeds to the workspace check as before; Ctrl+C and stdin EOF mid-prompt exit cleanly with no hang; --category observability goes 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: shouldOfferCodeAgent is new (execute() + the new test only); resolveTypeOptions signature unchanged, other callers unaffected; promptConfirmOrBack/outro are 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

Comment on lines +643 to +646
if (wants !== true) {
outro('Skipped. Connect later with `polylane integration connect --category code-agent`.');
return;
}

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.

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`.');

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.

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', () => {

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.

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

@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

@justinhelmer
justinhelmer merged commit fa1709e into main Aug 20, 2026
4 checks passed
@justinhelmer
justinhelmer deleted the feat/code-agent-offer branch August 20, 2026 01:03
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