Merge pull request #7733 from Kilo-Org/eshurakov/actually-afterthought

Cli - Include parentSessionId in heartbeat session info
This commit is contained in:
Evgeny Shurakov
2026-03-27 14:17:55 +01:00
committed by GitHub
3 changed files with 14 additions and 0 deletions
@@ -249,6 +249,7 @@ export namespace KiloSessions {
id,
status: statuses[id]?.type ?? "idle",
title: session.title,
parentSessionId: session.parentID,
gitUrl,
gitBranch,
}
@@ -7,6 +7,7 @@ export namespace RemoteProtocol {
id: z.string(),
status: z.string(),
title: z.string(),
parentSessionId: z.string().optional(),
gitUrl: z.string().optional(),
gitBranch: z.string().optional(),
})
@@ -17,6 +17,18 @@ describe("RemoteProtocol", () => {
}
})
test("heartbeat with parentSessionId parses", () => {
const msg = {
type: "heartbeat",
sessions: [{ id: "ses_child", status: "busy", title: "Sub task", parentSessionId: "ses_root" }],
}
const result = RemoteProtocol.Heartbeat.safeParse(msg)
expect(result.success).toBe(true)
if (result.success) {
expect(result.data.sessions[0].parentSessionId).toBe("ses_root")
}
})
test("valid event parses", () => {
const msg = {
type: "event",