Conversation
|
No findings. The PR description documents sufficient testing, including representative real-CLI/PTY verification for the runtime behavior change. The previously failing tests are clearly identified as pre-existing. |
|
Please resolve the conflicts |
|
Merged Conflict: import { askConfirmation, askQuestion, askSecret, isInteractive, parseSelection, readStdin } from './utils/prompt.js';
Re-verified after the merge: |
|
No findings. The earlier “No findings” result remains valid. The PR description documents sufficient testing, including representative real-CLI/PTY verification for the runtime behavior change and identification of unrelated pre-existing failures. |
…encent#919) `models switch` required a profile name, so a member who did not remember the exact id had to run `models list` first and retype one. The profile is now optional: with none given, `switch` lists every profile — team ones first, then personal, the order `models list` uses — and switches the one picked. The pick is single, because `switch` points each agent at exactly one gateway. An answer naming several is asked again with the reason, not silently narrowed to the first. Non-interactive runs still require the profile, so a hook or CI run can never land an agent on a gateway by accident. Backward compatible: `models switch <profile>` is unchanged. Verified with the built CLI through a real pty: pick, multi-answer re-prompt, `none` cancel, no-terminal refusal, explicit profile, `--dry-run`. Docs updated in both languages, plus a `vi.clearAllMocks()` in the models test's beforeEach for the new log.warn assertions.
701e4ef to
4244bdf
Compare
|
No findings. The earlier “No findings” reviews remain valid. The PR description documents sufficient testing, including representative real-CLI/PTY verification for the runtime behavior change and clearly identified pre-existing test failures. |
Closes #919.
What
teamai models switchrequired a profile name, so a member who did notremember the exact id had to run
models listfirst, read the ids, thenretype one.
The profile is now optional. With none given,
switchlists every profile —team ones first, then personal, the order
models listalready uses — andswitches the one picked:
Behaviour
Single pick.
switchpoints each agent at exactly one gateway (Claude'ssettings.jsonholds a singleANTHROPIC_BASE_URL; the manifest records oneprofile per agent), so an answer naming several has nothing meaningful to do
with the extras. Rather than silently take the first, the prompt says why and
asks again:
An unusable answer is re-asked the same way. This is deliberately unlike
init/push, where selecting several items is meaningful and the promptadvertises the syntax.
none(or0) cancels: printsCancelled, changes nothing, exits 0.Non-interactive runs still require the profile. With no terminal there is
nothing to pick from, so the command fails and names the argument rather than
guessing — a hook or CI run must never land an agent on a gateway by accident.
The one-profile case is not auto-selected, for the same reason.
Naming a profile behaves exactly as before;
models switch <profile>isunchanged and backward compatible.
Scope is
switchonly —models add/configure/removekeep their requiredarguments. No new subcommand:
[profile]also matchesmodels list [profile],and adding an optional argument needs no second entry point for one action.
Implementation notes
chooseProfileresolves the profile (named, or picked) andfindProfilenowalso accepts an already-resolved
ProfileRef, so both paths run through onecode path — the team identity stamping, key loading and the legacy-values
checks stay identical whichever way the profile arrived.
askQuestion+parseSelectionrather than usingaskSelection: the latter returnsnullfor both "cancelled" and "unusableanswer", and the two need different handling now that one of them re-prompts.
models-cmd.test.tsgainedvi.clearAllMocks()inbeforeEach, because thenew cases assert on
log.warncall counts and would otherwise see theprevious test's calls. Existing cases are unaffected.
Verification
npx tsc --noEmitandnpm run lintclean; full suite 5496 passed. Threepush-env.test.tscases fail, and I confirmed they fail identically on the basecommit (
3a9a24a) without this change — pre-existing and unrelated.Built CLI driven through a real pty (
isInteractive()is false under a pipe, sothe picker needs one):
2switched claude switched to local:mirror1,2, then1banana, then9, then2noneℹ Cancelled, settings untouchedteamai models switch <profile>, exit 1--dry-runwrites nothing in either form (manifest andsettings.jsonunchanged after a preview).
Docs updated in both languages (
docs/usage-guide.md,docs/usage-guide.zh-CN.md);skill-data/core/references/commands.mdregenerated.