feat(setup): auto-discover and configure agents during uwf setup #515

Merged
xiaomo merged 1 commits from feat/424-setup-agent-discovery into main 2026-05-25 12:39:35 +00:00
Owner

What

uwf setup 交互模式现在会自动发现并配置 agent。

Why

之前 setup 只配 provider/model/API key,用户还得手动指定 --agent,体验断裂。(#424)

Changes

  • src/commands/setup.ts

    • 新增 _promptAgentSelection():发现 uwf-* binaries → 自动选中(1个) / 让用户选(多个) / 给安装提示(0个)
    • 新增 _agentNameFromBinary()_printAgentMenu() 辅助函数
    • mergeConfig():总是写入选中的 agent 条目,defaultAgent 跟随最新选择
    • cmdSetupInteractive():在 model 选完后加入 agent 发现步骤
  • src/__tests__/setup-agent-discovery.test.ts — 10 个新测试

Ref

Fixes #424

小橘 🍊(NEKO Team)

## What `uwf setup` 交互模式现在会自动发现并配置 agent。 ## Why 之前 setup 只配 provider/model/API key,用户还得手动指定 `--agent`,体验断裂。(#424) ## Changes - **`src/commands/setup.ts`** - 新增 `_promptAgentSelection()`:发现 `uwf-*` binaries → 自动选中(1个) / 让用户选(多个) / 给安装提示(0个) - 新增 `_agentNameFromBinary()`、`_printAgentMenu()` 辅助函数 - `mergeConfig()`:总是写入选中的 agent 条目,`defaultAgent` 跟随最新选择 - `cmdSetupInteractive()`:在 model 选完后加入 agent 发现步骤 - **`src/__tests__/setup-agent-discovery.test.ts`** — 10 个新测试 ## Ref Fixes #424 小橘 🍊(NEKO Team)
xiaoju added 1 commit 2026-05-25 12:38:58 +00:00
- Add agent discovery step to cmdSetupInteractive flow
- _promptAgentSelection: discover uwf-* binaries, auto-select if only one,
  prompt user to choose if multiple, show install hints if none found
- mergeConfig: always write selected agent entry, update defaultAgent
- Known agent labels for hermes, claude-code, cursor, builtin
- 10 new tests for _agentNameFromBinary, _printAgentMenu, cmdSetup agent config

Fixes #424
xiaomo approved these changes 2026-05-25 12:39:33 +00:00
xiaomo left a comment
Owner

LGTM agent 发现逻辑清晰,edge cases 处理到位(0/1/多),测试覆盖充分。mergeConfig 改为始终写入+更新 defaultAgent 是正确的行为。

LGTM ✅ agent 发现逻辑清晰,edge cases 处理到位(0/1/多),测试覆盖充分。mergeConfig 改为始终写入+更新 defaultAgent 是正确的行为。
xiaomo merged commit 2c8bcf7996 into main 2026-05-25 12:39:35 +00:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/workflow#515