mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 12:54:20 +01:00
fix(sessions): prevent duplicate goal starts and lost autosave updates
- Block prompt submission while an armed goal is starting. - Launch multi-runs with mutate so a failed launch is not an unhandled rejection. - Save changed session automation fields in one update so concurrent autosaves cannot overwrite each other.
This commit is contained in:
1 parent
96e02e9646
commit
2072fae1b6
6 files changed
+137
-38
No files matched your search
@@ -165,6 +165,23 @@ describe('MultiRunDialog', () => {
|
||||
})
|
||||
})
|
||||
|
||||
it('keeps the launch tab when the launch request fails', async () => {
|
||||
const user = userEvent.setup()
|
||||
mocks.launchMultiRun.mockRejectedValue(new Error('launch failed'))
|
||||
renderDialog()
|
||||
|
||||
await user.type(screen.getByLabelText('Group name'), 'Sweep')
|
||||
await user.type(screen.getByLabelText('Prompt'), 'go')
|
||||
await user.click(screen.getByRole('checkbox', { name: 'GPT-4o' }))
|
||||
await user.click(screen.getByRole('button', { name: 'Launch' }))
|
||||
|
||||
await waitFor(() => {
|
||||
expect(mocks.launchMultiRun).toHaveBeenCalled()
|
||||
})
|
||||
expect(screen.getByLabelText('Group name')).toBeInTheDocument()
|
||||
expect(screen.queryByText('No runs yet.')).not.toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('submits the catalog id for configured model aliases', async () => {
|
||||
const user = userEvent.setup()
|
||||
mocks.launchMultiRun.mockResolvedValue(startedRun)
|
||||
|
||||
Reference in new issue
Block a user