Skip to content

Commit 6eead27

Browse files
test(pi): wait for the pump to see compaction_start before sending the held prompt
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 6614449 commit 6eead27

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

‎packages/provider-pi/src/server/adapter.test.ts‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4167,6 +4167,14 @@ describe("PiAdapterV2", () => {
41674167

41684168
fake.setCompacting(true);
41694169
yield* fake.emit({ type: "compaction_start", reason: "manual" });
4170+
// The dialog proves the pump observed compaction_start before the prompt.
4171+
yield* fake.emit({
4172+
type: "extension_ui_request",
4173+
id: "detached-compaction-dialog",
4174+
method: "confirm",
4175+
title: "Continue?",
4176+
});
4177+
yield* takeEvent((event) => event.type === "runtime_request.updated");
41704178
yield* startTurn(
41714179
runtime,
41724180
providerThread,
@@ -4178,6 +4186,14 @@ describe("PiAdapterV2", () => {
41784186
);
41794187
fake.setCompacting(false);
41804188
const compactionEnded = fake.allRequests().length;
4189+
assert.isFalse(
4190+
fake
4191+
.allRequests()
4192+
.some(
4193+
(request) =>
4194+
request["type"] === "prompt" && request["message"] === "Sent during compaction",
4195+
),
4196+
);
41814197
yield* fake.emit({
41824198
type: "compaction_end",
41834199
reason: "manual",

0 commit comments

Comments
 (0)