chore(vendor): import pi 1.3.0
Imported as a linear vendor commit so forge rebases do not replay the upstream root tree. git-subtree-dir: third_party/pi git-subtree-split: 71023aec1546d6d677a65669c5665c0927ce0dd0
This commit is contained in:
1 parent
719370c8f7
commit
6081e3e325
1743 files changed
+205459
-131704
No files matched your search
Vendored
+15
-16
@@ -201,10 +201,11 @@ describe("regression #2860: replaced session callbacks", () => {
|
||||
expect(replacementSessionFile).not.toBe(oldSessionFile);
|
||||
expect(staleCtxThrows).toBe(true);
|
||||
expect(stalePiThrows).toBe(true);
|
||||
expect(runtime.session.messages.map((message) => `${message.role}:${getText(message)}`)).toEqual([
|
||||
"user:Hello from the new session!",
|
||||
"assistant:hello reply",
|
||||
]);
|
||||
expect(
|
||||
runtime.session.messages
|
||||
.filter((message) => message.role !== "system")
|
||||
.map((message) => `${message.role}:${getText(message)}`),
|
||||
).toEqual(["user:Hello from the new session!", "assistant:hello reply"]);
|
||||
});
|
||||
|
||||
it("supports withSession for fork", async () => {
|
||||
@@ -232,12 +233,11 @@ describe("regression #2860: replaced session callbacks", () => {
|
||||
await runtime.session.prompt("seed");
|
||||
await runtime.session.prompt("/fork-it");
|
||||
|
||||
expect(runtime.session.messages.map((message) => `${message.role}:${getText(message)}`)).toEqual([
|
||||
"user:seed",
|
||||
"assistant:seed reply",
|
||||
"user:fork callback message",
|
||||
"assistant:fork reply",
|
||||
]);
|
||||
expect(
|
||||
runtime.session.messages
|
||||
.filter((message) => message.role !== "system")
|
||||
.map((message) => `${message.role}:${getText(message)}`),
|
||||
).toEqual(["user:seed", "assistant:seed reply", "user:fork callback message", "assistant:fork reply"]);
|
||||
});
|
||||
|
||||
it("supports withSession for switchSession", async () => {
|
||||
@@ -269,11 +269,10 @@ describe("regression #2860: replaced session callbacks", () => {
|
||||
await runtime.session.prompt("/switch-it");
|
||||
|
||||
expect(runtime.session.sessionFile).toBe(targetSessionPath);
|
||||
expect(runtime.session.messages.map((message) => `${message.role}:${getText(message)}`)).toEqual([
|
||||
"user:target",
|
||||
"assistant:target reply",
|
||||
"user:switch callback message",
|
||||
"assistant:switch reply",
|
||||
]);
|
||||
expect(
|
||||
runtime.session.messages
|
||||
.filter((message) => message.role !== "system")
|
||||
.map((message) => `${message.role}:${getText(message)}`),
|
||||
).toEqual(["user:target", "assistant:target reply", "user:switch callback message", "assistant:switch reply"]);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user