Skip to content

Commit cbe8b2b

Browse files
committed
test: cover message-only ACP Prompt failures
1 parent 648c44a commit cbe8b2b

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

‎packages/acp/tests/provider.test.ts‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,25 @@ function* collectPrompt(
102102
}
103103

104104
describe("Tier AP — ACPX provider", () => {
105+
it("1039 A3: a message-only upstream failure supplies no inferred diagnosis", function* () {
106+
const harness = createFakeRuntime();
107+
harness.script({ result: { status: "failed", error: { message: "Internal error" } } });
108+
yield* installProvider(harness);
109+
const { events } = yield* collectPrompt("do once");
110+
const terminal = events.find((event) => event.type === "terminal");
111+
expect(terminal?.error?.message).toBe("Internal error");
112+
expect(terminal?.error?.cause).toBe(undefined);
113+
expect(
114+
terminal?.error && Reflect.get(terminal.error, "executablemd.agent.prompt-diagnostic"),
115+
).toEqual({
116+
provider: "acp",
117+
operation: "session/prompt",
118+
stage: "runtime-turn",
119+
requestId: harness.turns[0].turn.requestId,
120+
});
121+
expect(harness.turns).toHaveLength(1);
122+
});
123+
105124
it("1039 A1: runtime classification and actual request correlation survive mapping", function* () {
106125
const harness = createFakeRuntime();
107126
harness.script({

0 commit comments

Comments
 (0)