



















@@ -62,15 +62,88 @@ describe("gateway config mutation guard coverage", () => {
6262expect.arrayContaining([
6363"agents.defaults.systemPromptOverride",
6464"agents.defaults.model",
65+"agents.defaults.subagents.thinking",
6566"agents.list[].id",
6667"agents.list[].model",
68+"agents.list[].subagents.thinking",
6769"channels.*.requireMention",
6870"messages.visibleReplies",
6971"messages.groupChat.visibleReplies",
7072]),
7173);
7274});
737576+it("allows documented subagent thinking default edits via config.patch", () => {
77+expectAllowed(
78+{},
79+{
80+agents: {
81+defaults: {
82+subagents: { thinking: "medium" },
83+},
84+},
85+},
86+);
87+expectAllowed(
88+{
89+agents: {
90+defaults: {
91+subagents: { thinking: "low" },
92+},
93+},
94+},
95+{
96+agents: {
97+defaults: {
98+subagents: { thinking: "high" },
99+},
100+},
101+},
102+);
103+});
104+105+it("allows documented per-agent subagent thinking edits via config.patch", () => {
106+expectAllowed(
107+{
108+agents: {
109+list: [{ id: "worker", subagents: { thinking: "low" } }],
110+},
111+},
112+{
113+agents: {
114+list: [{ id: "worker", subagents: { thinking: "medium" } }],
115+},
116+},
117+);
118+expectAllowed(
119+{ agents: { list: [] as Array<Record<string, unknown>> } },
120+{
121+agents: {
122+list: [{ id: "helper", subagents: { thinking: "medium" } }],
123+},
124+},
125+);
126+});
127+128+it("keeps neighboring subagent policy fields protected via config.patch", () => {
129+expectBlocked(
130+{ agents: { defaults: { subagents: { allowAgents: ["worker"] } } } },
131+{ agents: { defaults: { subagents: { allowAgents: ["*"] } } } },
132+);
133+expectBlocked(
134+{
135+agents: {
136+list: [{ id: "worker", subagents: { requireAgentId: true } }],
137+},
138+},
139+{
140+agents: {
141+list: [{ id: "worker", subagents: { requireAgentId: false } }],
142+},
143+},
144+);
145+});
146+74147it("allows visible reply delivery mode edits via config.patch", () => {
75148expectAllowed(
76149{},
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。