fix(gateway): expose agent thinking defaults

Fixes #81760.

Exposes existing agent and model thinking defaults through agents.list, including protocol and Swift model support. Thanks @jbetala7.
This commit is contained in:
Jayesh Betala
2026-05-31 19:35:55 +05:30
committed by GitHub
parent d99934aacd
commit f8f52592c5
15 changed files with 304 additions and 22 deletions

View File

@@ -1,6 +1,7 @@
import { Value } from "typebox/value";
import { describe, expect, it } from "vitest";
import {
AgentsListResultSchema,
SkillsProposalInspectResultSchema,
ToolsEffectiveResultSchema,
} from "./agents-models-skills.js";
@@ -28,6 +29,31 @@ function toolsEffectiveResult() {
};
}
describe("AgentsListResultSchema", () => {
it("accepts resolved per-agent thinking metadata", () => {
const result = {
defaultId: "main",
mainKey: "main",
scope: "per-sender",
agents: [
{
id: "investment-master",
name: "Investment Master",
model: { primary: "deepseek/deepseek-v4-flash" },
thinkingLevels: [
{ id: "off", label: "off" },
{ id: "xhigh", label: "xhigh" },
],
thinkingOptions: ["off", "xhigh"],
thinkingDefault: "xhigh",
},
],
};
expect(Value.Check(AgentsListResultSchema, result)).toBe(true);
});
});
describe("ToolsEffectiveResultSchema", () => {
it("accepts runtime tool quarantine notices", () => {
const result = {

View File

@@ -56,6 +56,19 @@ export const AgentSummarySchema = Type.Object(
{ additionalProperties: false },
),
),
thinkingLevels: Type.Optional(
Type.Array(
Type.Object(
{
id: NonEmptyString,
label: NonEmptyString,
},
{ additionalProperties: false },
),
),
),
thinkingOptions: Type.Optional(Type.Array(NonEmptyString)),
thinkingDefault: Type.Optional(NonEmptyString),
},
{ additionalProperties: false },
);