Skip to content

refactor: remove the primary coding agent question and stored preference - #62

Open
claude[bot] wants to merge 1 commit into
mainfrom
claude/remove-coding-agent-question
Open

refactor: remove the primary coding agent question and stored preference#62
claude[bot] wants to merge 1 commit into
mainfrom
claude/remove-coding-agent-question

Conversation

@claude

@claude claude Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Requested by Justin Helmer · Slack thread

Before: setup asked "Which coding agent do you mainly use?" (or silently persisted a single detected agent), stored the answer as agent in ~/.polylane/config.json (also settable via POLYLANE_AGENT / config set --key agent), and that choice drove polylane map's agent pick and your-agent-first ordering in the integration connect picker.

After: setup never asks and never stores a preference. polylane map resolves its agent from the --agent flag, the only installed agent, or a map-time prompt — falling back to any runnable installed agent when non-interactive. The integration connect picker uses plain catalog order. Legacy agent fields in existing config files are silently ignored (no migration; the loader keeps tolerating unknown keys).

How: deleted settlePrimaryAgent/decidePrimaryAgent from src/commands/setup.ts and prioritizeCodeAgent from src/commands/integration/connect.ts; removed the agent field from Config/RawConfig, the loader's POLYLANE_AGENT ?? file.agent load, the config set/config show handling, and config.agent from map's precedence. isAgentId/validateAgentId in src/agents/registry.ts were left orphaned by this and removed too (map/setup --agent flags validate via agentById/the registry set as before). Tests: dropped the decidePrimaryAgent and prioritizeCodeAgent suites, and reworked test/loader.test.ts onto an isolated temp $HOME with a new test proving a config file carrying a legacy agent key still loads cleanly.

Validation: typecheck, lint, full test suite (317 pass / 0 fail), and build + smoke (config show, config set --key agent rejected with hint, setup dry-run, legacy-config load) all pass.


Generated by Claude Code

Setup no longer asks "Which coding agent do you mainly use?" nor silently
persists a single detected agent; the `agent` config key, POLYLANE_AGENT,
and every consumer are gone. `map` now resolves its agent from the --agent
flag, the only installed agent, or a map-time prompt (any runnable installed
agent when non-interactive); the `integration connect` picker keeps plain
catalog order. Legacy `agent` fields in existing config files are silently
ignored — no migration.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0188rapzBDdq1zvp7JYaxxpu

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

LGTM: clean removal of the primary-agent question/preference with no orphaned references or behavioral regressions found.

Verified against the checked-out head (f4f1221c, matches the PR API's head SHA):

  • Diff read hunk-by-hunk across all 12 changed files (+37/-216, matching the PR's reported stats exactly).
  • Reference sweep for every removed symbol — isAgentId, validateAgentId, prioritizeCodeAgent, decidePrimaryAgent, settlePrimaryAgent, PrimaryAgentDecision, config.agent/file.agent/POLYLANE_AGENT — grepped clean across src/ and test/. No dead imports, no orphaned exports. AGENT_IDS and typeOptionsForCategory remain in active use elsewhere (map.ts's own --agent validation, the category picker tests) so correctly left in place.
  • PR body claims checked against code: the described deletions in setup.ts, integration/connect.ts, agents/registry.ts, config/loader.ts/schema.ts all match the diff; map's new precedence (flag > sole installed agent > interactive pick, no more config.agent in the chain) matches src/commands/map.ts:167-181; the picker in integration/connect.ts now uses plain catalog order with no initialValue/prioritizeCodeAgent call, matching the claim.
  • Docs: README, AGENTS.md, ERRORS.md have no stale mentions of the removed agent config key or config set --key agent.
  • Local checks (npm ci, npm run codegen — live spec fetch to api.polylane.com succeeded, npm run typecheck, npm run lint, npm run test): all clean. Test suite: 317 pass / 0 fail / 72 suites, matching the PR body's reported count exactly. New test/loader.test.ts case for a legacy agent key in the config file passes and correctly asserts it's dropped (!('agent' in config)).
  • CI via GitHub API: all 3 check runs green — checks / Test & typecheck on Node 20.x, 22.x, and 24.x, all completed/success.
  • Backward compat: legacy agent field in an existing ~/.polylane/config.json is silently tolerated (loader ignores unknown keys; no throw), consistent with the "no migration" claim — verified by the new loader test and by inspection of writeConfigFile's merge behavior (a stray legacy key just rides along untouched, never surfaced).

Nit (non-blocking): map --agent's help text now reads "defaults to an installed agent," which slightly undersells the interactive-pick fallback when multiple agents are installed — could say "an installed agent, or a prompt when more than one is found" for precision, but this is cosmetic 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

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