feat(cli): 支持查看可用 Agent 配置 - #980
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
变更说明
featureyuxi agent list与yuxi agent show <slug>,让登录用户发现当前可调用的主 Agent,并查看服务端按角色过滤后的模型、Skills、提示词、工具等配置;不新增管理能力、不复制后端权限规则、不改变 Agent 运行语义。工程主张与 Owner
agent list只展示当前用户可见的主 Agent,并标识服务端给出的默认 Agent。可见性和默认顺序由GET /api/agent、AgentRepository.list_visible拥有,CLI 只渲染响应。agent show <slug>只展示GET /api/agent/{slug}授权后返回的配置;不存在或无权访问继续由后端返回 404,CLI 不调用管理接口、不自行扩大资源范围。--json输出可直接被脚本解析的无 ANSI 原始 JSON;人类可读模式区分资源默认范围与显式空列表,并保留未知配置字段。/api/system/discovery的cli.agent_list/cli.agent_show声明兼容性;旧服务端缺少能力时显式拒绝。docs/develop-guides/decisions/implemented/2026-08-27-cli-agent-inspection.md验证情况
当前用户可发现可见 Agent 与默认标识
GET /api/agent、yuxi_cli.agent.run_agent_listcd packages/yuxi-cli && UV_PYTHON=3.13 uv run --group test pytest -qcli.agent_list、畸形 payload、空列表、包含 Rich 标记的远端名称。可查看授权后的 Agent 详细配置
GET /api/agent/{slug}、yuxi_cli.agent.run_agent_showtest_chat_router.py::test_agent_detail_filters_configurable_items_by_role;隐藏 Agent 真实 HTTP 探针。cli.agent_show、Agent/config/context 畸形、服务端 404、强制终端环境下 JSON 解析。服务端声明 CLI 查询能力
backend/server/routers/system_router.pycd backend && UV_PYTHON=3.13 uv run --group test pytest test/unit -m "not slow"工程契约与用户文档保持可验证
docs/intro/cli.mdpython3 scripts/verify_engineering_contracts.py;python3 -m unittest scripts.test_verify_engineering_contracts;cd docs && pnpm run build简化 / 删除验收
不涉及。本变更复用现有认证 Agent API 与 repository 可见性 Owner,没有新增 CLI 专用路由、权限副本、配置项或兼容层。
独立语义 Review
全新上下文 Reviewer 覆盖了 xhome #54 需求、完整 diff、Agent 资源选择语义、授权/404 负向证据与测试结果。首次发现空列表语义需要按字段区分、详情 payload/404 负向证据不足,均已修复;最终定点复核确认原始 JSON 无 ANSI 且可解析,结论为无发现、无未解决项。
未验证范围与风险
/usr/local/lib/python3.13/site-packages/__editable__.yuxi-0.7.2b2.pth无删除权限而无法同步;--no-syncfallback 在当前主工作区容器基线上为 1569 passed、40 skipped,不作为本工作树改动的替代证据。ruff check src tests命中既有 PYI034、PIE810、B008 等基线问题;本次新增 Agent 实现与测试的定点uvx ruff format/check已 Passed。事故反馈
不涉及高影响逃逸缺陷;这是新增可发现性能力。
界面变更
不涉及 Web 界面;仅新增终端表格与 JSON 输出。
关联事项
xhome #54 Yuxi-CLI。
补充说明
无数据迁移和配置迁移。Agent 可见性及角色过滤继续由后端现有接口拥有。