mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-31 19:16:29 +00:00
fix(desktop): add MoA preset enabled toggle
Salvaged from PR #59743. Original author email was malformed (sr@samirusani, not resolvable to a GitHub account), so the commit is re-authored with credit via trailer. Co-authored-by: Sami Rusani <samrusani@users.noreply.github.com>
This commit is contained in:
parent
d7fbd13997
commit
6cbb8cca94
2 changed files with 30 additions and 0 deletions
|
|
@ -435,4 +435,25 @@ describe('ModelSettings MoA preset editor', () => {
|
|||
vi.useRealTimers()
|
||||
}
|
||||
})
|
||||
|
||||
it('autosaves the selected preset when its enabled switch is toggled', async () => {
|
||||
vi.useFakeTimers({ shouldAdvanceTime: true })
|
||||
|
||||
try {
|
||||
await openReferenceEditor()
|
||||
|
||||
fireEvent.click(screen.getByRole('switch', { name: 'Enabled' }))
|
||||
await vi.advanceTimersByTimeAsync(700)
|
||||
|
||||
expect(saveMoaModels).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
presets: expect.objectContaining({
|
||||
default: expect.objectContaining({ enabled: false })
|
||||
})
|
||||
})
|
||||
)
|
||||
} finally {
|
||||
vi.useRealTimers()
|
||||
}
|
||||
})
|
||||
})
|
||||
|
|
|
|||
|
|
@ -993,6 +993,15 @@ export function ModelSettings({ onMainModelChanged }: ModelSettingsProps) {
|
|||
))}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
<label className="flex items-center gap-2 rounded-sm border border-border px-2 py-1 text-xs">
|
||||
Enabled
|
||||
<Switch
|
||||
checked={currentMoaPreset.enabled !== false}
|
||||
disabled={applying}
|
||||
onCheckedChange={checked => updateMoaPreset(prev => ({ ...prev, enabled: checked }))}
|
||||
size="xs"
|
||||
/>
|
||||
</label>
|
||||
<Button
|
||||
disabled={applying}
|
||||
onClick={() => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue