fix: replayActiveTask uses active task question instead of earliest across all tasks (fixes #1367)#1674
Conversation
|
Hi @carlosjarenom, could you help resolve the conflicts? Once they’re resolved, I can move this forward to the review process. |
7298119 to
b5ae10c
Compare
…cross all tasks (fixes eigent-ai#1367) The replayActiveTask function was incorrectly searching for the earliest user message across ALL chat stores and tasks in the project, which caused replay to always use the question from task 1 regardless of which task was active. This fix extracts the question directly from the active task's own messages, matching the expected behavior described in issue eigent-ai#1367.
8b87541 to
52b34aa
Compare
|
Rebased on latest upstream/main and force-pushed. Conflicts resolved. Changes: Replaced |
|
@carlosjarenom Thanks for working on this. The Replay function has currently been removed from the product and will be brought back in the future, although some legacy Replay code remains in the codebase. @4pmtong Could you review whether this corrected active-task lookup would be useful to retain now for the future Replay implementation? The helper is not currently connected to a live UI flow, and the branch presently fails TypeScript because ChatStore and ProjectStore are undefined, so those types would still need to be updated before merging. |
Problem
When clicking Replay on any task, eigent always used the question from task 1 (the earliest task across all chat stores), instead of the question from the currently active task.
This was reported by a maintainer in issue #1367.
Root Cause
replayActiveTask()insrc/lib/replay.tswas iterating over ALL chat stores and tasks to find the earliest user message by timestamp, rather than using the active task's own messages.Fix
Replaced the entire
earliestTimestampsearch logic with a direct lookup in the active task's messages.Testing
Files Changed
src/lib/replay.ts- FixedreplayActiveTask()to use active task's own question