mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-08-31 08:13:11 +03:00
16 lines
543 B
TypeScript
16 lines
543 B
TypeScript
import { expect, test } from "bun:test"
|
|
|
|
import { branchPoints } from "./branch-menu"
|
|
|
|
test("branch points preserve absolute user indices from paginated history", () => {
|
|
expect(branchPoints([
|
|
{ role: "user", content: "question" },
|
|
{ role: "assistant", content: " first\nreply ", forkIndex: 11 },
|
|
{ role: "activity", content: "read_file" },
|
|
{ role: "assistant", content: "second", forkIndex: 12 },
|
|
])).toEqual([
|
|
{ beforeUserIndex: 11, preview: "first reply" },
|
|
{ beforeUserIndex: 12, preview: "second" },
|
|
])
|
|
})
|