放宽游玩正文判定,并允许错误阶段输入后恢复。
减少长稿被误丢,同时让失败会话可继续推进。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -337,6 +337,18 @@ describe("phase runtime", () => {
|
||||
expect(runtime.getSession().waitingReason).toBeUndefined();
|
||||
});
|
||||
|
||||
it("submitInput recovers from error phase", async () => {
|
||||
const runtime = new PhaseRuntime({ autoStubWorker: true });
|
||||
await runtime.start();
|
||||
await runtime.submitInput("随便写点");
|
||||
await runtime.failRun("fetch failed");
|
||||
expect(runtime.getSession().phase).toBe("error");
|
||||
|
||||
await runtime.submitInput("重试一下");
|
||||
expect(runtime.getSession().phase).not.toBe("error");
|
||||
expect(runtime.getSession().slots.lastUserInput).toBe("重试一下");
|
||||
});
|
||||
|
||||
it("recoverOrphanedRun turns stuck running into node pick when DAG exists", async () => {
|
||||
const runtime = new PhaseRuntime();
|
||||
await runtime.start();
|
||||
|
||||
@@ -445,4 +445,27 @@ describe("sanitizeWorkerSetOutputs", () => {
|
||||
const view = parsePresentPacket(result.outputs["输出.用户展示"], "prose");
|
||||
expect(view.packet.shell).toBe("turn_panel");
|
||||
});
|
||||
|
||||
it("play gm body: keeps a scene that contains dialogue questions", () => {
|
||||
const scene = `神代流把耳机摘下,皱着眉。
|
||||
|
||||
「你在干什么?」她问。与他刚进监控室时不同,教练的吼声还在耳边。
|
||||
|
||||
只要玩家公开跪下认错,她就会放行。`;
|
||||
const result = parseWorkerResponseForTest(scene, ["输出.用户展示"], {
|
||||
preferPlainBody: true,
|
||||
});
|
||||
expect(result.askUser).toBeUndefined();
|
||||
expect(result.outputs["输出.用户展示"]).toContain("你在干什么");
|
||||
expect(result.outputs["输出.用户展示"]).not.toBe("(本轮场面未写完)");
|
||||
});
|
||||
|
||||
it("play gm body: short ask-only text still counts as unfinished", () => {
|
||||
const result = parseWorkerResponseForTest(
|
||||
"这一步还没写出可验收的产物。请再补一点你最在意的体验。",
|
||||
["输出.用户展示"],
|
||||
{ preferPlainBody: true },
|
||||
);
|
||||
expect(result.outputs["输出.用户展示"]).toBe("(本轮场面未写完)");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user