Skip to content

Commit 9e462a0

Browse files
committed
fix(gateway): accept agent thinking metadata in protocol
1 parent 6213336 commit 9e462a0

2 files changed

Lines changed: 39 additions & 0 deletions

File tree

packages/gateway-protocol/src/schema/agents-models-skills.test.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Value } from "typebox/value";
22
import { describe, expect, it } from "vitest";
33
import {
4+
AgentsListResultSchema,
45
SkillsProposalInspectResultSchema,
56
ToolsEffectiveResultSchema,
67
} from "./agents-models-skills.js";
@@ -28,6 +29,31 @@ function toolsEffectiveResult() {
2829
};
2930
}
3031

32+
describe("AgentsListResultSchema", () => {
33+
it("accepts resolved per-agent thinking metadata", () => {
34+
const result = {
35+
defaultId: "main",
36+
mainKey: "main",
37+
scope: "per-sender",
38+
agents: [
39+
{
40+
id: "investment-master",
41+
name: "Investment Master",
42+
model: { primary: "deepseek/deepseek-v4-flash" },
43+
thinkingLevels: [
44+
{ id: "off", label: "off" },
45+
{ id: "xhigh", label: "xhigh" },
46+
],
47+
thinkingOptions: ["off", "xhigh"],
48+
thinkingDefault: "xhigh",
49+
},
50+
],
51+
};
52+
53+
expect(Value.Check(AgentsListResultSchema, result)).toBe(true);
54+
});
55+
});
56+
3157
describe("ToolsEffectiveResultSchema", () => {
3258
it("accepts runtime tool quarantine notices", () => {
3359
const result = {

packages/gateway-protocol/src/schema/agents-models-skills.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,19 @@ export const AgentSummarySchema = Type.Object(
5656
{ additionalProperties: false },
5757
),
5858
),
59+
thinkingLevels: Type.Optional(
60+
Type.Array(
61+
Type.Object(
62+
{
63+
id: NonEmptyString,
64+
label: NonEmptyString,
65+
},
66+
{ additionalProperties: false },
67+
),
68+
),
69+
),
70+
thinkingOptions: Type.Optional(Type.Array(NonEmptyString)),
71+
thinkingDefault: Type.Optional(NonEmptyString),
5972
},
6073
{ additionalProperties: false },
6174
);

0 commit comments

Comments
 (0)