copy: 巡检目标与引擎统计摘要去掉「待处理」;格式化改动文件

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-07 02:11:33 +08:00
1 parent d9af105387
commit 25d0a074ca
7 files changed
+10 -8

No files matched your search

@@ -43,7 +43,7 @@ const D = {
method: "get", method: "get",
path: "/engine/stats", path: "/engine/stats",
scope: "admin", scope: "admin",
summary: "按状态计数 / 最老待处理 / 活跃 worker 快照", summary: "按状态计数 / 最早排队的运行 / 活跃 worker",
response: EngineStats, response: EngineStats,
tags, tags,
}, },
@@ -206,8 +206,7 @@ export async function deleteFiles(
body: FilesDeleteRequest, body: FilesDeleteRequest,
): Promise<FilesDeleteResult> { ): Promise<FilesDeleteResult> {
if (body.mode === "permanent") { if (body.mode === "permanent") {
if (!d.options.allowPermanentDelete) if (!d.options.allowPermanentDelete) throw new FilesError("permanent_disabled", "永久删除没有开启。改用回收站");
throw new FilesError("permanent_disabled", "永久删除没有开启。改用回收站");
if (!isAdminSession(principal)) throw new FilesError("forbidden", "永久删除只允许控制台管理员会话"); if (!isAdminSession(principal)) throw new FilesError("forbidden", "永久删除只允许控制台管理员会话");
} }
const downloads = await managedDownloads(d); const downloads = await managedDownloads(d);
@@ -33,7 +33,7 @@ export const BUILTIN_AGENT_CHECKS: {
everyMs: 6 * HOUR, everyMs: 6 * HOUR,
config: { config: {
goalTemplate: goalTemplate:
"巡检待处理({{now}}):有 {{openDecisions}} 条未关闭的需要处理的事项。逐条查看证据,按紧急程度排序," + "巡检事项({{now}}):有 {{openDecisions}} 条未关闭的需要处理的事项。逐条查看证据,按紧急程度排序," +
"给出处理建议和理由。只读,不做任何变更。", "给出处理建议和理由。只读,不做任何变更。",
capabilityAllowlist: [...INVESTIGATE_CAPABILITIES], capabilityAllowlist: [...INVESTIGATE_CAPABILITIES],
budget: { maxToolCalls: 20, maxDurationSec: 300 }, budget: { maxToolCalls: 20, maxDurationSec: 300 },
@@ -14,7 +14,7 @@ describe("renderGoal(巡检目标模板)", () => {
} }
const pending = BUILTIN_AGENT_CHECKS.find((c) => c.key === "check.pending"); const pending = BUILTIN_AGENT_CHECKS.find((c) => c.key === "check.pending");
expect(renderGoal(pending?.config.goalTemplate ?? "", now, facts)).toContain( expect(renderGoal(pending?.config.goalTemplate ?? "", now, facts)).toContain(
"巡检待处理(2026-09-28T18:53:50.468Z):有 3 条未关闭的待处理事项", "巡检事项(2026-09-28T18:53:50.468Z):有 3 条未关闭的需要处理的事项",
); );
}); });
@@ -99,7 +99,9 @@ export function ScrapeRecordView({ record: s, showPath = false }: { record: Scra
<div className="grid gap-2"> <div className="grid gap-2">
<div className="flex flex-wrap items-center gap-2"> <div className="flex flex-wrap items-center gap-2">
<StatusBadge tone={SCRAPE_STATUS[s.status].tone}>{SCRAPE_STATUS[s.status].label}</StatusBadge> <StatusBadge tone={SCRAPE_STATUS[s.status].tone}>{SCRAPE_STATUS[s.status].label}</StatusBadge>
{showPath ? <span className="min-w-0 text-sm break-all text-foreground">{s.path || "(登记目录本身)"}</span> : null} {showPath ? (
<span className="min-w-0 text-sm break-all text-foreground">{s.path || "(登记目录本身)"}</span>
) : null}
{done && (files.length || s.status === "succeeded") ? ( {done && (files.length || s.status === "succeeded") ? (
<span className="text-sm text-muted-foreground">{scrapeCounts(s) || "没有要写的文件"}</span> <span className="text-sm text-muted-foreground">{scrapeCounts(s) || "没有要写的文件"}</span>
) : null} ) : null}
+2 -1
View File
@@ -100,7 +100,8 @@ const when = (r: Rec) => r.finishedAt ?? r.startedAt ?? r.createdAt;
/** 状态:成功不加徽章,其余徽章 + 一句原因;需要处理的再给行内动作 */ /** 状态:成功不加徽章,其余徽章 + 一句原因;需要处理的再给行内动作 */
function StatusCell({ r, onReorganize }: { r: Rec; onReorganize?: () => void }) { function StatusCell({ r, onReorganize }: { r: Rec; onReorganize?: () => void }) {
const progress = recordFileProgress(r); const progress = recordFileProgress(r);
if (r.status === "succeeded" && !r.reason && !r.attention) return <span className="text-muted-foreground">已整理</span>; if (r.status === "succeeded" && !r.reason && !r.attention)
return <span className="text-muted-foreground">已整理</span>;
const line = attentionLine(r) ?? reasonLine(r.reason); const line = attentionLine(r) ?? reasonLine(r.reason);
return ( return (
<div className="flex flex-col items-start gap-0.5"> <div className="flex flex-col items-start gap-0.5">
+1 -1
View File
@@ -218,7 +218,7 @@ export const systemApi = {
method: "get", method: "get",
path: "/engine/stats", path: "/engine/stats",
scope: "admin", scope: "admin",
summary: "按状态计数 / 最老待处理 / 活跃 worker 快照", summary: "按状态计数 / 最早排队的运行 / 活跃 worker",
response: ops.EngineStats, response: ops.EngineStats,
}), }),
cancel: ep({ cancel: ep({