feat: add Claude subagent model config (#4830)

* feat: add Claude subagent takeover config

* feat: add Claude subagent model field

* i18n: add Claude subagent model labels

* fix(proxy): preserve configured subagent model mapping

* fix(providers): exclude subagent model from Claude common config

* style: format rust code
This commit is contained in:
秋澪Akimio
2026-07-07 10:28:36 +08:00
committed by GitHub
parent e606adfae7
commit b3e5e32c89
12 changed files with 257 additions and 33 deletions
@@ -85,6 +85,7 @@ const renderCopilotForm = (overrides: Partial<ClaudeFormFieldsProps> = {}) => {
defaultOpusModelName: "",
defaultFableModel: "",
defaultFableModelName: "",
subagentModel: "",
onModelChange: vi.fn(),
speedTestEndpoints: [],
apiFormat: "anthropic",
@@ -173,4 +174,25 @@ describe("ClaudeFormFields", () => {
);
});
});
it("一键设置会同时写入 Subagent 模型", () => {
const onModelChange = vi.fn();
renderCopilotForm({
claudeModel: "shared-model[1M]",
defaultSonnetModel: "",
defaultSonnetModelName: "",
onModelChange,
});
fireEvent.click(
screen.getByRole("button", {
name: "一键设置",
}),
);
expect(onModelChange).toHaveBeenCalledWith(
"CLAUDE_CODE_SUBAGENT_MODEL",
"shared-model[1M]",
);
});
});