mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-04-08 09:49:19 +00:00
feat(id): brand PartID through Drizzle and Zod schemas (#16966)
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user