Files
rootandClaude Opus 5.5 3692793dff 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
2026-10-08 13:56:38 +08:00

24 lines
1.1 KiB
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { describe, expect, it } from "vitest";
import { quickGoalsFor } from "./quick-goals.ts";
describe("新对话的开场建议", () => {
it("按页面给相关问法,最多 2 条", () => {
expect(quickGoalsFor("/console/library/abc")[0]).toBe("这部作品缺哪些版本");
expect(quickGoalsFor("/console/sites/hdsky")[0]).toBe("这个站点登录和 RSS 抓取正常吗");
expect(quickGoalsFor("/console/downloads/t1")[0]).toBe("这个下载为什么没有进展");
expect(quickGoalsFor("/console/organize")[0]).toBe("整理记录里没识别出的作品是什么");
for (const p of ["/console", "/console/library", "/console/files", "/console/downloads/plans", "/nope"]) {
expect(quickGoalsFor(p)).toHaveLength(2);
}
});
it("没有半句话:每条都能直接发出", () => {
const paths = ["/console", "/console/library/x", "/console/sites", "/console/sites/x", "/console/organize/x"];
for (const p of paths)
for (const g of quickGoalsFor(p)) {
expect(g).toBe(g.trim());
expect(g).not.toMatch(/[::]$/);
}
});
});