feat(web-shell): adopt canonical Goal v3 controls - #9087
Closed
qqqys wants to merge 24 commits into
Closed
Conversation
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.
What this PR does
This PR adopts the canonical Goal v3 control plane in WebShell. Goals can be created before the first chat message, inspected, edited, paused, resumed, replaced, and cleared without routing commands through the model. WebShell presents the active Goal in a compact composer row, keeps that row at the queued-message width, and removes the delete confirmation.
While a Goal is running, ordinary messages remain in a local FIFO queue. They are submitted normally after the Goal stops; only the explicit Insert action enters the active turn. The change also exposes typed Goal state and controls through the daemon, SDK, ACP bridge, and shared WebUI data layer so WebShell has one canonical source of truth.
The TUI keeps its existing visual style and command flow. Token-budget UI and desktop-shell adoption are intentionally excluded.
Why it's needed
The previous WebShell behavior mixed Goal commands with chat prompts, required a conversation before setting a Goal, and allowed queued messages to interrupt autonomous execution unexpectedly. Goal state also had multiple UI-owned interpretations, which produced transient load errors and inconsistent lifecycle rendering.
The canonical control path makes Goal lifecycle changes deterministic, lets a new task start directly with
/goal, preserves queue intent, and gives all consumers the same revisioned Goal snapshot.Reviewer Test Plan
How to verify
/goal <objective>, and confirm a session is created with an active Goal while no ordinary chat prompt is sent.Automated browser coverage runs the complete fresh-session and active-Goal queue chains. A separate PR comment contains the E2E scenario report and captured evidence inventory.
Evidence (Before & After)
Before: WebShell treated Goal setup as part of chat/session state, could require an initial message, used independently sized Goal and queue rows, and could feed ordinary queued messages into the running turn.
After:
/goalcan allocate its own session, the compact Goal row matches the queued-message width, normal messages remain locally queued, explicit Insert is the only mid-turn path, and clear is immediate. TUI remains visually unchanged and was exercised through three tmux chains.Tested on
Environment (optional)
Node.js 22.17.0, local source build, Chromium Playwright against the WebShell daemon harness, and a 140x42 tmux TUI session without sandboxing.
Risk & Scope
Linked Issues
N/A
中文说明
本 PR 做了什么
本 PR 在 WebShell 中接入 canonical Goal v3 控制面。无需先发送聊天消息即可创建 Goal,并可直接查看、编辑、暂停、恢复、替换和清除,不再把这些命令发送给模型。WebShell 在输入框上方展示紧凑的 Goal 状态条,保持排队消息的宽度,同时删除 Goal 时不再弹出确认框。
Goal 运行时,普通消息保留在本地 FIFO 队列中;Goal 停止后再按正常消息发送。只有用户明确点击“插入”时,消息才会进入当前执行轮次。本次还通过 daemon、SDK、ACP bridge 和共享 WebUI 数据层暴露统一的 Goal 状态与控制能力,让 WebShell 使用同一份 canonical 状态。
TUI 保持现有视觉风格和命令流程。本 PR 不包含 token 预算 UI 和桌面端接入。
为什么需要
此前 WebShell 会把 Goal 命令和聊天消息混在一起,设置 Goal 前可能需要先创建会话;排队消息也可能意外中断自治执行。Goal 状态还存在多套 UI 侧解释,造成过瞬时加载错误和生命周期展示不一致。
canonical 控制路径让 Goal 生命周期变更更确定,支持新任务直接从
/goal开始,保留用户的排队意图,并让所有消费者读取同一份带版本的 Goal 快照。Reviewer Test Plan
验证方式
/goal <目标>,确认系统创建会话并激活 Goal,同时没有发送普通聊天消息。自动化浏览器用例覆盖首次创建会话和运行中 Goal 排队的完整链路。PR 的独立评论附有 E2E 场景报告与截图证据清单。
前后对比证据
Before:WebShell 的 Goal 设置依赖聊天/会话状态,可能要求先发送消息;Goal 与排队消息宽度独立;普通排队消息可能进入正在执行的轮次。
After:
/goal可自行分配会话,紧凑 Goal 状态条保持排队消息宽度,普通消息继续本地排队,只有明确点击“插入”才进入当前轮次,清除操作立即生效。TUI 视觉保持不变,并通过三条 tmux 链路验证。测试平台
环境
Node.js 22.17.0、本地源码构建、Chromium Playwright WebShell daemon harness,以及 140x42 无沙箱 tmux TUI 会话。
风险与范围
关联 Issue
N/A