fix(core): preserve structured error messages (#33530)

This commit is contained in:
Aiden Cline
2026-06-23 18:43:59 -05:00
committed by GitHub
parent 10f6bb7878
commit c17b9557f1
11 changed files with 73 additions and 9 deletions
+6 -1
View File
@@ -29,7 +29,12 @@ export interface BoundResult {
export class StorageError extends Schema.TaggedErrorClass<StorageError>()("ToolOutputStore.StorageError", {
operation: Schema.Literals(["encode", "write"]),
cause: Schema.Defect(),
}) {}
}) {
override get message() {
const detail = this.cause instanceof Error ? this.cause.message : String(this.cause)
return `Failed to ${this.operation} tool output${detail ? `: ${detail}` : ""}`
}
}
export type Error = StorageError