Skip to content

Commit 36dffe9

Browse files
committed
fix: correctly set parent call from for run
Signed-off-by: Donnie Adams <[email protected]>
1 parent e1c14fa commit 36dffe9

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/gptscript.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ export class Run {
569569
}
570570
} else if ((f.type as string).startsWith("call")) {
571571
f = f as CallFrame
572-
if (f.parentID === "" && this.parentCallId === "") {
572+
if (!f.parentID && this.parentCallId === "") {
573573
this.parentCallId = f.id
574574
}
575575
this.calls[f.id] = f

tests/gptscript.test.ts

+1
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ describe("gptscript module", () => {
7979

8080
expect(out).toContain("Calvin Coolidge")
8181
expect(err).toEqual("")
82+
expect(run.parentCallFrame()).toBeTruthy()
8283
})
8384

8485
test("evaluate executes a prompt correctly with context", async () => {

0 commit comments

Comments
 (0)