Skip to content

feat(web-shell): gate Session Workflow behind an experimental setting - #8391

Merged
qwen-code-review-bot merged 1 commit into
QwenLM:mainfrom
yiliang114:codex/8389-plan-review-flag
Aug 3, 2026
Merged

feat(web-shell): gate Session Workflow behind an experimental setting#8391
qwen-code-review-bot merged 1 commit into
QwenLM:mainfrom
yiliang114:codex/8389-plan-review-flag

Conversation

@yiliang114

Copy link
Copy Markdown
Collaborator

What this PR does

Adds a default-off experimental.sessionWorkflow setting for daemon WebShell sessions. When enabled, the existing plan approval mode is presented as Plan & Review, and the existing Todo-based Workflow DAG is available in task and exit-plan approval surfaces. The setting is applied consistently to the main chat, split panes, and side-task panes.

When the setting is disabled or unavailable, ordinary Todo rendering and Plan Mode behavior remain unchanged, while the Workflow DAG and new labels stay hidden.

Why it's needed

Session Workflow is still experimental and should not change the experience of existing users by default. This creates an explicit, reversible rollout boundary before the approval flow is bound to a specific plan revision in the follow-up PR.

Reviewer Test Plan

How to verify

  1. Leave experimental.sessionWorkflow unset or set it to false; confirm Plan Mode keeps its existing name, ordinary Todo lists remain visible, and task/exit-plan surfaces do not render a Workflow DAG.
  2. Set experimental.sessionWorkflow to true; confirm the mode picker and composer show Plan & Review, and structured Todo data is rendered as the existing Workflow DAG in the task and exit-plan approval surfaces.
  3. Confirm the same setting applies to the main chat, split panes, and side-task panes without adding a protocol approval mode.

Evidence (Before & After)

Before: Workflow presentation was unconditional whenever compatible Todo data was present.

After: Workflow presentation and Plan & Review labels are opt-in; ordinary Todo behavior remains available in both states.

Automated checks passed: focused settings/WebShell tests, full repository build, and full repository typecheck on macOS.

Tested on

OS Status
🍏 macOS
🪟 Windows N/A
🐧 Linux N/A

Environment (optional)

Node.js 22, local daemon WebShell build.

Risk & Scope

  • Main risk or tradeoff: The active WebShell workspace setting controls all panes in that WebShell instance; per-pane workspace overrides are intentionally not introduced in this PR.
  • Not validated / out of scope: Binding approval to an immutable Todo revision, scheduling dependencies, retrying Agents, or adding a Workflow store.
  • Breaking changes / migration notes: None. The feature is disabled by default and reuses the existing plan protocol mode.

Linked Issues

Related to #8389.

中文说明

本 PR 做了什么

为 daemon WebShell 会话新增默认关闭的 experimental.sessionWorkflow 设置。开启后,现有 plan 审批模式会显示为 计划并审阅,并在任务与退出 Plan 审批界面中展示现有的 Todo Workflow DAG。该设置统一作用于主会话、分屏和侧任务面板。

当设置关闭或尚未加载时,普通 Todo 展示与 Plan Mode 行为保持不变,同时隐藏 Workflow DAG 和新增文案。

为什么需要

Session Workflow 仍属于实验功能,不应默认改变现有用户体验。这个 PR 先建立明确且可回退的灰度边界;后续 PR 再把审批绑定到具体的计划修订版本。

Reviewer Test Plan

如何验证

  1. 不设置 experimental.sessionWorkflow 或将其设为 false;确认 Plan Mode 仍使用原名称,普通 Todo 列表仍可见,任务与退出 Plan 界面不展示 Workflow DAG。
  2. experimental.sessionWorkflow 设为 true;确认模式选择器和输入区显示 计划并审阅,并且结构化 Todo 会在任务与退出 Plan 审批界面中展示为现有 Workflow DAG。
  3. 确认主会话、分屏和侧任务面板统一遵循该设置,并且没有新增协议层审批模式。

前后对比证据

之前:只要存在兼容的 Todo 数据,Workflow 展示就是无条件的。

之后:Workflow 展示和计划并审阅文案改为显式开启;两个状态下普通 Todo 行为都保持可用。

已在 macOS 通过设置/WebShell 相关测试、全仓构建和全仓类型检查。

测试环境

OS 状态
🍏 macOS
🪟 Windows N/A
🐧 Linux N/A

Node.js 22,本地 daemon WebShell 构建。

风险与范围

  • 主要风险或取舍:当前 WebShell 活跃工作区的设置统一控制该实例内所有 pane;本 PR 不引入按 pane 的工作区覆盖。
  • 未验证或不在范围内:把审批绑定到不可变的 Todo 修订、依赖调度、Agent 重试或新增 Workflow store。
  • 破坏性变更与迁移:无。功能默认关闭,并复用现有 plan 协议模式。

关联 Issue

关联 #8389

@qwen-code-ci-bot

Copy link
Copy Markdown
Collaborator

🖼️ web-shell visual preview

Rendered against a mock daemon (no real backend): the PR base vs this PR head 105c14d. Only screenshots that changed are shown (flows below, if any, are head-only) — refreshes on every push.

Screenshots · before / after

ℹ️ No screenshot changed against the PR base — but this PR edits 8 render-shaping files:

  • packages/web-shell/client/App.tsx
  • packages/web-shell/client/components/ChatEditor.tsx
  • packages/web-shell/client/components/ChatPane.tsx
  • packages/web-shell/client/components/SplitView.tsx
  • packages/web-shell/client/components/artifacts/ArtifactPanel.tsx
  • packages/web-shell/client/components/artifacts/SideTaskPanel.tsx
  • packages/web-shell/client/components/dialogs/ApprovalModeDialog.tsx
  • packages/web-shell/client/i18n.tsx

Either the change has no visual effect (logic, plumbing, a state the scenarios never reach), or no scenario renders this UI — in which case the preview cannot see it, and an empty result is a coverage gap rather than a clean bill of health. To make it visible, add a scenario to packages/web-shell/client/e2e/visuals/screenshots.spec.ts that seeds whatever state the UI is gated on; it then appears here as a head-only (NEW) capture.

Full-resolution recordings (.webm) are attached to the workflow run.

Qwen Code · web-shell visuals

@qwen-code-ci-bot

qwen-code-ci-bot commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Qwen Triage finishedview run. See the stage comments in this thread for the result.

Qwen Triage 已完成 —— 查看运行。结果见本线程中的各阶段评论。

@qwen-code-ci-bot

Copy link
Copy Markdown
Collaborator

Thanks for the PR!

Template looks good ✓ — all required sections present, bilingual body, reviewer test plan included.

Problem: this is the planned "PR 1" of #8389 (labeled status/in-progress, daemon, scope/web-shell), which follows the already-merged Workflow work (#7525, #7580). The motivation is concrete: Session Workflow presentation is currently unconditional whenever compatible Todo data exists, and the follow-up PR that binds approval to a specific plan revision needs a default-off rollout boundary first. Not theoretical.

Direction: aligned. Default-off experimental gating for an in-flight daemon/WebShell feature is exactly the right shape for this stage of the rollout, and the issue explicitly scopes this PR to presentation only (no new protocol mode, no scheduler, no store).

Size: one core-path file — packages/cli/src/config/settingsSchema.ts (+10). Production logic ≈ 95 lines (client + schema), tests ≈ 54 lines, generated-mirror schema 5 lines, design doc 50 lines. Well under any escalation threshold.

Approach: scope feels right and minimal — every file serves the gate (schema entry, vscode schema mirror, flag threading through App/ChatPane/SplitView/ArtifactPanel/SideTaskPanel, two label surfaces, i18n, tests, design doc). No drive-by changes spotted. The design doc correctly documents Phase 1 vs Phase 2 boundaries.

Risk: no elevated risk signals — none of the changed files match the revert-correlated high-risk paths.

Moving on to code review. 🔍

中文说明

感谢贡献!

模板完整 ✓ —— 必填章节齐全,中英双语,包含 reviewer 测试计划。

问题:这是 #8389(已标 status/in-progressdaemonscope/web-shell)规划中的 "PR 1",承接已合入的 Workflow 工作(#7525#7580)。动机具体:目前只要存在兼容的 Todo 数据,Session Workflow 展示就是无条件的;后续要把审批绑定到具体计划修订版本的 PR,需要先建立默认关闭的灰度边界。不是理论性问题。

方向:对齐。对进行中的 daemon/WebShell 功能采用默认关闭的实验性开关,正是当前阶段合适的推进方式;issue 也明确本 PR 只做展示层(不新增协议模式、不做调度器、不新增 store)。

规模:仅一个核心路径文件 —— packages/cli/src/config/settingsSchema.ts(+10)。生产逻辑约 95 行(客户端 + schema),测试约 54 行,生成镜像 schema 5 行,设计文档 50 行。远低于任何升级阈值。

方案:范围合理且最小化 —— 每个文件都服务于这个开关(schema 条目、vscode schema 镜像、在 App/ChatPane/SplitView/ArtifactPanel/SideTaskPanel 中传递开关、两个文案入口、i18n、测试、设计文档)。未发现顺手改动。设计文档正确划分了 Phase 1 与 Phase 2 的边界。

风险:无升级风险信号 —— 改动文件均未命中与 revert 相关的高风险路径。

进入代码审查 🔍

Qwen Code · qwen3.8-max-preview

Reviewed at 105c14d27d7bb8b8c3ac3c9e425aa6a176b73fb6 · re-run with @qwen-code /triage

@qwen-code-ci-bot

Copy link
Copy Markdown
Collaborator

Code review

Reviewed 105c14d27d7b — one commit, 15 files. The change matches the stated scope exactly: schema entry + mirror, flag threading, two label surfaces, i18n, tests, design doc. No correctness blockers found. A few things I verified in depth, since they're the load-bearing parts of this PR:

  • Gate coverage is complete. The Workflow DAG only renders from planTodos/agentTools props (ToolApproval and TasksStatusMessagePlanExecutionView). There are exactly three production providers of that data: the tasks dialog and the floating approval overlay in App.tsx, and the exit-plan memo in ChatPane.tsx. All three are gated, so no rendering surface can leak when the setting is off.
  • Plumbing needs no server-side change. The daemon workspace-settings route serves every leaf with showInDialog: true via getDialogSettingKeys() (group-level showInDialog: false on experimental doesn't hide leaf-opt-ins — same path cron/agentTeam already use), and App.tsx reads values.effective exactly like theme/language/hideTips. The design doc's "expose through the existing route" claim holds.
  • The hand-edited vscode schema mirror matches the generator output (scripts/generate-settings-schema.ts emits description → type → default in schema order), so regeneration won't drift.
  • ZH-only settings.label/description keys are correcttranslateSettingText falls back to the daemon descriptor's English text when a locale key is missing, same pattern as enableCronTools.
  • requiresRestart: false is reasonable: the setting is presentation-only and the client reads the effective value live; emitToolUseSummaries is the precedent.

Two non-blocking observations:

  1. AgentsManagerPage and AgentCreatePage render mode.listLabel.${mode} without the flag, so when the setting is on, agent pages still say "Plan (plan)" while the main surfaces say "Plan & Review (plan)". Presumably intentional (agent sessions are outside Session Workflow scope), but worth a sentence in the PR if so.
  2. The new property is inserted at the top of experimental.properties, so it sorts first among the experimental settings not in the explicit dialog order. Cosmetic only.

Nothing here blocks; the implementation is straightforward and convention-following.

Files changed (15 of 15)
File What changed
docs/design/experimental-session-plan-review.md New design doc: rollout goals, Phase 1/2 split, boundaries
packages/cli/src/config/settingsSchema.ts Adds experimental.sessionWorkflow boolean, default false, no restart, shown in dialog
packages/cli/src/config/settingsSchema.test.ts Pins the new setting's default-off, no-restart, show-in-dialog contract
packages/vscode-ide-companion/schemas/settings.schema.json Mirror entry for IDE IntelliSense, matches generator output
packages/web-shell/client/App.tsx Reads the effective flag; gates tasks-dialog and overlay planTodos/agentTools; passes flag to dialog, editor, panes
packages/web-shell/client/App.test.tsx Gate test: exit-plan DAG absent without the flag, present after enabling
packages/web-shell/client/components/ChatEditor.tsx Mode list and mode chip relabel plan to Plan & Review when enabled
packages/web-shell/client/components/ChatPane.tsx Exit-plan planTodos memo gated; forwards flag to editor
packages/web-shell/client/components/ChatPane.test.tsx Existing workflow test now opts in via the flag
packages/web-shell/client/components/SplitView.tsx Forwards flag to split panes
packages/web-shell/client/components/artifacts/ArtifactPanel.tsx Forwards flag to nested session pane
packages/web-shell/client/components/artifacts/SideTaskPanel.tsx Forwards flag through side-task session
packages/web-shell/client/components/dialogs/ApprovalModeDialog.tsx Relabels only the plan entry when enabled
packages/web-shell/client/components/dialogs/ApprovalModeDialog.test.tsx Asserts rename applies only to the plan entry
packages/web-shell/client/i18n.tsx EN+ZH mode strings; ZH settings-dialog overrides (EN falls back to schema text)

Test evidence (this PR's own CI — per gate rules I do not run PR code)

All pull_request workflow runs on the reviewed commit are complete and green; there are no failing checks. The web-shell E2E smoke, web-shell visuals capture, and the full ubuntu unit suite are the directly relevant lanes for this change. The skipped macOS / Windows / integration jobs are merge-queue-only by design in ci.yml — identical for every PR, not a gap introduced here.

Check Conclusion
Qwen Code CI / Test (ubuntu-latest, Node 22.x) ✅ success
Qwen Code CI / web-shell E2E Smoke (ubuntu-latest, Node 22.x) ✅ success
Qwen Code CI / Desktop Shell (ubuntu-22.04) ✅ success
Web-shell Visuals / Capture web-shell visuals (ubuntu-latest, Node 22.x) ✅ success
Qwen PR Safety Precheck (precheck-pr / precheck) ✅ success
Test (macos-latest, Node 22.x) / Test (windows-latest, Node 22.x) ⏭️ skipped (merge queue only)
Integration Tests (CLI, No Sandbox) ⏭️ skipped (merge queue only)

The gate itself is pinned by tests that would fail if the gating were removed (App gate test asserts empty planTodos with the flag off, then the DAG after enabling; the ChatPane exit-plan test now opts in explicitly).

Sandboxed verification would settle one remaining end-to-end leg: @qwen-code /verify — no test in this PR exercises the daemon settings route actually serving the new descriptor into the WebShell settings dialog and the toggle flipping the UI live (the tests inject the descriptor directly). An A/B run against the base build would prove the setting surfaces and toggles without a restart.

中文说明

代码审查

已审查 105c14d27d7b —— 单 commit,15 个文件。改动与声明范围完全一致:schema 条目 + 镜像、开关传递、两个文案入口、i18n、测试、设计文档。未发现正确性阻塞问题。对几个承重部分做了深入核对:

  • 开关覆盖完整。 Workflow DAG 仅由 planTodos/agentTools props 驱动渲染(ToolApprovalTasksStatusMessagePlanExecutionView)。生产代码中恰好有三个数据提供方:App.tsx 的任务对话框与浮动审批浮层、ChatPane.tsx 的 exit-plan memo。三处均已加开关,关闭时不会有渲染面泄漏。
  • 无需服务端改动。 daemon 的 workspace-settings 路由通过 getDialogSettingKeys() 暴露所有叶子级 showInDialog: true 的设置(experimental 分组级 showInDialog: false 不会遮蔽叶子级开关 —— 与 cron/agentTeam 走同一路径),App.tsx 读取 values.effective 的方式与 theme/language/hideTips 完全一致。设计文档"通过现有路由暴露"的说法成立。
  • 手工编辑的 vscode schema 镜像与生成器输出一致scripts/generate-settings-schema.ts 按 schema 顺序输出 description → type → default),重新生成不会产生漂移。
  • 仅 ZH 的 settings.label/description 键是正确的 —— 缺失 locale 键时 translateSettingText 回退到 daemon descriptor 的英文文案,与 enableCronTools 同一模式。
  • requiresRestart: false 合理:该设置仅影响展示且客户端实时读取生效值;emitToolUseSummaries 是先例。

两个非阻塞观察:

  1. AgentsManagerPageAgentCreatePage 渲染 mode.listLabel.${mode} 时未接入开关,开启后 agent 页面仍显示 "Plan (plan)",而主界面显示 "Plan & Review (plan)"。推测是有意为之(agent 会话不在 Session Workflow 范围内),如果是,建议在 PR 里说明一句。
  2. 新属性插在 experimental.properties 顶部,因此在对话框显式排序之外的实验设置中排在最前。纯外观问题。

均不阻塞;实现直接、遵循既有约定。

测试证据(来自本 PR 自身的 CI —— 按门禁规则不运行 PR 代码)

被审查 commit 上的所有 pull_request 工作流运行均已完成且全绿,无失败检查。web-shell E2E smoke、web-shell 视觉截图捕获与 ubuntu 完整单测是与本改动直接相关的验证通道。跳过的 macOS / Windows / 集成任务在 ci.yml 中按设计仅在 merge queue 运行 —— 对所有 PR 一致,并非本 PR 引入的缺口。

开关本身由"移除开关即会失败"的测试锁定(App 门禁测试断言关闭时 planTodos 为空、开启后出现 DAG;ChatPane 的 exit-plan 测试显式开启开关)。

剩余一个端到端环节可由沙箱验证收尾:@qwen-code /verify —— 本 PR 没有任何测试真实走一遍 daemon settings 路由下发新 descriptor 到 WebShell 设置对话框、并验证切换即时生效(测试是直接注入 descriptor 的)。与 base 构建做 A/B 运行即可证明该设置能正常出现且免重启切换。

Qwen Code · qwen3.8-max-preview

Reviewed at 105c14d27d7bb8b8c3ac3c9e425aa6a176b73fb6 · re-run with @qwen-code /triage

@qwen-code-ci-bot

Copy link
Copy Markdown
Collaborator

Confidence: 4/5 — clean, minimal, well-tested feature gate; the 5th point is held back only by two cosmetic nits and one end-to-end leg no test pins.

Stepping back: this is exactly what PR 1 of #8389 should look like. My independent read of the problem before opening the diff was "add a default-off schema flag, serve it through the existing workspace-settings route, and gate the three planTodos data sources plus the plan-mode labels" — the PR does precisely that, with nothing extra. There's no new machinery, no protocol change, no scheduler creeping in early; the Phase 2 boundary is documented in the design doc instead of being half-built.

The part that mattered most to verify — that nothing leaks when the setting is off — checks out by enumeration: the Workflow DAG renders only from planTodos/agentTools props, and all three production providers are gated. The updated tests would fail if the gating were removed, and the full ubuntu suite, web-shell E2E smoke, and visuals capture are green on this commit. If I were maintaining this in six months, the flag threading would read fine — it follows the same values.effective pattern as theme/language.

Non-blocking nits, already noted in the review comment: agent pages don't pick up the "Plan & Review" relabel (presumably intentional scope), and the settings-dialog → live-toggle path is the one leg exercised only by descriptor injection in tests, which the @qwen-code /verify line in my review comment can settle if a maintainer wants A/B proof before the follow-up PR lands.

Approving — ready to ship. ✅

中文说明

置信度:4/5 —— 干净、最小化、测试充分的特性开关;扣掉的 1 分仅因两个外观层面的小问题和一条没有测试锁定的端到端环节。

退一步看:这正是 #8389 的 PR 1 应有的样子。我在看 diff 之前对问题的独立判断是"新增默认关闭的 schema 开关、通过现有 workspace-settings 路由下发、并在三个 planTodos 数据源与 plan 模式文案处加门" —— 本 PR 完全如此,没有任何多余内容。没有新机制、没有协议变更、没有提前混入调度器;Phase 2 的边界写在设计文档里,而不是半成品代码里。

最需要验证的部分 —— 关闭设置时不泄漏 —— 经枚举确认成立:Workflow DAG 仅由 planTodos/agentTools props 渲染,三个生产数据提供方全部加了开关。更新后的测试在移除开关时会失败,且该 commit 上 ubuntu 完整测试、web-shell E2E smoke 与视觉捕获均为绿色。六个月后维护这段代码,开关传递读起来不会费劲 —— 它与 theme/language 使用同样的 values.effective 模式。

非阻塞小问题(已在审查评论中记录):agent 页面未接入 "Plan & Review" 文案(推测是有意的范围控制);设置对话框 → 即时切换这一环节只有 descriptor 注入式测试覆盖,如需在后续 PR 落地前拿到 A/B 证据,可用我审查评论中的 @qwen-code /verify 触发。

批准 —— 可以合入。✅

Qwen Code · qwen3.8-max-preview

Reviewed at 105c14d27d7bb8b8c3ac3c9e425aa6a176b73fb6 · re-run with @qwen-code /triage

@qwen-code-ci-bot qwen-code-ci-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, looks ready to ship. ✅

@chiga0 chiga0 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review Overview (AI Generated)

PR: #8391 feat(web-shell): gate Session Workflow behind an experimental setting
Type: New Feature (experimental flag)
Change size: +189/-15 across 15 files

Findings Summary

  • Critical/Major: 0
  • Minor: 0
  • Nit: 0

Key Observations

Clean, default-off feature boundary. The new experimental.sessionWorkflow setting is declared in the CLI schema with default: false and requiresRestart: false, exposed in the settings dialog, and read from workspaceSettings via the established values.effective === true pattern (same as hideTips). The boolean is then prop-drilled through App → ChatEditor / ApprovalModeDialog / ToolApproval / TasksDialog / ChatPane / SplitView / ArtifactPanel / SideTaskPanel; every consumer defaults to false so omitted props retain existing behavior.

  • UI labels: plan mode is renamed to Plan & Review / 计划并审阅 only when the flag is enabled, in both the mode selector and the approval-mode dialog; otherwise existing labels stay unchanged.
  • Workflow DAG gating: planTodos={sessionWorkflowEnabled ? ... : []} and agentTools={sessionWorkflowEnabled ? ... : []} keep the Tasks/ToolApproval surfaces unchanged when disabled.
  • i18n: EN and ZH keys added symmetrically, including the new settings labels/descriptions.
  • No protocol change: the existing plan approval mode is reused, consistent with the PR's stated rollout strategy.

Cross-Validation

Finding Other Reviewer My Assessment
None qwen-code-ci-bot APPROVED Agree — no blockers found

Additional Audit Coverage

Areas I independently checked beyond ci-bot:

  • Setting read pattern: confirmed values.effective === true is the established pattern in App.tsx.
  • Default prop values: every new sessionWorkflowEnabled prop defaults to false, preventing accidental opt-in from partial prop passing.
  • Schema test: settingsSchema.test.ts pins type: 'boolean', default: false, requiresRestart: false, showInDialog: true.
  • Test coverage: ApprovalModeDialog test asserts label switch only when enabled; App test asserts planTodos is empty without the setting and populated after enabling; ChatPane test passes the flag explicitly.
  • Out-of-scope guard: no new persistent store or scheduler introduced.

Final Verdict

APPROVE. Low-risk, reversible experimental feature gate. Ready to merge.


This review was generated by QoderWork AI

@qwen-code-review-bot
qwen-code-review-bot added this pull request to the merge queue Aug 3, 2026
Merged via the queue into QwenLM:main with commit fa938bd Aug 3, 2026
67 of 68 checks passed
@qwen-code-ci-bot

Copy link
Copy Markdown
Collaborator

Released in v0.21.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants