mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-24 12:44:18 +08:00
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:
@@ -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]",
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user