fix: load final state on project entry; replay only on Replay button (Issue #1227)#1234
Conversation
Untitled.3.mp4now it is no longer refresh whenever switch the project, just relying the refresh on refresh button |
|
@Wendong-Fan @bytecii @Pakchoioioi @4pmtong Please review my PR. |
bytecii
left a comment
There was a problem hiding this comment.
Also can we add some unit tests for the replay? Thanks.
src/store/chatStore.ts
Outdated
| try { | ||
| await ssePromise; | ||
| } catch { | ||
| // Stream completed (aborted) or error - expected when load completes |
There was a problem hiding this comment.
Improve this such as?
if (type === 'replay') {
try {
await ssePromise;
} catch (err) {
if (err instanceof DOMException && err.name === 'AbortError') {
// Expected: stream closed normally, we aborted to resolve the promise
return;
}
// Unexpected: actual error during stream
console.error(`SSE stream failed for task ${newTaskId}:`, err);
throw err; // Let loadProjectFromHistory handle it
}
}
There was a problem hiding this comment.
@bytecii I improved try catch clause for exception handling by following your comment.
…or vs rethrow; replay tests
…com/spider-yamet/eigent into feature/Task-should-not-auto-replay
|
@bytecii I updated the code logics and added test cases by following your comment. Please review my PR. All the test cases are passing now. |
|
@bytecii @Wendong-Fan could you please review the PR? Regards |
|
@Wendong-Fan @bytecii Could you please check PR status? |
|
@bytecii @Wendong-Fan Could you please review current PR? Best Regards |
|
@bytecii @Wendong-Fan Hope you are doing great. |
Summary
Tasks no longer auto-replay when entering a project. The UI shows the final state immediately on entry and replays only when the user clicks the Replay button.
Changes
Load vs Replay behavior
Implementation
src/lib/replay.ts: AddedloadProjectFromHistory()for loading final state;replayProject()/replayActiveTask()for Replay button.src/store/projectStore.ts: AddedloadProjectFromHistory(delay 0, no animation);replayProjectuses delay 0.2 for animation.src/store/chatStore.ts: Replay flow waits for SSE stream to finish before resolving so load can complete before navigation.loadProjectFromHistorywhen opening a project:ProjectGroup,HistorySidebar,SearchHistoryDialog,Project.tsx,ProjectDialog.replayActiveTask→replayProject.Closes #1227