fix(web-shell): Preserve workspace navigation in standalone tasks - #10786
fix(web-shell): Preserve workspace navigation in standalone tasks#10786doudouOUC wants to merge 1 commit into
Conversation
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
E2E test reportBaseline on Automated browser verification:
Real cold-start verification against the local daemon/Web Shell:
Supporting verification:
Environment: macOS, Node.js 24.12.0, local daemon on 4170 and Vite on 5173. Windows and Linux were not run locally. |
|
Qwen Code review did not complete successfully. The review pipeline failed before a review could be posted. A transient error is retried automatically; if you are seeing this, retry with |
|
Thanks for the PR! Template looks good ✓ Problem: observed bug with solid evidence, not theoretical hardening. This is a direct follow-up to the standalone-chats feature merged yesterday (#10514): entering a standalone task removed the workspace tree, Plugins, and Scheduled Tasks from the sidebar, and New task silently preferred standalone whenever the capability was present. The description carries a before/after table, the E2E report comment adds request-level verification, and the behavior is reproducible from the merged feature's own semantics. Direction: aligned. Preserving workspace navigation and explicit management entry points while a standalone conversation is active keeps the trust/session-ownership boundaries intact instead of papering over them, and defaulting New task back to the trusted workspace matches the project-first sidebar. No auth/sandbox/telemetry/public-contract surface is touched. Size: not applicable — no core module paths. All changes are in Approach: the scope feels right. Splitting the single Risk: no elevated risk signals — none of the changed files match the revert-correlated paths. Moving on to code review. 🔍 中文说明感谢贡献! 模板完整 ✓ 问题: 已观测到的 bug,证据充分,不是理论性加固。这是昨天合入的无工作区会话功能(#10514)的直接后续:进入无工作区任务后侧边栏移除了工作区树、插件和定时任务,且"新建任务"在能力存在时会隐式优先选择无工作区。描述里有 before/after 对照表,E2E 报告评论补充了请求级验证。 方向: 对齐。在无工作区会话激活时保留工作区导航和显式管理入口,保持了信任/会话所有权边界;"新建任务"默认回到可信工作区,符合项目优先的侧边栏设计。不涉及认证/沙箱/遥测/公共契约。 规模: 不适用——未触及核心模块路径。全部改动在 方案: 范围合理。把单一的 风险: 无升级风险信号——改动文件均未命中与回滚相关的高风险路径。 进入代码审查 🔍 — Qwen Code · qwen3.8-max Reviewed at |
Code reviewI wrote my independent proposal before reading the diff — keep the sidebar sections mounted in standalone context, label them with the trusted primary workspace, default New task to the current trusted workspace, and fail closed for tasks whose owning workspace isn't active. The PR's approach matches that, and in a few places goes further than I would have thought to (the Things I verified against the base branch rather than taking on faith:
One deliberate behavior change worth a maintainer's awareness (not a blocker, documented in the design doc and covered by tests): a legacy unbound scheduled task now fails closed with "no bound workspace session" whenever the active context isn't its owning workspace — previously it would run in whatever session happened to be current, including a different workspace's session. That's the safer semantics, but it is a tightening beyond the standalone case. No critical findings, no convention violations. TestingThis is an unattended CI run, so the evidence below is the PR's own CI, fetched via the API — I did not run any of the PR's code.
All four substantive failures are the same build break, and it is not this PR's. Every failing job dies in the shared build step with exactly one type error: Evidence for the pre-existing call: this PR's diff touches 17 files, all under Consequence: there is no CI test evidence for this PR yet. The author's local results (App suite 661/661, Sidebar 120/120, standalone Playwright 6/6 with exact Sandboxed verification would settle the behavioural claim once the build is unblocked: 中文说明代码审查在读 diff 之前我先独立写了方案——在独立(无工作区)上下文中保留侧边栏各分区、用可信主工作区标注它们、"新建任务"默认当前可信工作区、对所属工作区不活跃的任务失败关闭。PR 的方案与此一致,部分细节比我想得更到位( 已对照基线分支核实(而非凭描述采信): 一个有意的行为变化,值得维护者知悉(非阻塞,设计文档已写明且有测试覆盖):遗留未绑定定时任务现在只要当前上下文不是其所属工作区就会以 "no bound workspace session" 失败关闭——以前它会在任意当前会话中运行(包括别的工作区的会话)。语义更安全,但收紧范围超出了独立场景本身。 无关键问题,无规范违规。 测试这是无人值守 CI 运行,以下证据来自 PR 自身 CI 的 API 数据,未运行任何 PR 代码。 四个实质失败全部是同一个构建错误,且不是本 PR 造成的:所有失败 job 都死在共享构建步骤,唯一的类型错误是 结果:本 PR 目前没有任何 CI 测试证据。作者本地结果(App 661/661、Sidebar 120/120、独立 Playwright 6/6,含精确请求断言)是其 E2E 报告中的自述,未经独立验证。未验证:单元/e2e/视觉结果(被构建失败阻塞)、Windows/Linux 渲染(作者仅在 macOS 上测试)。 构建恢复后可用沙箱验证补齐行为证据: — Qwen Code · qwen3.8-max Reviewed at |
|
Confidence: 3/5 — the code itself earns a 4/5; what's missing is evidence, not quality. Stepping back: the approach matches the one I'd have proposed, the diff is exactly the minimal set the stated goal needs (no drive-bys, tests outnumber production code, design doc included), and the trust boundaries are handled the way this repo's daemon routing expects — fail closed, never fall back to an untrusted workspace, never leak a context switch into session creation. Six months from now this reads as careful work, not work to curse at. So why not approve? Because I'd be attesting to test results that do not exist. Every substantive CI check on this head died in ⏸️ Deferring until CI can actually run this PR's tests. Nothing is being asked of the author here — the blocker is the 中文说明置信度:3/5 —— 代码本身值 4/5;缺的是证据,不是质量。 退一步看:方案与我独立设想的一致,diff 恰好是目标所需的最小集合(无顺手改动,测试代码多于生产代码,附设计文档),信任边界的处理符合本仓库 daemon 路由的惯例——失败关闭、绝不回退到不可信工作区、绝不把上下文切换泄漏成会话创建。六个月后读这段代码,会觉得它细致,而不是让人骂。 那为什么不批?因为那样等于为不存在的测试结果背书。这个 head 上所有实质 CI 检查都在 main 既有的 ⏸️ 暂缓,等 CI 真正跑到本 PR 的测试。这里不要求作者做任何事——阻塞点是 main 上的 — Qwen Code · qwen3.8-max Reviewed at |
|
Closing as superseded by #10777, which is now merged and resolves the original regression with the smaller workspace-first approach: the sidebar New task inherits its context, standalone remains an explicit composer target, and workspace navigation stays reachable outside workspace chats. This PR also explores broader behavior for Plugins, Scheduled Tasks, and workspace-owner routing in standalone mode. Those changes are not required for the regression fix. If they are still desired, they should be reconsidered in a focused follow-up based on the current main branch instead of resolving conflicts in this alternative implementation. 关闭原因:#10777 已通过更小的方案解决原始回归。本 PR 中 standalone 模式下的 Plugins、Scheduled Tasks 与 workspace owner 路由属于额外产品范围;如后续仍需要,建议基于最新 main 单独提交一个聚焦的后续 PR。 |
What this PR does
This PR keeps workspace navigation and explicit workspace-management entry points available when a Web Shell task uses standalone mode. The global New task action now defaults to the current trusted workspace, exposes trusted non-Live workspaces and No workspace through a split menu, and mirrors the same explicit scope choice in the empty-state composer. Selecting No workspace changes only the draft context; the standalone session is still created lazily by the first prompt.
Standalone tasks continue to show Project sessions, Plugins, and Scheduled Tasks. Plugins and schedules are labeled and routed to the trusted primary workspace without changing the active standalone conversation. Bound scheduled-task runs and history preserve their workspace owner, while legacy unbound tasks fail closed outside that workspace. Workspace-only actions such as Git, Goals, Channels, worktrees, settings, and direct skill insertion remain unavailable in standalone mode.
Why it's needed
After starting or sending a standalone task, the sidebar previously removed the workspace tree together with Plugins and Scheduled Tasks. This made existing project sessions and workspace administration appear to disappear. New task also silently preferred standalone mode whenever the capability was present, even when a trusted workspace was available. The new behavior makes scope explicit, keeps navigation stable across workspace and standalone tasks, and preserves the existing trust and session-ownership boundaries.
Reviewer Test Plan
How to verify
standalone_sessions_v1and has a trusted primary workspace. Click the main New task action and send a prompt; expect a workspace session created with that workspace cwd.context=standalone, a visible No workspace chip, and no session-creation request until the first prompt is sent. Switch back to the workspace before sending and confirm no session was created during either scope change.Evidence (Before & After)
Automated browser evidence: 6/6 standalone Playwright scenarios passed, including exact
/sessionversus/standalone/sessionsrequest assertions. Real cold-start verification also observed zero create POSTs while switching workspace → No workspace → workspace, and no composer workspace selector on an already-created standalone session.Tested on
Environment (optional)
macOS, Node.js 24.12.0, local
npm run dev:daemonwith daemon on port 4170 and Vite on port 5173. Web Shell lint, typecheck, and production build passed. Focused component suites passed (WorkspaceSelector 4/4, Sidebar 120/120, Scheduled Tasks 57/57, Skills 7/7), the complete App suite passed 661/661, and standalone Playwright passed 6/6. The repository-wide build remains blocked on the unchanged main-branch error inpackages/cli/src/ui/opentui/commands-registry.tswhere"output-style"is not assignable tonever.Risk & Scope
Linked Issues
Follow-up to #10514.
中文说明
本 PR 做什么
本 PR 在 Web Shell 任务使用无工作区模式时保留工作区导航和明确的工作区管理入口。全局“新建任务”现在默认使用当前可信工作区,通过拆分菜单提供可信的非 Live 工作区和“无工作区”,空状态编辑器也提供相同的明确范围选择。选择“无工作区”只改变草稿上下文;无工作区会话仍由第一条提示词按现有机制延迟创建。
无工作区任务会继续显示项目会话、插件和定时任务。插件和定时任务会明确标注并路由到可信主工作区,同时不改变当前无工作区会话。已绑定的定时任务运行和历史会携带其工作区所有者;旧的无绑定任务在离开所属工作区时会失败关闭。Git、目标、频道、worktree、设置和直接插入技能等仅限工作区的操作在无工作区模式下仍不可用。
为什么需要
此前启动或发送无工作区任务后,侧边栏会同时移除工作区树、插件和定时任务,让已有项目会话和工作区管理看起来像是消失了。只要 daemon 支持无工作区能力,“新建任务”也会静默优先选择无工作区,即使已有可信工作区。新行为让范围变得明确,在工作区与无工作区任务之间保持稳定导航,并保留现有的信任和会话所有权边界。
Reviewer 测试计划
如何验证
standalone_sessions_v1且具有可信主工作区的 daemon 启动 Web Shell。点击主“新建任务”并发送提示词;应使用该工作区 cwd 创建工作区会话。context=standalone和“无工作区”标签,并且在发送第一条提示词前没有创建会话请求。发送前切回工作区,确认两次范围切换都没有创建会话。证据(修改前后)
自动化浏览器证据:6/6 个无工作区 Playwright 场景通过,包括精确断言
/session与/standalone/sessions请求。真实冷启动验证也观察到工作区 → 无工作区 → 工作区切换期间创建 POST 为 0,并确认已创建的无工作区会话不再显示编辑器工作区选择器。测试平台
环境(可选)
macOS、Node.js 24.12.0,本地执行
npm run dev:daemon,daemon 使用 4170 端口,Vite 使用 5173 端口。Web Shell lint、typecheck 和生产构建通过。定向组件测试通过(WorkspaceSelector 4/4、Sidebar 120/120、Scheduled Tasks 57/57、Skills 7/7),完整 App 测试通过 661/661,无工作区 Playwright 通过 6/6。仓库级构建仍被 main 分支未改动的问题阻塞:packages/cli/src/ui/opentui/commands-registry.ts中"output-style"不能赋值给never。风险与范围
关联问题
#10514 的后续修复。