






















@@ -1,4 +1,5 @@
11import { describe, expect, it } from "vitest";
2+import { validateConfigObject } from "./validation.js";
23import { AgentDefaultsSchema } from "./zod-schema.agent-defaults.js";
34import { AgentEntrySchema } from "./zod-schema.agent-runtime.js";
45@@ -117,12 +118,26 @@ describe("agent defaults schema", () => {
117118expect(() => AgentEntrySchema.parse({ id: "ops", heartbeat: { timeoutSeconds: 0 } })).toThrow();
118119});
119120120-it("accepts per-agent contextTokens override", () => {
121-const agent = AgentEntrySchema.parse({
122-id: "ops",
123-contextTokens: 1_048_576,
121+it("preserves per-agent contextTokens through config validation", () => {
122+const result = validateConfigObject({
123+agents: {
124+list: [
125+{
126+id: "ops",
127+contextTokens: 1_048_576,
128+},
129+],
130+},
131+});
132+133+expect(result).toMatchObject({
134+ok: true,
135+config: {
136+agents: {
137+list: [{ contextTokens: 1_048_576 }],
138+},
139+},
124140});
125-expect(agent.contextTokens).toBe(1_048_576);
126141});
127142128143it("rejects non-positive contextTokens on agent entries and defaults", () => {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。