Skip to content

A local-first multi-agent app development platform, built on PenguinHarness

feat(web,docs): 评估与优化的会话就是普通会话(上游 #969 移植)

lmlihenge20073c3c94b
diff --git a/changelog/unreleased/2026-10-10-evaluation-tasks-list.md b/changelog/unreleased/2026-10-10-evaluation-tasks-list.md
new file mode 100644
index 00000000..6a866e10
--- /dev/null
+++ b/changelog/unreleased/2026-10-10-evaluation-tasks-list.md
@@ -0,0 +1,18 @@
+# The Evaluations folder holds only the Test Sessions an agent starts
+
+- **Date:** 2026-10-10
+- **Type:** fix
+- **Scope:** `web`, `docs`
+
+[中文版](2026-10-10-evaluation-tasks-list.zh.md)
+
+The conversation the Evaluation Center's **Use** dialog opens on its **Evaluate** or **Optimize** tab is an ordinary conversation: it is listed with the agent that carries the work out, and it is no longer filed under the **Evaluations** folder of the session list. The folder is left to the Test Sessions an agent starts itself through `penguin run --source benchmark`, which is how `agent-evaluation` launches each case × run.
+
+This is ported from upstream PenguinHarness (#969, commit `8a774995`).
+
+## Details
+
+- The **Use** dialog stopped marking the conversation it prefills, and the new-chat draft stopped sending that mark as `source` when it creates the Session. A draft an earlier release saved with the mark creates an ordinary Session too — the field-by-field parser drops the field like any other unknown one.
+- Conversations created before this change keep `source: "benchmark"` in their Trace and stay in the **Evaluations** folder: Traces are append-only and the membership rule (`!archived && source === "benchmark"`) is unchanged. Nothing is migrated.
+- The server and the CLI behave as before: `POST …/sessions` still accepts `source: "benchmark"`, which `penguin run --source benchmark` sends for every Test Session. Only the doc comments on `SessionCreateRequest.source` and `CreateSessionOptions.source` changed.
+- The Evaluation Center, Chat and Server API docs were updated to match, in English and Chinese.
diff --git a/changelog/unreleased/2026-10-10-evaluation-tasks-list.zh.md b/changelog/unreleased/2026-10-10-evaluation-tasks-list.zh.md
new file mode 100644
index 00000000..13d6b2aa
--- /dev/null
+++ b/changelog/unreleased/2026-10-10-evaluation-tasks-list.zh.md
@@ -0,0 +1,18 @@
+# 「评估任务」折叠夹只收 Agent 启动的被测会话
+
+- **Date:** 2026-10-10
+- **Type:** fix
+- **Scope:** `web`, `docs`
+
+[English](2026-10-10-evaluation-tasks-list.md)
+
+在评估中心点击**使用**、从**评估**或**优化**标签页打开的对话是普通对话:它归入执行这项工作的 Agent 自己的对话列表,不再归入会话列表的**评估任务**折叠夹。这个折叠夹只收 Agent 经 `penguin run --source benchmark` 自己启动的被测会话 —— `agent-evaluation` 就是这样启动每道题目、每次运行的。
+
+本条移植自上游 PenguinHarness(#969,提交 `8a774995`)。
+
+## 细节
+
+- **使用**对话框不再给预填的对话打标记,新建对话草稿创建 Session 时也不再以 `source` 发送这个标记。早先版本保存的、带这个标记的草稿同样创建为普通 Session —— 逐字段解析器会像丢弃其他未知字段一样把它丢掉。
+- 本次改动之前创建的这类对话,Trace 里仍记着 `source: "benchmark"`,继续留在**评估任务**折叠夹:Trace 只追加,归类规则(`!archived && source === "benchmark"`)也没变。不做任何迁移。
+- 服务端与 CLI 的行为与之前一致:`POST …/sessions` 仍接受 `source: "benchmark"`,`penguin run --source benchmark` 为每个被测会话发送它。只有 `SessionCreateRequest.source` 与 `CreateSessionOptions.source` 的文档注释改了。
+- 评估中心、对话与服务端 API 文档(中英各一份)随之更新。
diff --git a/packages/cli/test/server-commands.test.ts b/packages/cli/test/server-commands.test.ts
index 80799d09..0b7b0ee3 100644
--- a/packages/cli/test/server-commands.test.ts
+++ b/packages/cli/test/server-commands.test.ts
@@ -135,6 +135,16 @@ describe("penguin run", () => {
expect(session.patches).toContainEqual({ thinkingLevel: "high" });
expect("thinkingLevel" in (session.tasks[0] as object)).toBe(false);
});
+
+ it("--source benchmark creates the Session as an evaluation's Test Session; a plain run creates it with no origin", async () => {
+ // How agent-evaluation launches each Test Session, then an ordinary run.
+ expect(await cli(["run", "-m", "case 1, run 1", "--source", "benchmark"])).toBe(0);
+ expect(await cli(["run", "-m", "an ordinary task"])).toBe(0);
+ const creates = server.requests.filter(
+ (r) => r.method === "POST" && r.path.endsWith("/sessions"),
+ );
+ expect(creates.map((r) => r.body?.source)).toEqual(["benchmark", undefined]);
+ });
});
describe("penguin ls", () => {
diff --git a/packages/core/src/agent.ts b/packages/core/src/agent.ts
index 3aa16a88..f25a5c68 100644
--- a/packages/core/src/agent.ts
+++ b/packages/core/src/agent.ts
@@ -248,7 +248,7 @@ export interface CreateSessionOptions {
baseUrl?: string;
/** Internal use: this Session's depth in the subagent spawn chain (0 at the top level), used to cap spawn depth. */
subagentDepth?: number;
- /** Session origin recorded in session_meta (absent = user-created); the subagent spawn site passes "subagent", callers driven by a scheduled task pass "schedule", and a Benchmark evaluation or optimization passes "benchmark". */
+ /** Session origin recorded in session_meta (absent = user-created); the subagent spawn site passes "subagent", callers driven by a scheduled task pass "schedule", and the server passes "benchmark" for the Test Sessions of a Benchmark evaluation, which `penguin run --source benchmark` creates. */
source?: "subagent" | "schedule" | "benchmark";
}
diff --git a/packages/core/src/omnimessage/types.ts b/packages/core/src/omnimessage/types.ts
index 317a4f43..2b6205f4 100644
--- a/packages/core/src/omnimessage/types.ts
+++ b/packages/core/src/omnimessage/types.ts
@@ -141,7 +141,7 @@ export interface SessionMetaPayload {
agent_state: string;
/** Absolute path to the Workspace. */
workspace: string;
- /** Session origin: spawned by a subagent / triggered by a scheduled task / created by a Benchmark evaluation or optimization; absent = user-created. */
+ /** Session origin: spawned by a subagent / triggered by a scheduled task / a Benchmark evaluation's Test Session, created by `penguin run --source benchmark`; absent = user-created. */
source?: "subagent" | "schedule" | "benchmark";
}
diff --git a/packages/docs/content/chat.en.md b/packages/docs/content/chat.en.md
index 001cdfbe..bb1dff3a 100644
--- a/packages/docs/content/chat.en.md
+++ b/packages/docs/content/chat.en.md
@@ -352,7 +352,7 @@ The background-task mark does not depend on the others: an idle conversation who
Below each group's active conversations are its folders: **Subagents**, **Scheduled**, **Evaluations** and **Archived**, each loading its rows only when opened. When grouped by time, one set of folders covers the whole Project, and **Load more chats** fetches older conversations.
-- **Evaluations** holds the conversations opened by **Use** in the [Evaluation Center](/evaluation-center), and the Test Sessions an evaluation starts for every case and run, so they do not crowd the tested agent's list.
+- **Evaluations** holds the Test Sessions an evaluation starts for every case and run, so they do not crowd the tested agent's list. The conversation that **Use** opens in the [Evaluation Center](/evaluation-center) is an ordinary conversation and is not filed there.
- Opening a subagent, scheduled or evaluation conversation opens its folder.
- A group with nothing but folder rows, such as an agent that has only run evaluations, starts collapsed and sorts after the other groups (pinned groups excepted), with a dimmed header counting the folded rows. Once you open it, it stays open for that Project.
diff --git a/packages/docs/content/chat.zh.md b/packages/docs/content/chat.zh.md
index 4b4f87a6..8ca157a8 100644
--- a/packages/docs/content/chat.zh.md
+++ b/packages/docs/content/chat.zh.md
@@ -352,7 +352,7 @@ Task 运行时输入了内容,发送按钮的行为取决于 + 菜单底部的
每个分组的活跃对话下方是它的折叠夹:**子智能体**、**定时任务**、**评估任务**和**已归档**,各自在展开时才加载其中的对话。按时间分组时,整个 Project 共用一组折叠夹,**加载更多会话**用来加载更早的对话。
-- **评估任务**收纳在[评估中心](/evaluation-center)点击**使用**打开的对话,以及评估为每道题目、每次运行启动的测试 Session,这样它们就不会挤满被测 Agent 的列表。
+- **评估任务**收纳评估为每道题目、每次运行启动的测试 Session,这样它们就不会挤满被测 Agent 的列表。在[评估中心](/evaluation-center)点击**使用**打开的对话是普通对话,不归入这里。
- 打开子 Agent、定时任务或评估的对话时,它所在的折叠夹会自动展开。
- 只有折叠夹、没有活跃对话的分组(例如只跑过评估的 Agent)默认折叠,排在其他分组之后(置顶的分组除外),分组标题变浅,并显示折叠的对话数。展开过一次后,在这个 Project 中会一直保持展开。
diff --git a/packages/docs/content/evaluation-center.en.md b/packages/docs/content/evaluation-center.en.md
index b87184d3..4b12ac34 100644
--- a/packages/docs/content/evaluation-center.en.md
+++ b/packages/docs/content/evaluation-center.en.md
@@ -142,7 +142,7 @@ An evaluation runs an agent on every case of a Benchmark and adds one labelled s
The dialog has no field for the model or thinking level the tested agent runs on. **Model of the evaluation conversation** only sets the model of the conversation that dispatches and totals the runs.
-The evaluation conversation, and every Test Session it starts, is filed under the **Evaluations** folder of the session list. The finished evaluation becomes the newest row of the Benchmark's **Evaluations** table.
+The evaluation conversation is an ordinary conversation in the session list. Every Test Session the evaluator starts (`penguin run --source benchmark`) is filed under the **Evaluations** folder. The finished evaluation becomes the newest row of the Benchmark's **Evaluations** table.
## Optimize an agent
diff --git a/packages/docs/content/evaluation-center.zh.md b/packages/docs/content/evaluation-center.zh.md
index 8862fec9..3a99aaa5 100644
--- a/packages/docs/content/evaluation-center.zh.md
+++ b/packages/docs/content/evaluation-center.zh.md
@@ -142,7 +142,7 @@ Builder 试测题目和记录基线分时,都用这个新对话的模型来运
对话框里没有设置被测 Agent 所用模型和思考等级的字段。**评估会话使用的模型**只决定派发和汇总评测的那个会话使用什么模型。
-评估会话,以及它启动的每个被测会话,都归入会话列表的**评估任务**折叠夹。评估完成后,会成为这个 Benchmark **评估明细**表的最新一行。
+评估会话是会话列表里的普通对话。执行评估的 Agent 启动的每个被测会话(`penguin run --source benchmark`)都归入**评估任务**折叠夹。评估完成后,会成为这个 Benchmark **评估明细**表的最新一行。
## 优化 Agent
diff --git a/packages/docs/content/server-api.en.md b/packages/docs/content/server-api.en.md
index 8595ee99..7c603e5a 100644
--- a/packages/docs/content/server-api.en.md
+++ b/packages/docs/content/server-api.en.md
@@ -633,7 +633,7 @@ The paths below omit the `/api/projects/:projectId` prefix.
- On creation, `modelId` and `provider` go together: send the complete pair to pick a model, or omit both to use the Project's default model. Sending only one is a 400.
- An explicit `workspace` must be an existing directory; it is never created. When omitted, the Workspace is a temporary one created automatically. The approval mode defaults to `allow-all`.
- `client` is a provenance hint stored on the row: `"cli"` from the CLI, `"web"` by default. The server itself writes `"org"` on an organization's desk and ticket sessions, and a client cannot send that value. Only `excludeOrg` reads it as a filter, and only to drop those rows.
-- `source` accepts only `"benchmark"`, for a Session created by a Benchmark evaluation or optimization. The server sets `subagent` and `schedule` itself.
+- `source` accepts only `"benchmark"`, which the CLI sends for `penguin run --source benchmark`: the Test Sessions a Benchmark evaluation starts. The Web App does not send it. The server sets `subagent` and `schedule` itself.
- `GET /dirs` starts at the home directory when `path` is omitted; an explicit `path` must be absolute. It answers `{path, parent, entries, platform}`: every entry carries its `kind` (`dir` or `file`) and `mtime`, and on Windows an entry the system hides (the hidden attribute: `AppData`, `NTUSER.DAT`) carries `hidden: true`. A bare drive such as `D:` is taken as its root `D:\`. The home request with `places=1` adds what the picker's sidebar shows: `standardFolders` (Desktop, Documents, Downloads and Pictures as the machine resolves them — Windows known folders, Linux XDG user directories — omitted when they could not be read) and `locations` (Windows drives, macOS volumes, the Linux root and its mounts under `/media`, `/run/media` and `/mnt`, each with its `kind` and, when it has one, its `label`). A directory the server may not read answers `403 dir_permission_denied` rather than an empty list — on macOS that is usually a Files and Folders permission the user has not granted.
- `POST /dirs/access` is the Workspace picker's **Allow access** in the desktop app. macOS asks about Desktop, Documents and Downloads only on behalf of the app it holds responsible for the read, so the desktop shell's main process reads the absolute `path` once, and the answer waits for the user. `granted` says whether the read succeeded (always `true` off macOS, where nothing is read). `packaged` is `false` for a development instance started from a terminal, whose reads macOS charges to that terminal. The route returns `400` `dir_not_absolute` for a path that is not absolute, `503` `shell_unreachable` when the server has no desktop shell to ask, and `504` `timeout` when the shell has not answered within 120 seconds. Only the desktop app's own window may call it; any other session gets `403` `desktop_shell_only`.
- `GET /dir-skills` reads only `<path>/.agents/skills` and `<path>/.claude/skills` of an absolute `path`, and answers `{path, skills}`. A directory without Skills answers with an empty list. See `POST /agents` under [Agents](#agents).
diff --git a/packages/docs/content/server-api.zh.md b/packages/docs/content/server-api.zh.md
index fdcf314d..1e695310 100644
--- a/packages/docs/content/server-api.zh.md
+++ b/packages/docs/content/server-api.zh.md
@@ -633,7 +633,7 @@ Benchmark 属于 Project,不属于某个 Agent:一个 Benchmark 可以评估
- 创建时 `modelId` 和 `provider` 必须成对出现:要指定模型就传完整一对,两个都省略则使用 Project 的默认模型。只传一个返回 400。
- 显式传入的 `workspace` 必须是已存在的目录,永远不会自动创建。省略时自动创建一个临时 Workspace。审批模式默认 `allow-all`。
- `client` 是记录在数据行上的来源提示:CLI 发起的请求为 `"cli"`,默认 `"web"`。组织的工位会话和工单会话由服务器自己写入 `"org"`,客户端不能发送这个值。只有 `excludeOrg` 会把它当作过滤条件,而且只用来剔除这些行。
-- `source` 只接受 `"benchmark"`,用于 Benchmark 评估或优化创建的 Session。`subagent` 和 `schedule` 由服务器自己设置。
+- `source` 只接受 `"benchmark"`,由 CLI 的 `penguin run --source benchmark` 发送,用于 Benchmark 评估启动的被测会话;Web App 不发送它。`subagent` 和 `schedule` 由服务器自己设置。
- `GET /dirs` 省略 `path` 时从主目录开始;显式传入的 `path` 必须是绝对路径。响应为 `{path, parent, entries, platform}`:每个条目带 `kind`(`dir` 或 `file`)与 `mtime`;在 Windows 上,系统隐藏的条目(带隐藏属性,如 `AppData`、`NTUSER.DAT`)另带 `hidden: true`,只写盘符如 `D:` 即视为其根目录 `D:\`。请求主目录并带 `places=1` 时,另附选择器左栏所需的两项:`standardFolders`(桌面、文档、下载、图片,按该机器自己的规则取得——Windows 的已知文件夹、Linux 的 XDG 用户目录;读取失败时省略)与 `locations`(Windows 的各盘符、macOS 的各卷、Linux 的根目录及 `/media`、`/run/media`、`/mnt` 下的挂载点,各带 `kind`,有名称时带 `label`)。服务无权读取的目录返回 `403 dir_permission_denied`,不再按空列表返回;在 macOS 上这通常是用户尚未授予的「文件与文件夹」权限。
- `POST /dirs/access` 是桌面端 Workspace 选择器里的**允许访问**。macOS 只替它认定为读取责任方的应用询问桌面、文稿与下载的访问权限,因此由桌面 shell 的主进程把绝对路径 `path` 读一次,响应要等用户作答后才返回。`granted` 表示这次读取是否成功(非 macOS 平台不读取,恒为 `true`)。`packaged` 为 `false` 表示这是从终端启动的开发实例,macOS 把它的读取记在该终端名下。`path` 不是绝对路径时返回 `400` `dir_not_absolute`;服务器没有可询问的桌面 shell 时返回 `503` `shell_unreachable`;shell 在 120 秒内没有应答时返回 `504` `timeout`。只有桌面应用自己的窗口可以调用,其他会话返回 `403` `desktop_shell_only`。
- `GET /dir-skills` 只读取绝对路径下的 `<path>/.agents/skills` 和 `<path>/.claude/skills`,响应为 `{path, skills}`。没有 Skill 的目录返回空列表。参见 [Agent](#agent) 一节中的 `POST /agents`。
diff --git a/packages/server/src/api/types.ts b/packages/server/src/api/types.ts
index c1aaf0c8..1deea8c9 100644
--- a/packages/server/src/api/types.ts
+++ b/packages/server/src/api/types.ts
@@ -43,7 +43,7 @@ export type ApprovalMode = "allow-all" | "deny-all" | "read-only" | "always-ask"
/** Session run status: idle / Task in progress / compacting. */
export type SessionStatus = "idle" | "running" | "compacting";
-/** Session source marker (default = user-created): triggered by Schedule / registered as a subagent session / created by a Benchmark evaluation or optimization. */
+/** Session source marker (default = user-created): triggered by Schedule / registered as a subagent session / a Benchmark evaluation's Test Session, created by `penguin run --source benchmark`. */
export type SessionSource = "schedule" | "subagent" | "benchmark";
// ---------------------------------------------------------------------------
@@ -1843,10 +1843,12 @@ export interface SessionCreateRequest {
*/
client?: "web" | "cli" | "org";
/**
- * Marks the Session as created by a Benchmark evaluation or optimization (the Evaluation
- * Center's Use flows, and the Test Sessions agent-evaluation launches through the CLI). Only
- * this value is accepted from a client: `subagent` and `schedule` are written by the server
- * itself. The Web App files such Sessions into the Evaluations folder of the session list.
+ * Marks the Session as a Test Session of a Benchmark evaluation: the CLI sends it for
+ * `penguin run --source benchmark`, which agent-evaluation uses to launch every Test Session.
+ * Only this value is accepted from a client: `subagent` and `schedule` are written by the
+ * server itself. The Web App files such Sessions into the Evaluations folder of the session
+ * list and never sends the field: the conversation the Evaluation Center's Use dialog opens is
+ * an ordinary Session.
*/
source?: "benchmark";
}
diff --git a/packages/server/src/services/session-service.ts b/packages/server/src/services/session-service.ts
index 0b160784..1a94e724 100644
--- a/packages/server/src/services/session-service.ts
+++ b/packages/server/src/services/session-service.ts
@@ -593,9 +593,9 @@ export class SessionService {
/** Whether the creator is an administrator (may loosen past the settings). Default false. */
isAdmin?: boolean;
/**
- * Session source marker: `schedule` when triggered by a scheduled task, `benchmark` when
- * created by a Benchmark evaluation or optimization (the only value a client may send);
- * defaults to user-created.
+ * Session source marker: `schedule` when triggered by a scheduled task, `benchmark` for a
+ * Test Session of a Benchmark evaluation, which `penguin run --source benchmark` creates
+ * (the only value a client may send); defaults to user-created.
*/
source?: "schedule" | "benchmark";
/**
diff --git a/packages/web/src/features/ai-create/ai-bridge.ts b/packages/web/src/features/ai-create/ai-bridge.ts
index 0721e2fb..60181a1f 100644
--- a/packages/web/src/features/ai-create/ai-bridge.ts
+++ b/packages/web/src/features/ai-create/ai-bridge.ts
@@ -32,8 +32,6 @@ export interface AiChatRequest {
skills?: string[];
/** Pins the new conversation's model (a paired reference); absent, the draft keeps its cached carry-over. */
modelRef?: ModelRefDto;
- /** Marks the new conversation as a Benchmark evaluation / optimization run; the sidebar files it under the Evaluations folder. */
- source?: "benchmark";
}
/** What the draft page finds in `location.state` after openAiChat. */
@@ -59,10 +57,6 @@ export function buildAiDraft(existing: DraftCache, req: AiChatRequest): DraftCac
};
if (req.workspace !== undefined) draft.workspace = req.workspace;
if (req.modelRef !== undefined) draft.modelRef = req.modelRef;
- // Carried only for the request that asks for it: a mark the slot still holds from an earlier
- // composed prompt would otherwise follow an unrelated conversation into the Evaluations folder.
- if (req.source !== undefined) draft.source = req.source;
- else delete draft.source;
delete draft.handoffAgentId;
return draft;
}
diff --git a/packages/web/src/features/benchmark/use-benchmark-modal.tsx b/packages/web/src/features/benchmark/use-benchmark-modal.tsx
index da8d48a8..4ac92de2 100644
--- a/packages/web/src/features/benchmark/use-benchmark-modal.tsx
+++ b/packages/web/src/features/benchmark/use-benchmark-modal.tsx
@@ -16,6 +16,9 @@
* agent-evaluation. The evaluation runtime is never picked in this dialog —
* Evaluate takes the tested agent's own configured model and thinking level, and Optimize reuses
* what that agent's baseline recorded, so scores stay comparable. Mounted fresh per Benchmark.
+ *
+ * The conversation is an ordinary Session, listed with the agent's own: only the Test Sessions
+ * it starts through `penguin run --source benchmark` are filed under the Evaluations folder.
*/
import { useEffect, useState } from "react";
import type {
@@ -184,9 +187,6 @@ export function UseBenchmarkModal({
text,
skills: tab === "evaluate" ? [EVALUATION_SKILL] : [OPTIMIZATION_SKILL, EVALUATION_SKILL],
...(ref !== undefined ? { modelRef: ref } : {}),
- // An evaluation / optimization run, not a conversation of the user's own: the session
- // list files it, and the Test Sessions it launches, under the Evaluations folder.
- source: "benchmark",
});
onClose();
};
diff --git a/packages/web/src/features/chat/draft-cache.ts b/packages/web/src/features/chat/draft-cache.ts
index bcf3530b..b1e7339f 100644
--- a/packages/web/src/features/chat/draft-cache.ts
+++ b/packages/web/src/features/chat/draft-cache.ts
@@ -59,13 +59,6 @@ export interface DraftCache {
* Dropped by the first edit: from then on the text is the user's and is cached like any other.
*/
aiPrefill?: true;
- /**
- * The conversation this draft creates is a Benchmark evaluation / optimization run (the
- * Evaluation Center's Use dialog): written by the same bridge as aiPrefill and sent on as
- * `SessionCreateRequest.source`, which files the Session under the sidebar's Evaluations
- * folder. Like aiPrefill it lives and dies with the draft it seeds — nothing else sets it.
- */
- source?: "benchmark";
}
/** Minimal storage interface (a subset of localStorage). */
@@ -126,7 +119,6 @@ export function draftFromUnknown(parsed: unknown): DraftCache {
if (skills.length > 0) out.skills = skills;
}
if (o.aiPrefill === true) out.aiPrefill = true;
- if (o.source === "benchmark") out.source = "benchmark";
if (
typeof o.approvalMode === "string" &&
APPROVAL_MODES.includes(o.approvalMode as ApprovalMode)
diff --git a/packages/web/src/features/chat/draft-view.tsx b/packages/web/src/features/chat/draft-view.tsx
index d6827dbc..9719d9fe 100644
--- a/packages/web/src/features/chat/draft-view.tsx
+++ b/packages/web/src/features/chat/draft-view.tsx
@@ -560,9 +560,6 @@ export function DraftView({
// Carried through every write, so a reload finds the prefill still marked as composed
// rather than resuming it as if it had been typed here.
if (aiPrefillRef.current) data.aiPrefill = true;
- // The evaluation mark the Evaluation Center's Use dialog set on this draft rides along for
- // the same reason: after a reload the Session must still be created as an evaluation run.
- if (cached.source !== undefined) data.source = cached.source;
// A parked draft writes back into its own list entry; the active draft into its slot.
if (draftId !== undefined) saveDraftSession(userId, projectId, draftId, data);
else saveDraft(draftKey(userId, projectId), data);
@@ -577,7 +574,6 @@ export function DraftView({
approvalMode,
sandboxPick,
modelRef,
- cached.source,
]);
// The timer and unmount cleanup read persistNow via a ref to always get the **latest version**: a stale closure would write back outdated options.
@@ -759,9 +755,6 @@ export function DraftView({
body.provider = modelRef.provider;
}
if (workspace.trim()) body.workspace = workspace.trim();
- // A draft the Evaluation Center's Use dialog composed creates its Session as an
- // evaluation run, which the sidebar files under the Evaluations folder.
- if (cached.source !== undefined) body.source = cached.source;
// Created ON the machine that owns the workspace: that server runs the agent in it.
const created = await api.createSession(projectId, agentId, body, workspaceMachine);
createdId = created.session.sessionId;
@@ -807,7 +800,6 @@ export function DraftView({
sandboxPick,
modelRef,
workspace,
- cached.source,
add,
discardDraft,
navigate,
diff --git a/packages/web/src/features/chat/new-chat.ts b/packages/web/src/features/chat/new-chat.ts
index 63b4be32..b28ccc2b 100644
--- a/packages/web/src/features/chat/new-chat.ts
+++ b/packages/web/src/features/chat/new-chat.ts
@@ -35,10 +35,9 @@ export function newChatAgentId(
* parked as a draft conversation (parkActiveDraft), then the slot is rewritten to the two things
* a new chat carries over, the model (as after any park or send) and staged skills. Everything
* else a text-less draft left there is released: its Agent / Workspace / approval-mode
- * selections, so the draft seeds them afresh, and the evaluation-run mark (`source`), which
- * would otherwise file the next ordinary conversation under Evaluations. The slot is rebuilt
- * from what stays rather than stripped of what goes, so a field the cache gains later starts
- * released too. Returns the parked entry's id, or null when nothing was typed.
+ * selections, so the draft seeds them afresh. The slot is rebuilt from what stays rather than
+ * stripped of what goes, so a field the cache gains later starts released too. Returns the
+ * parked entry's id, or null when nothing was typed.
*/
export function prepareNewChatDraft(
userId: string,
diff --git a/packages/web/test/draft-cache.test.ts b/packages/web/test/draft-cache.test.ts
index 76811c65..8da2d438 100644
--- a/packages/web/test/draft-cache.test.ts
+++ b/packages/web/test/draft-cache.test.ts
@@ -5,7 +5,8 @@
* - A stored draft is validated field by field: bad JSON or a non-object reads as an empty
* draft, wrongly typed, unknown or half fields are dropped and the rest kept (the permission
* picks, the paired model references, the AI-prefill mark only as true, the approval mode's
- * four values, the skills list); a legacy string model id is always dropped.
+ * four values, the skills list); a legacy string model id is always dropped, and so is the
+ * evaluation mark an earlier release saved with an Evaluation Center draft.
* - Saved drafts read back equal; Project and Session drafts, and two users' drafts of the
* same Project, never read or overwrite each other (#68); a cleared draft reads as empty.
* - Dropping the model pin keeps everything else; dropping the `[default_chat]`-seeded
@@ -96,6 +97,19 @@ describe("parseDraft (field-by-field validation)", () => {
expect(parseDraft(JSON.stringify({ modelRef: { provider: "anthropic" } }))).toEqual({});
});
+ it("an Evaluation Center draft an earlier release saved reads back as an ordinary one, without its evaluation mark", () => {
+ // Use -> Evaluate once seeded the slot with its prompt and `source: "benchmark"`, which the
+ // draft page sent on to file the Session under Evaluations. Read after an upgrade, the draft
+ // keeps the prompt and creates an ordinary Session.
+ const draft = {
+ text: "evaluate",
+ agentId: "evaluator",
+ skills: ["agent-evaluation"],
+ aiPrefill: true,
+ };
+ expect(parseDraft(JSON.stringify({ ...draft, source: "benchmark" }))).toEqual(draft);
+ });
+
it("the staged /model target validates exactly like modelRef: half references and non-objects are dropped", () => {
// The staged switch chip is cached alongside the text it belongs to (a chip lost while its
// text survived would send that text to the current session on the old model), so a
diff --git a/packages/web/test/new-chat.test.ts b/packages/web/test/new-chat.test.ts
index 2e922a1f..a2dd6d98 100644
--- a/packages/web/test/new-chat.test.ts
+++ b/packages/web/test/new-chat.test.ts
@@ -6,8 +6,7 @@
* default_agent wherever it sits, else the first Agent, else none.
* - Preparing the draft parks typed text with its selections, then leaves only the model
* carry-over and staged skills in the active slot: a text-less draft's other selections
- * and an emptied evaluation draft's run mark are released, a slot holding nothing it keeps
- * is emptied, and an empty slot is left alone.
+ * are released, a slot holding nothing it keeps is emptied, and an empty slot is left alone.
*/
import { describe, expect, it } from "vitest";
import type { AgentSummary } from "@lmliheng/penguin-server/api";
@@ -67,39 +66,11 @@ describe("prepareNewChatDraft", () => {
});
});
- it("drops an emptied evaluation draft's run mark, so the next New chat is not an evaluation run", () => {
- const s = memoryStorage();
- // Evaluation Center -> Use -> Evaluate seeds the slot with a composed prompt marked as an
- // evaluation run. Editing the prompt drops aiPrefill, and deleting all of it leaves this
- // behind (the draft page's persist): no text to park, but the run mark is still set, and a
- // draft that reads it creates its Session with `source: "benchmark"`.
- saveDraft(
- draftKey("u-eval", "proj"),
- {
- text: "",
- agentId: "evaluator",
- workspace: "",
- approvalMode: "allow-all",
- modelRef: { provider: "deepseek", modelId: "deepseek-v4-pro" },
- skills: ["agent-evaluation"],
- source: "benchmark",
- },
- s,
- );
- expect(prepareNewChatDraft("u-eval", "proj", s)).toBeNull();
- const slot = loadDraft(draftKey("u-eval", "proj"), s);
- expect(slot.source).toBeUndefined();
- expect(slot).toEqual({
- modelRef: { provider: "deepseek", modelId: "deepseek-v4-pro" },
- skills: ["agent-evaluation"],
- });
- });
-
it("empties a slot that holds nothing it keeps", () => {
const s = memoryStorage();
saveDraft(
draftKey("u-nothing-kept", "proj"),
- { text: " ", agentId: "coder", handoffAgentId: "writer", source: "benchmark" },
+ { text: " ", agentId: "coder", handoffAgentId: "writer" },
s,
);
expect(prepareNewChatDraft("u-nothing-kept", "proj", s)).toBeNull();
diff --git a/packages/web/test/session-grouping.test.ts b/packages/web/test/session-grouping.test.ts
index e01d38f7..77c33031 100644
--- a/packages/web/test/session-grouping.test.ts
+++ b/packages/web/test/session-grouping.test.ts
@@ -11,7 +11,8 @@
* folds every temporary Workspace into one trailing group per machine, keeps one path on two
* machines apart, and keeps archived rows in their group.
* - A Session's folder is decided by archived first, then its source; partitioning keeps the
- * order inside each folder, and benchmark runs get a folder of their own.
+ * order inside each folder, and the Test Sessions an evaluation starts get a folder of their
+ * own while the evaluation conversation stays an active row.
* - The auto-opened "last conversation" is the most recently active user or scheduled row
* (ties by id), never an archived, subagent or benchmark one.
* - A page fetched with one extra row reports whether the server has more, never showing it.
@@ -336,17 +337,17 @@ describe("latestConversation (the auto-opened 'last conversation')", () => {
});
});
-describe("benchmark Sessions (the Evaluation Center's runs)", () => {
- it("files a benchmark Session into its own folder and never auto-opens it", () => {
- // The Test Session an evaluation launches for a Case × Run, active more recently than
- // anything the user opened themselves.
+describe("benchmark Sessions (the Test Sessions an evaluation starts)", () => {
+ it("files a Test Session into the Evaluations folder and never auto-opens it, while the evaluation conversation stays an active row", () => {
+ // The conversation the Evaluation Center's Use dialog opened carries no source; the Test
+ // Session it launched for a Case × Run (`penguin run --source benchmark`) ran after it.
+ const evaluation = session("/srv/a", "2026-07-02T10:00:00.000Z");
const run = session("/srv/a", "2026-07-08T10:00:00.000Z", { source: "benchmark" });
- const user = session("/srv/a", "2026-07-02T10:00:00.000Z");
- const parts = partitionSessions([run, user]);
+ const parts = partitionSessions([run, evaluation]);
expect(parts.benchmark.map((s) => s.sessionId)).toEqual([run.sessionId]);
- expect(parts.active.map((s) => s.sessionId)).toEqual([user.sessionId]);
- // The evaluator's run is not the conversation the user was last in.
- expect(latestConversation([run, user])).toBe(user);
+ expect(parts.active.map((s) => s.sessionId)).toEqual([evaluation.sessionId]);
+ // The conversation the user was last in is the evaluation they sent, not a run it launched.
+ expect(latestConversation([run, evaluation])).toBe(evaluation);
});
});