Skip to content

fix: multi task question persistence and replay#1368

Open
bytecii wants to merge 3 commits intomainfrom
fix/multi-task-question-persistence
Open

fix: multi task question persistence and replay#1368
bytecii wants to merge 3 commits intomainfrom
fix/multi-task-question-persistence

Conversation

@bytecii
Copy link
Collaborator

@bytecii bytecii commented Feb 24, 2026

Related Issue

Closes #1366
Closes #1367

Description

  • Multi-task question persistence: When loading a project with multiple tasks from history, all tasks were incorrectly shown with the first task's question. Fixed by changing the question: string parameter to questions: string[] across the entire load/replay chain (projectStore, lib/replay.ts, ProjectGroup.tsx, HistorySidebar, SearchHistoryDialog), so each task receives its own question.
  • Replay shows wrong question: When clicking Replay on a specific task, it was using the earliest question found across all chat stores (always task 1's) instead of the active task's own question. Fixed replayActiveTask to simply read the question from the current active task's messages.

Testing Evidence (REQUIRED)

  • Multi-task
image
  • Replay with the latest task for now
image
  • I have included human-verified testing evidence in this PR.
  • This PR includes frontend/UI changes, and I attached screenshot(s) or screen recording(s).
  • No frontend/UI changes in this PR.

What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Contribution Guidelines Acknowledgement

…m history

When a project has multiple tasks, each task's question was being
overwritten with the first task's question on reload. Changed the
question parameter from a single string to an array across the
load/replay chain so each task gets its own correct question.

Also fixed replayActiveTask to use the active task's own question
instead of the earliest question found across all chat stores.
@bytecii bytecii self-assigned this Feb 24, 2026
@bytecii bytecii added bug Something isn't working Review Required labels Feb 24, 2026
Comment on lines +146 to +152
const tasks = project?.tasks || [];
const taskIdsList = tasks
.map((t: HistoryTask) => t.task_id)
.filter(Boolean) as string[];
const questions = tasks.map((t: HistoryTask) => t.question || '');
const finalTaskIds = taskIdsList.length ? taskIdsList : [projectId];
const finalQuestions = questions.length ? questions : [question];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @bytecii Could you confirm whether it's guaranteed that every task with a non-null task_id also appears at the same index in both arrays? If not, it might be safer to derive both from a filtered pair like ProjectGroup.tsx already does taskPairs.

@a7m-1st a7m-1st self-requested a review February 25, 2026 12:25
Copy link
Collaborator

@a7m-1st a7m-1st left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image

When sending SIMPLE, SIMPLE, COMPLEX taskss, I found a bug while testing, let me analyze it further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Replay shows wrong question [BUG] task question only the first one loaded if reentered the project

3 participants