feat(id): brand WorkspaceID through Drizzle and Zod schemas (#16964)

This commit is contained in:
Kit Langton
2026-03-11 19:30:17 -04:00
committed by GitHub
parent f1c3a44190
commit 16a6d6feba
49 changed files with 205 additions and 157 deletions

View File

@@ -7,6 +7,7 @@ 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 { tmpdir } from "../fixture/fixture"
const projectRoot = path.join(__dirname, "../..")
@@ -24,7 +25,7 @@ describe("revert + compact workflow", () => {
// Create a user message
const userMsg1 = await Session.updateMessage({
id: Identifier.ascending("message"),
id: MessageID.ascending(),
role: "user",
sessionID,
agent: "default",
@@ -48,7 +49,7 @@ describe("revert + compact workflow", () => {
// Create an assistant response message
const assistantMsg1: MessageV2.Assistant = {
id: Identifier.ascending("message"),
id: MessageID.ascending(),
role: "assistant",
sessionID,
mode: "default",
@@ -85,7 +86,7 @@ describe("revert + compact workflow", () => {
// Create another user message
const userMsg2 = await Session.updateMessage({
id: Identifier.ascending("message"),
id: MessageID.ascending(),
role: "user",
sessionID,
agent: "default",
@@ -108,7 +109,7 @@ describe("revert + compact workflow", () => {
// Create another assistant response
const assistantMsg2: MessageV2.Assistant = {
id: Identifier.ascending("message"),
id: MessageID.ascending(),
role: "assistant",
sessionID,
mode: "default",
@@ -200,7 +201,7 @@ describe("revert + compact workflow", () => {
// Create initial messages
const userMsg = await Session.updateMessage({
id: Identifier.ascending("message"),
id: MessageID.ascending(),
role: "user",
sessionID,
agent: "default",
@@ -222,7 +223,7 @@ describe("revert + compact workflow", () => {
})
const assistantMsg: MessageV2.Assistant = {
id: Identifier.ascending("message"),
id: MessageID.ascending(),
role: "assistant",
sessionID,
mode: "default",