Forked from OpenCode v1.17.4 with multi-agent system: - 5 agents: aircoding, scheduler, worker, architect, reviewer - Deterministic DAG scheduling engine (coordinator_tick) - Tool whitelists as hard enforcement - AirCoding validation plugin - System prompt injection for routing - V1 requirements: C4 docs, ADR, AGENTS.md, debug-log.md - Design documents in docs/
17 lines
728 B
TypeScript
17 lines
728 B
TypeScript
import { describe, expect, test } from "bun:test"
|
|
import { NamedError } from "@opencode-ai/core/util/error"
|
|
import { MessageError } from "../../src/session/message-error"
|
|
|
|
describe("util.error", () => {
|
|
test("schema-backed named errors are real NamedError instances", () => {
|
|
const error = new MessageError.AuthError({ providerID: "anthropic", message: "boom" })
|
|
|
|
expect(error).toBeInstanceOf(NamedError)
|
|
expect(error.toObject()).toEqual({ name: "ProviderAuthError", data: { providerID: "anthropic", message: "boom" } })
|
|
})
|
|
|
|
test("named errors without fields serialize data", () => {
|
|
expect(new MessageError.OutputLengthError({}).toObject()).toEqual({ name: "MessageOutputLengthError", data: {} })
|
|
})
|
|
})
|