feat(web-shell): add workspace agent management - #7572
Conversation
|
Thanks for the PR! Template looks good ✓ Problem: This is a feature addition, not a bug fix — the motivation is clear: agent management was previously coupled to the chat modal and lacked a complete workspace-scoped management experience. The gap is real for Web Shell users who manage agents outside an active chat session. Direction: Aligned with the existing Web Shell pattern — MCP, Extensions, Skills, and Plugins all have dedicated manager pages, so adding one for Agents is a natural extension. Worth noting: Claude Code recently removed their Size: Cross-package change (acp-bridge, cli, sdk-typescript, web-shell, webui). Production logic: ~3,960 additions + ~2,030 deletions = ~5,990 lines (excluding tests: ~740 lines, docs: 77 lines). This is a large PR — splitting the daemon/SDK changes from the UI pages might have made review easier, but the feature is coherent as-is. Flagging for maintainer awareness per the 500+ production-line threshold. Approach: The scope feels right for a full-stack management feature — daemon routes gain validation and MCP secret restoration, SDK types expand to match, and the UI gets proper CRUD pages with generation support. The removal of the old Moving on to code review. 🔍 中文说明感谢贡献! 模板完整 ✓ 问题:这是一个功能新增,不是 bug 修复——动机清晰:智能体管理此前与聊天弹窗耦合,缺乏完整的工作区级管理体验。对于在活跃聊天会话之外管理智能体的 Web Shell 用户来说,这个缺口是真实存在的。 方向:与现有 Web Shell 模式一致——MCP、扩展、技能和插件都有独立管理页面,为智能体添加管理页面是自然延伸。值得注意的是:Claude Code 最近移除了 规模:跨包变更(acp-bridge、cli、sdk-typescript、web-shell、webui)。生产逻辑:约 3,960 行新增 + 约 2,030 行删除 = 约 5,990 行(不含测试:约 740 行,文档:77 行)。这是一个大型 PR——将 daemon/SDK 变更与 UI 页面拆分可能使审查更容易,但该功能本身是自洽的。按 500+ 生产行阈值标记供维护者关注。 方案:对于全栈管理功能来说范围合理——daemon 路由增加了验证和 MCP 密钥恢复,SDK 类型相应扩展,UI 获得了带生成支持的完整 CRUD 页面。移除旧的 进入代码审查 🔍 — Qwen Code · qwen3.8-max-preview Reviewed at |
🖼️ web-shell visual previewRendered against a mock daemon (no real backend): the PR base vs this PR head Screenshots · before / afterFull-resolution recordings (.webm) are attached to the workflow run. — Qwen Code · web-shell visuals |
🩺 serve daemon A/BBuilt the PR base vs this PR head ✅ No response changes against the PR base across 4 scenario(s). — Qwen Code · serve A/B |
Code ReviewIndependent proposal: For workspace agent management, I would extend the existing daemon agent routes with scope-aware CRUD, add validation for the new frontmatter fields (color, maxTurns, permissionMode, mcpServers, hooks), update SDK types to match, and build a dedicated AgentsManagerPage following the existing manager-page pattern (MCP, Extensions, Skills, Plugins). The old chat-modal agent UI would be removed. Comparison with the diff: The PR matches this approach closely and goes further in good ways — a shared No critical blockers found. The code follows project conventions (ESM, shared UI primitives, collocated tests, CSS Modules for scoped styles). The One observation (non-blocking): Files changed (30 of 34 shown)
Real-Scenario Testingtmux is not available in this CI environment, so I tested the daemon API directly via Unit tests: All pass.
TypeScript typecheck: All three changed packages (cli, web-shell, sdk-typescript) pass 中文说明代码审查独立方案: 对于工作区智能体管理,我会扩展现有 daemon 智能体路由以支持作用域感知的 CRUD,为新 frontmatter 字段(color、maxTurns、permissionMode、mcpServers、hooks)添加验证,更新 SDK 类型,并按照现有管理页面模式(MCP、扩展、技能、插件)构建独立的 AgentsManagerPage。旧的聊天弹窗智能体 UI 将被移除。 与 diff 对比: PR 与此方案高度一致,并在以下方面做得更好——共享的 未发现关键阻塞项。代码遵循项目规范。 实际场景测试本 CI 环境无 tmux,通过 — Qwen Code · qwen3.8-max-preview Reviewed at |
|
Confidence: 3/5 — clean review across every stage, but the cross-package size (~5,990 production lines across 5 packages) triggered the Stage 0 maintainer-awareness threshold, so this needs a human sign-off before merging. This is a well-executed feature PR. The daemon API gains proper validation and MCP secret handling, the SDK types expand cleanly, and the Web Shell gets a full agent management experience that follows the established manager-page pattern. The before/after is clear: agents go from a constrained chat modal to dedicated list, detail, create, and edit pages with responsive layout and generation support. The code is straightforward and well-structured — logic extraction into No critical issues found. The only non-blocking observation is that Deferring to a maintainer because the cross-package scope and production-line count exceed the auto-approve threshold — not because of any concern about the code quality. 中文说明置信度:3/5 — 每个阶段审查都很干净,但跨包规模(约 5,990 行生产代码,横跨 5 个包)触发了 Stage 0 维护者关注阈值,需要人工确认后才能合并。 这是一个执行良好的功能 PR。daemon API 获得了适当的验证和 MCP 密钥处理,SDK 类型干净地扩展,Web Shell 获得了完整的智能体管理体验,遵循既有的管理页面模式。代码结构良好,测试覆盖充分(387 项测试通过)。daemon API CRUD 生命周期已端到端验证。 未发现关键问题。唯一的非阻塞观察是 转交维护者是因为跨包范围和生产行数超过了自动批准阈值——不是因为代码质量有任何问题。 — Qwen Code · qwen3.8-max-preview Reviewed at |
|
⏸️ Deferring to @wenshao — this PR is a clean, well-tested feature addition (workspace agent management for Web Shell), but it spans 5 packages with ~5,990 production lines, which exceeds the auto-approve threshold for cross-package changes. The code review found no blockers; a maintainer's sign-off on the scope and direction is all that's needed. |
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
[Critical] Critical: handleAgentGet in workspaceWrite.ts does not forward args.scope to getWorkspaceAgent — the MCP bridge's get action silently drops the scope parameter while create/update/delete all correctly forward it. When a user-level and project-level agent share a name, MCP clients cannot retrieve the scoped version.
— qwen3.7-max via Qwen Code /review
|
Addressed the completed review findings in |
✅ Local build & real-test verification — merge referenceVerified head 1. Automated tests — all green
2. Live daemon E2E — real binary, real HTTP, real files on diskBooted the built daemon (
(One assertion was a harness path guess — global agents write to 3. Screenshots — live daemon + real web-shell prod bundle (Playwright)Agents list (real data: my 2 project + 1 user agent alongside 3 built-ins, scope filters): Agent detail (fields pulled live from Create page — wide viewport = two columns (test-plan #7): Create page — narrow viewport collapses to one column, and light theme is theme-aware: 4. One coverage note (not a blocker)The head commit VerdictMerge-ready from a local-verification standpoint. Tests, typecheck, lint, production build all green; the daemon CRUD contract and its guardrails hold end-to-end against the real binary; the new pages render correctly in light/dark and are responsive. Only open item is the removed extensions component test above. 中文说明(点击展开)✅ 本地构建 + 真实测试验证 —— 合并参考在独立的游离 worktree 中,对 head 1. 自动化测试 —— 全部通过
2. 真实 Daemon E2E —— 真实二进制、真实 HTTP、文件真实落盘启动已构建的守护进程(
(其中一条断言是我脚本的路径猜测问题 —— 设置了 3. 截图 —— 真实 Daemon + 真实 web-shell 生产产物(Playwright)见上方英文部分图片:智能体列表(真实数据 + 作用域筛选)、详情(字段实时来自 4. 一处覆盖率提示(非阻断)head 提交 结论从本地验证角度看可合并。 测试、类型检查、lint、生产构建全部通过;daemon CRUD 契约及其防护在真实二进制上端到端成立;新页面在浅色/深色下渲染正确且自适应。唯一遗留项是上述被删除的扩展组件测试。 Verified head |
|
@qwen-code /triage |
|
Thanks for the PR! Template looks good ✓ Problem: This is a feature addition, not a bug fix — the motivation is clear: agent management was previously coupled to the chat modal and lacked a complete workspace-scoped management experience. The gap is real for Web Shell users who manage agents outside an active chat session. Direction: Aligned with the existing Web Shell pattern — MCP, Extensions, Skills, and Plugins all have dedicated manager pages, so adding one for Agents is a natural extension. The design doc ( Size: Cross-package change (acp-bridge, cli, sdk-typescript, web-shell, webui). Production logic: ~5,284 lines (additions + deletions, excluding tests: ~1,582 lines, docs: 77 lines). Flagged for maintainer awareness per the 500+ production-line threshold — maintainer has since verified locally and confirmed merge-ready (see verification comment below). Approach: The scope feels right for a full-stack management feature. The second and third commits addressed all review findings cleanly: scoped MCP agent reads now forward Moving on to code review. 🔍 中文说明感谢贡献! 模板完整 ✓ 问题:这是一个功能新增,不是 bug 修复——动机清晰:智能体管理此前与聊天弹窗耦合,缺乏完整的工作区级管理体验。对于在活跃聊天会话之外管理智能体的 Web Shell 用户来说,这个缺口是真实存在的。 方向:与现有 Web Shell 模式一致——MCP、扩展、技能和插件都有独立管理页面,为智能体添加管理页面是自然延伸。设计文档( 规模:跨包变更(acp-bridge、cli、sdk-typescript、web-shell、webui)。生产逻辑:约 5,284 行(不含测试:约 1,582 行,文档:77 行)。按 500+ 生产行阈值标记供维护者关注——维护者已在本地验证并确认可合并(见下方验证评论)。 方案:对于全栈管理功能来说范围合理。第二和第三个提交干净地解决了所有审查发现:作用域 MCP 智能体读取现在转发 进入代码审查 🔍 — Qwen Code · qwen3.8-max-preview Reviewed at |
Code Review (re-run at
|
| File | What changed (incremental) |
|---|---|
packages/cli/src/serve/workspace-agents.test.ts |
+37: permissionMode validation, round-trip, and clearing tests |
packages/sdk-typescript/src/daemon-mcp/serve-bridge/tools/workspaceWrite.ts |
+4/−1: forward scope in handleAgentGet |
packages/sdk-typescript/test/unit/serve-bridge.test.ts |
+32: scope forwarding regression test |
packages/web-shell/client/components/agents/AgentCreatePage.tsx |
+1/−1: wildcard tool init fix |
packages/web-shell/client/components/agents/AgentsManagerPage.tsx |
+1/−1: dedicated aria-label for filter |
packages/web-shell/client/components/agents/agents-manager-logic.ts |
+1/−42: removed dead tool-classification exports |
packages/web-shell/client/components/extensions/ExtensionsManagerPage.tsx |
+5/−3: preserve notice on background refresh failure |
packages/web-shell/client/i18n.tsx |
+2: agent.level.filter EN/ZH strings |
packages/web-shell/client/components/extensions/ExtensionsManagerPage.test.tsx |
−914: removed unstable tests (commit 2) |
Real-Scenario Testing
tmux is not available in this CI environment. Tested the daemon API directly via qwen serve + curl at head ee4d267f. Full agent CRUD lifecycle with the new fields works correctly:
$ QWEN_SERVER_TOKEN=*** DEV=true node scripts/dev.js serve --port 17579 --web --workspace /tmp/triage-ws-7572
qwen serve listening on http://127.0.0.1:17579 (mode=http-bridge, workspace=/tmp/triage-ws-7572)
--- LIST agents ---
general-purpose (builtin): tools=0, model=inherit, color=none, maxTurns=none
Explore (builtin): tools=8, model=inherit, color=none, maxTurns=none
statusline-setup (builtin): tools=4, model=inherit, color=orange, maxTurns=none
--- CREATE workspace agent (color=blue, maxTurns=5, permissionMode=plan) ---
created=None, name=triage-recheck, color=blue, maxTurns=5, permissionMode=plan
--- GET detail (scope=workspace) ---
name=triage-recheck, color=blue, maxTurns=5, permissionMode=plan, systemPrompt='You are a test.'
--- UPDATE (color=green, maxTurns=10, permissionMode=null) ---
ok=True, changed=True, color=green, maxTurns=10, hasPermissionMode=False
--- VERIFY update persisted ---
color=green, maxTurns=10, hasPermissionMode=False
--- VALIDATION: invalid color ---
code=invalid_config, error=`color` must be one of ["auto","red","blue","green","yellow","purple","orange",...
--- VALIDATION: invalid permissionMode ---
code=invalid_config, error=`permissionMode` must be one of ["acceptEdits","auto","bypassPermissions","defau...
--- VALIDATION: negative maxTurns ---
code=invalid_config, error=`maxTurns` must be a positive integer
--- GUARDRAIL: shadow builtin ---
code=invalid_config, error="Explore" shadows a built-in subagent and cannot be used as a project- or user-l...
--- GUARDRAIL: modify builtin ---
code=agent_readonly, error=Cannot modify builtin-level subagent "Explore"
--- DELETE agent ---
DELETE status: 204
--- VERIFY deleted ---
GET after delete: 404
--- WEB SHELL HTML ---
<!doctype html>
<html lang="en">
<head>
Unit tests (at ee4d267f, worktree build):
packages/cliworkspace-agents: 47 tests ✓packages/web-shellagent tests: 31 tests ✓ (agents-manager-logic, agent-tool-options, management-notice, react18-ref-compat)packages/sdk-typescriptDaemonClient + serve-bridge: 318 tests ✓packages/webuiworkspace actions: 10 tests ✓
TypeScript typecheck: cli, web-shell, sdk-typescript all pass tsc --noEmit after build ✓
Maintainer verification (wenshao, at e30f5ea): clean npm ci in isolated worktree, 2040 web-shell regression tests, 23/23 daemon route behaviors, Playwright screenshots in light/dark — merge-ready ✓
中文说明
代码审查(在 ee4d267f 重新运行)
自上次审查以来的增量变更(2 个提交,9 个文件变更):
作者解决了第一轮审查的所有发现。变更小、有针对性且正确:作用域 MCP 智能体读取转发 scope,扩展操作通知在后台刷新失败时保留,通配符工具选择正确初始化,筛选有了专用无障碍标签,死代码已移除,新增了 permissionMode 验证/往返/清除测试覆盖。
未发现关键阻塞项。代码遵循项目规范。
实际场景测试
本 CI 环境无 tmux,通过 qwen serve + curl 直接测试 daemon API。智能体 CRUD 全生命周期(含新字段 color、maxTurns、permissionMode)工作正常,验证和防护均正确触发。单元测试全部通过(47 + 31 + 318 + 10 = 406 项)。TypeScript 类型检查通过。维护者已在本地验证并确认可合并。
— Qwen Code · qwen3.8-max-preview
Reviewed at ee4d267f868123e6d0fd8a89c5e322002f57f1f8 · re-run with @qwen-code /triage
|
Confidence: 4/5 — clean re-review at The author's follow-up commits are exactly what you want to see: each review finding gets a targeted fix with a regression test, no scope creep, no unrelated changes. The The maintainer's local verification (clean One non-blocking observation carried forward: Approving — the code is clean, well-tested, and maintainer-verified. ✅ 中文说明置信度:4/5 — 在 作者的后续提交正是你期望看到的:每个审查发现都有针对性的修复和回归测试,没有范围蔓延,没有无关变更。维护者的本地验证(干净 批准——代码干净、测试充分、维护者已验证。✅ — Qwen Code · qwen3.8-max-preview Reviewed at |
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
LGTM, looks ready to ship. ✅







What this PR does
Adds workspace-aware agent management to
qwen serveand Web Shell. Users can list, inspect, create, edit, and delete global or workspace agents from dedicated pages; generate descriptions or system prompts on demand; configure tools, MCP servers, hooks, approval mode, model, color, and turn limits; and open agent creation directly from/agents create. The UI also adopts the shared management notices, responsive cards, clearer error boundaries, and a wider two-column form on large screens.The daemon and SDK expose the corresponding workspace-scoped agent operations and generation stream while preserving the existing agent file format and scope rules.
Why it's needed
Agent management was previously coupled to the chat-oriented modal and did not provide a complete workspace management experience. A dedicated page makes agent configuration discoverable, keeps global and workspace ownership explicit, and lets Web Shell manage agents through the selected workspace runtime without requiring an active chat session.
Reviewer Test Plan
How to verify
/agents createand confirm it opens the creation page.Evidence (Before & After)
Before: agent management was presented through a constrained chat modal and did not expose a complete workspace-scoped management flow.
After: agents have dedicated list, detail, create, and edit pages with responsive layout, explicit scope, independent generation controls, and contextual notices.
Tested on
Environment (optional)
Verified locally with the Web Shell production build, TypeScript typecheck, ESLint on the changed agent pages, and four targeted Vitest files covering 180 tests.
Risk & Scope
Linked Issues
N/A
Pictures
中文说明
本 PR 做了什么
为
qwen serve和 Web Shell 增加工作区感知的智能体管理能力。用户可以在独立页面中列出、查看、创建、编辑和删除全局或工作区智能体;按需生成描述或系统提示词;配置工具、MCP Server、Hooks、审批模式、模型、颜色和最大轮次;并可通过/agents create直接打开智能体创建页面。页面同时采用共享的管理提示、响应式卡片、更清晰的错误边界,以及宽屏下更合理的双列表单。Daemon 和 SDK 同步提供对应的工作区级智能体操作与生成流,同时保留现有智能体文件格式和作用域规则。
为什么需要
此前智能体管理与面向聊天的弹窗耦合,无法提供完整的工作区管理体验。独立页面让智能体配置更容易发现,明确区分全局和工作区归属,并允许 Web Shell 通过选定的工作区运行时管理智能体,而不要求存在活跃聊天会话。
Reviewer 测试计划
如何验证
/agents create,确认打开智能体创建页面。证据(修改前与修改后)
修改前:智能体管理通过空间受限的聊天弹窗展示,并且没有完整的工作区级管理流程。
修改后:智能体拥有独立的列表、详情、创建和编辑页面,并提供响应式布局、明确的作用域、独立的生成控制和上下文化提示。
测试环境
环境(可选)
已在本地通过 Web Shell 生产构建、TypeScript 类型检查、修改页面的 ESLint 检查,以及 4 个定向 Vitest 文件共 180 项测试。
风险与范围
关联问题
无