Skip to content

fix: keep the agent's question and the user's answer in the chat - #2110

Merged
Douglasymlai merged 4 commits into
mainfrom
fix/ask-reply-in-chat
Oct 27, 2026
Merged

Douglasymlai merged 4 commits into
mainfrom
fix/ask-reply-in-chat

Conversation

@Douglasymlai

@Douglasymlai Douglasymlai commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Pull Request

Related Issue

N/A — maintainer-directed repair; no linked issue required for this PR.

Follow-ups stacked on this PR: #2119 (answer a question still waiting after a reload) and #2120 (Memory change review controls).

Description

Problem

When the agent asked the user a question (for example "What is your favourite colour?") and the user answered, the question and the answer both disappeared once the task finished, including from the expanded work log. After reopening the Session, the answer came back as a separate turn without its question, a wrong "This task ended before Eigent sent a final reply." notice appeared above it, and "Worked for" changed.

Cause

  • An answered question was deleted from the conversation when it was resolved, so the work log lost it too.
  • An answer was paired with its question only when it came directly after it. Once tool steps sat in between (after the task ended, or when the Session was reopened), the answer started a new turn with no agent output, which triggered the notice and the wrong timing.
  • Reopening a Session did not restore the question itself.
  • A task reopened from its history measured "Worked for" from its first to its last recorded step, which included the time spent waiting for the user's answers and approvals.

Fix

  • Answered questions stay in the conversation. The question card above the input box still closes once it is answered.
  • Answers are matched to their question by its ID, so tool steps in between no longer split the turn.
  • The answered question and its answer show once, in the run's work log at the step that asked it. The main chat shows the final reply, without an extra copy of the question.
  • A question that was cancelled or expired without an answer (for example when a task is resumed and the agent asks again) leaves no empty "Input required" entry behind.
  • Reopening a Session restores asked questions. Other requests, such as Memory change reviews, keep their full details (before/after, options) after reopening.
  • The "no final reply" notice is decided for the whole task, not for one turn inside it.
  • "Worked for" on a reopened task leaves out the time spent waiting for the user, so it no longer grows after a window reload.

Testing Evidence (REQUIRED)

App check in the development Electron build (agent-driven, real model, not yet human-verified):

  • Question answered (teal), task finishes: one question + answer entry in the expanded run, final reply shown, no notice, file written. Same after switching Sessions, reloading the window and restarting the app.
  • Quit while the question waited, relaunch, Resume, answer green: only the answered question shows, no empty entry for the cancelled one, across switch / reload / restart.
  • "Worked for" before this update: 20s live, 50s after a window reload (the 27s of waiting was counted). The duration fix was added after this check and still needs a re-run.

Automated checks:

  • Question answered, then task finishes: before, the question and answer were gone; after, one question + answer entry stays in the work log and the final reply shows with no notice.
  • Answer separated from its question by tool steps: before, a new turn and a false notice; after, one turn.
  • Task resumed after the first question was cancelled: only the answered question shows; no empty entry for the cancelled one.
  • Question waiting for an answer: still shown and answerable.
  • Memory change review and merge conflict requests are left untouched when a Session is reopened.
  • Duration of a reopened task: waits for a question (10s) and an approval (17s) are left out; overlapping waits count once.
  • Unit tests for the chat timeline, work log, chat store and task duration pass. The wider chat and store suites pass apart from 3 installation-store tests that fail the same way without this change. Type-check, ESLint, Prettier and the design-token check pass.

How to test manually:

  1. Send: use the ask-human tool to ask me my favourite colour, write it to colour.txt, then reply done. Answer teal.
  2. After it finishes: the main chat shows the reply; expanding the run shows one Question / Answer entry; no "ended before Eigent sent a final reply" notice.
  3. Switch Sessions and back, reload the window, and quit and relaunch: same result each time, "teal" is not its own turn, and "Worked for" does not change.
  4. Repeat, but quit while the question is waiting, relaunch, click Resume and answer the new question: only the answered question shows.
  5. Note "Worked for" in step 2, then reload the window (Cmd+R): it stays within a few seconds instead of adding the time you took to answer.
  • 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

@Douglasymlai
Douglasymlai marked this pull request as ready for review October 25, 2026 17:40
@Douglasymlai Douglasymlai self-assigned this Oct 25, 2026
@Douglasymlai
Douglasymlai merged commit 0af2a57 into main Oct 27, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant