@lionel-guo/pi-continue 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lionel-guo/pi-continue",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "private": false,
5
5
  "description": "Recover Pi conversations from aborted and errored assistant replies",
6
6
  "type": "module",
@@ -288,6 +288,42 @@ test("repeated continuations skip all old failures and mark only each latest par
288
288
  });
289
289
  });
290
290
 
291
+ test("/continue starts a successful recovery through the RPC session mode", async () => {
292
+ await withFixture({
293
+ partial: fauxAssistantMessage("partial response", { stopReason: "error" }),
294
+ priorTool: false,
295
+ mode: "rpc",
296
+ }, async (fixture) => {
297
+ fixture.faux.setResponses([
298
+ (context, _options, _state, model) => {
299
+ fixture.providerTranscripts.push(transformMessages(context.messages, model));
300
+ return fauxAssistantMessage("recovered response", { stopReason: "stop" });
301
+ },
302
+ ]);
303
+
304
+ await fixture.session.prompt("/continue");
305
+ await fixture.session.waitForIdle();
306
+
307
+ assert.equal(fixture.faux.state.callCount, 1);
308
+ assert.equal(fixture.notifications.length, 0);
309
+ assert.equal(fixture.providerTranscripts.length, 1);
310
+ const messages = fixture.providerTranscripts[0].filter((message) => message.role !== "system");
311
+ assert.deepEqual(messages.map((message) => message.role), ["user"]);
312
+ assert.equal(JSON.stringify(messages).includes("partial response"), false);
313
+ assert.equal(JSON.stringify(messages).includes("pi-continue-trigger"), false);
314
+
315
+ const entries = fixture.sessionManager.getEntries();
316
+ const marker = entries.find((entry) => entry.type === "custom" && entry.customType === "pi-continue");
317
+ const trigger = entries.find((entry) => entry.type === "custom_message" && entry.customType === "pi-continue-trigger");
318
+ assert.ok(marker);
319
+ assert.ok(trigger);
320
+ const edit = entries.find((entry) => entry.type === "context_edit" && entry.targetId === trigger.id);
321
+ assert.equal(marker.data.stopReason, "error");
322
+ assert.ok(edit);
323
+ assert.equal(edit.replacement, null);
324
+ });
325
+ });
326
+
291
327
  test("a completed continuation cannot be continued again", async () => {
292
328
  await withFixture({
293
329
  partial: fauxAssistantMessage("partial", { stopReason: "aborted" }),