Skip to content

fix: replayActiveTask uses active task question instead of earliest across all tasks (fixes #1367)#1674

Open
carlosjarenom wants to merge 1 commit into
eigent-ai:mainfrom
carlosjarenom:fix/issue-1367-replay-wrong-question
Open

fix: replayActiveTask uses active task question instead of earliest across all tasks (fixes #1367)#1674
carlosjarenom wants to merge 1 commit into
eigent-ai:mainfrom
carlosjarenom:fix/issue-1367-replay-wrong-question

Conversation

@carlosjarenom

Copy link
Copy Markdown

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() in src/lib/replay.ts was 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 earliestTimestamp search logic with a direct lookup in the active task's messages.

Testing

  1. Create a project with multiple tasks
  2. Complete task 1 and task 2 with different questions
  3. Click Replay on task 2
  4. Verify that the replay uses task 2's question, not task 1's

Files Changed

  • src/lib/replay.ts - Fixed replayActiveTask() to use active task's own question

@Douglasymlai Douglasymlai added bug Something isn't working frontend labels Jul 3, 2026
@Douglasymlai

Copy link
Copy Markdown
Contributor

Hi @carlosjarenom, could you help resolve the conflicts?

Once they’re resolved, I can move this forward to the review process.

…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.
@carlosjarenom carlosjarenom force-pushed the fix/issue-1367-replay-wrong-question branch from 8b87541 to 52b34aa Compare July 4, 2026 10:54
@carlosjarenom

Copy link
Copy Markdown
Author

Rebased on latest upstream/main and force-pushed. Conflicts resolved.

Changes: Replaced replayActiveTask() in replay.ts — was iterating all chat stores/tasks to find the earliest user message by timestamp, now directly uses the active task's own messages. Uses replayProject() instead of deprecated chatStore.replay().

@Douglasymlai

Copy link
Copy Markdown
Contributor

@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.

@Douglasymlai Douglasymlai requested a review from 4pmtong July 12, 2026 21:39
@Douglasymlai Douglasymlai added the discussion Align change with internal roadmap label Jul 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working discussion Align change with internal roadmap frontend Review Required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants