feat(FN-1889): add executor project model UI to settings modal

- Add execution model selection dropdown to project settings modal
- Include execution lane in project model lanes filter for better context
- Add test coverage for execution model in project settings
- Include changeset for @gsxdsm/fusion package
This commit is contained in:
Fusion
2026-04-15 16:44:29 -07:00
committed by gsxdsm
parent 03863986bf
commit b2d982a894
3 changed files with 31 additions and 3 deletions

View File

@@ -1026,10 +1026,10 @@ export function SettingsModal({
const presetOptions = presets.map((preset) => ({ id: preset.id, name: preset.name }));
const inUsePresetIds = new Set(Object.values(form.defaultPresetBySize || {}).filter(Boolean));
// Filter model lanes to show in project scope (planning, validator, summarization)
// Default and execution lanes are global-only
// Filter model lanes to show in project scope (execution, planning, validator, summarization)
// Default lane is global-only
const projectModelLanes = MODEL_LANES.filter(
(lane) => lane.laneId === "planning" || lane.laneId === "validator" || lane.laneId === "summarization",
(lane) => lane.laneId === "execution" || lane.laneId === "planning" || lane.laneId === "validator" || lane.laneId === "summarization",
);
return (

View File

@@ -923,6 +923,29 @@ describe("SettingsModal", () => {
expect(projectPayload.validatorModelId).toBe("gpt-4o");
});
it("saving in Project Models section updates project settings with execution model", async () => {
const user = userEvent.setup();
render(<SettingsModal onClose={onClose} addToast={addToast} />);
await waitFor(() => expect(fetchSettings).toHaveBeenCalled());
// Click on "Project Models" (project-scoped models section)
fireEvent.click(screen.getByText("Project Models"));
await waitFor(() => expect(fetchModels).toHaveBeenCalled());
// Select execution model
const executionTrigger = screen.getByLabelText("Execution Model");
await user.click(executionTrigger);
await user.click(screen.getByText("Claude Sonnet 4.5"));
fireEvent.click(screen.getByText("Save"));
// Verify execution settings are saved as project settings
await waitFor(() => expect(updateSettings).toHaveBeenCalledTimes(1));
const projectPayload = (updateSettings as ReturnType<typeof vi.fn>).mock.calls[0][0];
expect(projectPayload.executionProvider).toBe("anthropic");
expect(projectPayload.executionModelId).toBe("claude-sonnet-4-5");
});
it("saving in Project Models section updates planning and validator fallback models", async () => {
const user = userEvent.setup();
render(<SettingsModal onClose={onClose} addToast={addToast} />);