mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-06 05:51:15 +08:00
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:
@@ -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 = {
|
||||
|
||||
@@ -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 },
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user