Skip to content

Fix: Tool call context loss after page reload.#32

Merged
mm-zacharydavison merged 7 commits intomainfrom
bugfix/tool-call-context-loss
Mar 10, 2026
Merged

Fix: Tool call context loss after page reload.#32
mm-zacharydavison merged 7 commits intomainfrom
bugfix/tool-call-context-loss

Conversation

@mm-zacharydavison
Copy link
Copy Markdown
Contributor

@mm-zacharydavison mm-zacharydavison commented Feb 24, 2026

This PR fixes the issue described in TS-10915 (@meetsmore).

Simply put, tool calls were not persisted in the local storage chat history.
This PR refactors the message storage to make it more consistent (less special cases for specific message types) and fixes the bug.

E2E tests include a new test case for the bug, and are passing.

Copy link
Copy Markdown
Contributor

@masudahiroto masudahiroto left a comment

Choose a reason for hiding this comment

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

The bug2 of the bug ticket still exists. Could you check it?

This is a reproduction step.

  1. Open the chat and send "Add a todo: buy groceries" — the AI executes the addTodo tool.
  2. Confirm the todo appears in the UI.
  3. Restart the server process.
  4. Wait for the client to auto-reconnect. (Do not reload the page.)
  5. Send a new message, and got error.

Copy link
Copy Markdown
Contributor

@masudahiroto masudahiroto Feb 25, 2026

Choose a reason for hiding this comment

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

IMO conversation history is managed at both local storage (incomingMessage) and server-side memory (session.conversationHistory), and it makes debugging difficult. Should we simplify this logic so that it always uses incomingMessages?

Copy link
Copy Markdown
Contributor

@masudahiroto masudahiroto left a comment

Choose a reason for hiding this comment

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

Thank you very much!

@mm-zacharydavison mm-zacharydavison merged commit 210db7f into main Mar 10, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants