fix(schema): preserve session event names
This commit is contained in:
@@ -20,7 +20,7 @@ export const Source = Schema.Struct({
|
||||
end: NonNegativeInt,
|
||||
text: Schema.String,
|
||||
}).annotate({
|
||||
identifier: "SessionEvent.Source",
|
||||
identifier: "session.next.event.source",
|
||||
})
|
||||
export interface Source extends Schema.Schema.Type<typeof Source> {}
|
||||
|
||||
@@ -380,7 +380,7 @@ export const RetryError = Schema.Struct({
|
||||
responseBody: Schema.String.pipe(optional),
|
||||
metadata: Schema.Record(Schema.String, Schema.String).pipe(optional),
|
||||
}).annotate({
|
||||
identifier: "SessionEvent.RetryError",
|
||||
identifier: "session.next.retry_error",
|
||||
})
|
||||
export interface RetryError extends Schema.Schema.Type<typeof RetryError> {}
|
||||
|
||||
|
||||
@@ -47,8 +47,6 @@ describe("contract hygiene", () => {
|
||||
Project.Info,
|
||||
Pty.Info,
|
||||
Session.ListAnchor,
|
||||
SessionEvent.Source,
|
||||
SessionEvent.RetryError,
|
||||
].map((schema) => schema.ast.annotations?.identifier)
|
||||
|
||||
expect(identifiers.every((identifier) => typeof identifier === "string")).toBe(true)
|
||||
|
||||
@@ -1129,7 +1129,7 @@ export type GlobalEvent = {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
attempt: number
|
||||
error: SessionEventRetryError
|
||||
error: SessionNextRetryError
|
||||
}
|
||||
}
|
||||
| {
|
||||
@@ -2971,7 +2971,7 @@ export type ToolFileContent = {
|
||||
|
||||
export type LlmToolContent = ToolTextContent | ToolFileContent
|
||||
|
||||
export type SessionEventRetryError = {
|
||||
export type SessionNextRetryError = {
|
||||
message: string
|
||||
statusCode?: number
|
||||
isRetryable: boolean
|
||||
@@ -3616,7 +3616,7 @@ export type SyncEventSessionNextRetried = {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
attempt: number
|
||||
error: SessionEventRetryError
|
||||
error: SessionNextRetryError
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5048,7 +5048,7 @@ export type V2EventSessionNextRetried = {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
attempt: number
|
||||
error: SessionEventRetryError
|
||||
error: SessionNextRetryError
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6509,7 +6509,7 @@ export type EventSessionNextRetried = {
|
||||
timestamp: number
|
||||
sessionID: string
|
||||
attempt: number
|
||||
error: SessionEventRetryError
|
||||
error: SessionNextRetryError
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user