-
Notifications
You must be signed in to change notification settings - Fork 376
fix: stop task not working as expected #713
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
Conversation
Resolve merge conflicts in src/store/chatStore.ts by combining: - Connection retry logic for SSE errors from main branch - Cleanup logic for AbortController from pause_task_fix branch 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
| onerror(err) { | ||
| console.error("Error:", err); | ||
| console.error("SSE Error:", err); | ||
| // Clean up AbortController on error | ||
| try { | ||
| if (activeSSEControllers[newTaskId]) { | ||
| delete activeSSEControllers[newTaskId]; | ||
| } | ||
| } catch (error) { | ||
| console.warn('Error cleaning up AbortController on SSE error:', error); | ||
| } | ||
| throw err; | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we targetting for skip to behave like stop? @Wendong-Fan
🤔 If so I think we can re-implement the new on "error" message logic on #663.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR is almost done @Wendong-Fan
|
|
||
| try { | ||
| // Skip the current task | ||
| // First, try to notify backend to skip the task | ||
| await fetchPost(`/chat/${projectStore.activeProjectId}/skip-task`, { | ||
| project_id: projectStore.activeProjectId | ||
| }); | ||
|
|
||
| // Update task status to finished | ||
| chatStore.setStatus(taskId, 'finished'); | ||
| // Only stop local task if backend call succeeds | ||
| chatStore.stopTask(taskId); | ||
| chatStore.setIsPending(taskId, false); | ||
|
|
||
| // toast.success("Task skipped successfully", { | ||
| // closeButton: true, | ||
| // }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Wendong-Fan in this PR #735, it just makes the skip task == stop task.
- Replay proof, where the skip task can be replicated with the replay api.
- But maybe can borrow your idea of activeSSEControllers as it still suffers from ghost SSEs (i.e. Post stop)
Description
What is the purpose of this pull request?