-
Notifications
You must be signed in to change notification settings - Fork 0
feat(retry): ✨ Add model-switch retry for task/page flows #63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -205,6 +205,37 @@ describe('CloudService', () => { | |
| }) | ||
| }) | ||
|
|
||
| it('retryTask/retryPage send model override payload when model is provided', async () => { | ||
This comment was marked as outdated.
Sorry, something went wrong.
This comment was marked as outdated.
Sorry, something went wrong. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [LOW] CloudService override payload tests miss boundary case when model is omitted Only the provided-model branch is tested; omission behavior (no body vs empty body) remains unguarded. Suggestion: Add tests for Risk: A subtle request-shape regression could break backward compatibility with server endpoints expecting optional model fields. Confidence: 0.85 [From SubAgent: testing]
|
||
| const cloudService = (await import('../CloudService.js')).default | ||
|
|
||
| mockAuthManager.fetchWithAuth | ||
| .mockResolvedValueOnce(makeJsonResponse(200, { success: true, data: { task_id: 'task-2', events_url: '/events' } })) | ||
| .mockResolvedValueOnce(makeJsonResponse(200, { success: true, data: { task_id: 'task-1', page: 3, status: 'queued' } })) | ||
|
|
||
| await cloudService.retryTask('task-1', 'pro') | ||
| await cloudService.retryPage('task-1', 3, 'ultra') | ||
|
|
||
| const retryTaskCall = mockAuthManager.fetchWithAuth.mock.calls[0] | ||
| expect(retryTaskCall[0]).toContain('/api/v1/tasks/task-1/retry') | ||
| expect(retryTaskCall[1]).toEqual( | ||
| expect.objectContaining({ | ||
| method: 'POST', | ||
| headers: { 'Content-Type': 'application/json' }, | ||
| body: JSON.stringify({ model: 'pro' }), | ||
| }) | ||
| ) | ||
|
|
||
| const retryPageCall = mockAuthManager.fetchWithAuth.mock.calls[1] | ||
| expect(retryPageCall[0]).toContain('/api/v1/tasks/task-1/pages/3/retry') | ||
| expect(retryPageCall[1]).toEqual( | ||
| expect.objectContaining({ | ||
| method: 'POST', | ||
| headers: { 'Content-Type': 'application/json' }, | ||
| body: JSON.stringify({ model: 'ultra' }), | ||
| }) | ||
| ) | ||
| }) | ||
|
|
||
| it('cancelTask/retryTask/retryPage/deleteTask return API errors when non-OK', async () => { | ||
| const cloudService = (await import('../CloudService.js')).default | ||
| mockAuthManager.fetchWithAuth | ||
|
|
||
This comment was marked as outdated.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.