feat(id): brand SessionID through Drizzle and Zod schemas (#16953)

This commit is contained in:
Kit Langton
2026-03-11 19:16:56 -04:00
committed by GitHub
parent 4e73473119
commit cb67465675
44 changed files with 226 additions and 158 deletions

View File

@@ -1,6 +1,7 @@
import { describe, expect, test } from "bun:test"
import { MessageV2 } from "../../src/session/message-v2"
import { SessionPrompt } from "../../src/session/prompt"
import { SessionID } from "../../src/session/schema"
describe("structured-output.OutputFormat", () => {
test("parses text format", () => {
@@ -96,7 +97,7 @@ describe("structured-output.UserMessage", () => {
test("user message accepts outputFormat", () => {
const result = MessageV2.User.safeParse({
id: "test-id",
sessionID: "test-session",
sessionID: SessionID.descending(),
role: "user",
time: { created: Date.now() },
agent: "default",
@@ -112,7 +113,7 @@ describe("structured-output.UserMessage", () => {
test("user message works without outputFormat (optional)", () => {
const result = MessageV2.User.safeParse({
id: "test-id",
sessionID: "test-session",
sessionID: SessionID.descending(),
role: "user",
time: { created: Date.now() },
agent: "default",
@@ -125,7 +126,7 @@ describe("structured-output.UserMessage", () => {
describe("structured-output.AssistantMessage", () => {
const baseAssistantMessage = {
id: "test-id",
sessionID: "test-session",
sessionID: SessionID.descending(),
role: "assistant" as const,
parentID: "parent-id",
modelID: "claude-3",