


























@@ -84,6 +84,29 @@ describe("buildTasksReply", () => {
8484expect(reply.text).toContain("approval denied");
8585});
868687+it("lists session-backed video generation tasks for the current session", async () => {
88+createRunningTaskRun({
89+runtime: "cli",
90+taskKind: "video_generation",
91+sourceId: "video_generate:openai",
92+requesterSessionKey: "agent:main:main",
93+childSessionKey: "agent:main:main",
94+runId: "tool:video_generate:tasks-visible",
95+label: "Video generation",
96+task: "friendly lobster surfing",
97+progressSummary: "Queued video generation",
98+deliveryStatus: "not_applicable",
99+notifyPolicy: "silent",
100+});
101+102+const reply = await buildTasksReplyForTest();
103+104+expect(reply.text).toContain("Current session: 1 active · 1 total");
105+expect(reply.text).toContain("🟢 Video generation");
106+expect(reply.text).toContain("CLI · running");
107+expect(reply.text).toContain("Queued video generation");
108+});
109+87110it("sanitizes leaked internal runtime context from visible task details", async () => {
88111createRunningTaskRun({
89112runtime: "acp",
@@ -184,6 +207,31 @@ describe("buildTasksReply", () => {
184207expect(reply.text).not.toContain("hidden progress detail");
185208});
186209210+it("counts session-backed video generation tasks in agent-local fallback", async () => {
211+createRunningTaskRun({
212+runtime: "cli",
213+taskKind: "video_generation",
214+sourceId: "video_generate:openai",
215+requesterSessionKey: "agent:main:other-session",
216+childSessionKey: "agent:main:other-session",
217+runId: "tool:video_generate:tasks-agent-fallback",
218+label: "Video generation",
219+task: "hidden video background task",
220+progressSummary: "Queued video generation",
221+deliveryStatus: "not_applicable",
222+notifyPolicy: "silent",
223+});
224+225+const reply = await buildTasksReplyForTest({
226+sessionKey: "agent:main:empty-session",
227+});
228+229+expect(reply.text).toContain("All clear - nothing linked to this session right now.");
230+expect(reply.text).toContain("Agent-local: 1 active · 1 total");
231+expect(reply.text).not.toContain("hidden video background task");
232+expect(reply.text).not.toContain("Queued video generation");
233+});
234+187235it("uses the canonical target session agent for agent-local fallback counts", async () => {
188236createRunningTaskRun({
189237runtime: "subagent",
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。