/**
 * error-classifier.test.mjs — provider failure routing contracts.
 *
 * Purpose: keep provider-account balance failures in the autonomous fallback
 * path so one drained route does not pause a unit that has usable fallbacks.
 */
import { describe, expect, test } from "vitest";

import { classifyError, isTransient } from "../error-classifier.js";

describe("classifyError", () => {
	test("opencode_insufficient_balance_routes_to_fallback", () => {
		const result = classifyError(
			"401 Insufficient balance. Manage your billing here: https://opencode.ai/workspace/example/billing",
		);

		expect(result.kind).toBe("rate-limit");
		expect(isTransient(result)).toBe(true);
	});
});
