refactor: remove the primary coding agent question and stored preference - #62
refactor: remove the primary coding agent question and stored preference#62claude[bot] wants to merge 1 commit into
Conversation
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
There was a problem hiding this comment.
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 acrosssrc/andtest/. No dead imports, no orphaned exports.AGENT_IDSandtypeOptionsForCategoryremain in active use elsewhere (map.ts's own--agentvalidation, 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.tsall match the diff;map's new precedence (flag > sole installed agent > interactive pick, no moreconfig.agentin the chain) matchessrc/commands/map.ts:167-181; the picker inintegration/connect.tsnow uses plain catalog order with noinitialValue/prioritizeCodeAgentcall, matching the claim. - Docs: README, AGENTS.md, ERRORS.md have no stale mentions of the removed
agentconfig key orconfig set --key agent. - Local checks (
npm ci,npm run codegen— live spec fetch toapi.polylane.comsucceeded,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. Newtest/loader.test.tscase for a legacyagentkey 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 & typecheckon Node 20.x, 22.x, and 24.x, allcompleted/success. - Backward compat: legacy
agentfield in an existing~/.polylane/config.jsonis silently tolerated (loader ignores unknown keys; no throw), consistent with the "no migration" claim — verified by the new loader test and by inspection ofwriteConfigFile'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
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
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
agentin~/.polylane/config.json(also settable viaPOLYLANE_AGENT/config set --key agent), and that choice drovepolylane map's agent pick and your-agent-first ordering in theintegration connectpicker.After: setup never asks and never stores a preference.
polylane mapresolves its agent from the--agentflag, the only installed agent, or a map-time prompt — falling back to any runnable installed agent when non-interactive. Theintegration connectpicker uses plain catalog order. Legacyagentfields in existing config files are silently ignored (no migration; the loader keeps tolerating unknown keys).How: deleted
settlePrimaryAgent/decidePrimaryAgentfromsrc/commands/setup.tsandprioritizeCodeAgentfromsrc/commands/integration/connect.ts; removed theagentfield fromConfig/RawConfig, the loader'sPOLYLANE_AGENT ?? file.agentload, theconfig set/config showhandling, andconfig.agentfrom map's precedence.isAgentId/validateAgentIdinsrc/agents/registry.tswere left orphaned by this and removed too (map/setup--agentflags validate viaagentById/the registry set as before). Tests: dropped thedecidePrimaryAgentandprioritizeCodeAgentsuites, and reworkedtest/loader.test.tsonto an isolated temp$HOMEwith a new test proving a config file carrying a legacyagentkey still loads cleanly.Validation: typecheck, lint, full test suite (317 pass / 0 fail), and build + smoke (
config show,config set --key agentrejected with hint, setup dry-run, legacy-config load) all pass.Generated by Claude Code