feat(agent): 抽屉与会话页统一成一个对话界面,子会话在父会话里实时可见

- 抽屉和会话页渲染同一套 GoalComposer / AgentRunPanel;抽屉标题即最近会话切换,
  头部只有新对话、在页面打开、关闭;去掉右下角悬浮按钮和最小化小窗
- 会话列表合一:对话与巡检混排带类型小标签,搜索 + 一个状态下拉,只列顶层会话
  (GET /agent/runs?roots=true,新增可选参数)
- 子会话卡片:由镜像的 subagent_* 事件折成,显示任务、状态、当前步骤、用时、调用次数、费用,
  可展开看过程、可打开;顶部「N 个子会话运行中」跳到卡片;subagent_completed 加可选 durationMs
- 回答去内部字段:汇报规则禁止照抄键值与字段表;展示层 stripInternalFields 把字段行 / 字段表移进技术信息
- 开场建议按页面给 2 条完整问法、点了直接发;指令只留 /先给方案,/重跑 改成「重新运行」按钮

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Cxwgnn2pbzQ7rXv3rq7fei
This commit is contained in:
rootandClaude Opus 5.5 committed 2026-10-08 13:56:38 +08:00
1 parent dd0f6e2c09
commit 3692793dff
35 files changed
+1454 -1137

No files matched your search

+6 -10
View File
@@ -268,9 +268,9 @@ async function main() {
}
}
// ── 交互:智能体抽屉「历史」弹层(AGUI-3;演示数据,点一条在抽屉内打开、新对话回到输入框、关了再开仍是那条会话)──
// ── 交互:智能体抽屉的最近会话切换(演示数据,点一条在抽屉内打开、新对话回到输入框、关了再开仍是那条会话)──
{
const label = "智能体抽屉 → 历史弹层 → 抽屉内打开会话";
const label = "智能体抽屉 → 最近会话 → 抽屉内打开会话";
problems = [];
const t0 = Date.now();
try {
@@ -280,17 +280,13 @@ async function main() {
const startPath = new URL(page.url()).pathname;
const launcher = page.locator("[data-agent-launcher]:visible").last();
await launcher.click();
await page.getByRole("button", { name: "历史会话" }).click();
await page.getByRole("button", { name: /^最近会话/ }).click();
const list = page.getByRole("navigation", { name: "智能体会话列表" });
await list
.getByRole("button")
.filter({ hasNotText: /^(全部|等你处理|失败)$/ })
.first()
.click();
// 等历史弹层退场后再按 Escape,避免按键被仍在退场的 Popover 消耗。
await list.locator("button[data-run-id]").first().click();
// 等弹层退场后再按 Escape,避免按键被仍在退场的 Popover 消耗。
await list.waitFor({ state: "hidden", timeout: 5_000 });
await page.getByRole("button", { name: "新对话" }).and(page.locator(":enabled")).waitFor({ timeout: 10_000 });
if (new URL(page.url()).pathname !== startPath) problems.push("点历史会话跳走了页面");
if (new URL(page.url()).pathname !== startPath) problems.push("点最近会话跳走了页面");
await page.keyboard.press("Escape");
await page.locator('[data-slot="sheet-content"]').waitFor({ state: "hidden", timeout: 5_000 });
await launcher.click();