feat(id): brand PartID through Drizzle and Zod schemas (#16966)

This commit is contained in:
Kit Langton
2026-03-11 19:40:50 -04:00
committed by GitHub
parent d26c6f80e1
commit 090f636354
21 changed files with 102 additions and 97 deletions

View File

@@ -6,8 +6,7 @@ import { SessionCompaction } from "../../src/session/compaction"
import { MessageV2 } from "../../src/session/message-v2"
import { Log } from "../../src/util/log"
import { Instance } from "../../src/project/instance"
import { Identifier } from "../../src/id/id"
import { MessageID } from "../../src/session/schema"
import { MessageID, PartID } from "../../src/session/schema"
import { tmpdir } from "../fixture/fixture"
const projectRoot = path.join(__dirname, "../..")
@@ -40,7 +39,7 @@ describe("revert + compact workflow", () => {
// Add a text part to the user message
await Session.updatePart({
id: Identifier.ascending("part"),
id: PartID.ascending(),
messageID: userMsg1.id,
sessionID,
type: "text",
@@ -77,7 +76,7 @@ describe("revert + compact workflow", () => {
// Add a text part to the assistant message
await Session.updatePart({
id: Identifier.ascending("part"),
id: PartID.ascending(),
messageID: assistantMsg1.id,
sessionID,
type: "text",
@@ -100,7 +99,7 @@ describe("revert + compact workflow", () => {
})
await Session.updatePart({
id: Identifier.ascending("part"),
id: PartID.ascending(),
messageID: userMsg2.id,
sessionID,
type: "text",
@@ -136,7 +135,7 @@ describe("revert + compact workflow", () => {
await Session.updateMessage(assistantMsg2)
await Session.updatePart({
id: Identifier.ascending("part"),
id: PartID.ascending(),
messageID: assistantMsg2.id,
sessionID,
type: "text",
@@ -215,7 +214,7 @@ describe("revert + compact workflow", () => {
})
await Session.updatePart({
id: Identifier.ascending("part"),
id: PartID.ascending(),
messageID: userMsg.id,
sessionID,
type: "text",
@@ -250,7 +249,7 @@ describe("revert + compact workflow", () => {
await Session.updateMessage(assistantMsg)
await Session.updatePart({
id: Identifier.ascending("part"),
id: PartID.ascending(),
messageID: assistantMsg.id,
sessionID,
type: "text",