Skip to content

Odie: stop duplicating pre-escalation messages in escalated chats - #113945

Merged
escapemanuele merged 2 commits into
trunkfrom
fix/help-center-duplicate-user-message
Sep 1, 2026
Merged

Odie: stop duplicating pre-escalation messages in escalated chats#113945
escapemanuele merged 2 commits into
trunkfrom
fix/help-center-duplicate-user-message

Conversation

@escapemanuele

Copy link
Copy Markdown
Contributor

Fixes https://linear.app/a8c/issue/DOTSUP-541/help-center-user-messages-render-twice-in-escalated-conversations

Proposed Changes

A chat that started with the AI and moved to a Happiness Engineer no longer shows the earlier messages twice.

  • When the chat reconnects, only messages still waiting to be delivered are carried over, instead of everything the user has ever said.
  • Tests cover both: the earlier messages stay single, and an undelivered message isn't lost.

Why are these changes being made?

A chat that gets escalated is displayed by stitching two halves together: what the user said to the AI, then what happened with the Happiness Engineer. Every time the chat reconnects it is stitched again, and each pass re-added the questions from the first half on top of themselves — so a question the user asked once appeared twice, one bubble under the other (DOTSUP-541).

Testing Instructions

  1. yarn start, open the Help Center and ask the AI assistant a question.
  2. Ask for a human and let the chat move to support.
  3. Close the Help Center and reopen it on that conversation, or drop and restore your network connection.
  4. The question from step 1 appears once.

@github-actions

Copy link
Copy Markdown

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

Async-loaded Components (~19 bytes added 📈 [gzipped])

Details
Name Parsed Gzip
async-load-calypso-components-help-center-help-center-app +47 B +0.0% +19 B +0.0%
async-load-automattic-help-center +47 B +0.0% +19 B +0.0%
async-load-automattic-agents-manager +47 B +0.0% +19 B +0.0%

React components that are loaded lazily, when a certain part of UI is displayed for the first time.

Legend

What is parsed and gzip size?

Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory.
Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

@escapemanuele
escapemanuele marked this pull request as ready for review September 1, 2026 12:29
An escalated chat is rebuilt by concatenating the Odie history with the
Zendesk conversation. To survive a reconnect, the merge also carried over
every message the user had sent, taken from the previous chat state — but
that state is itself a merged list, so the carry-over picked up the Odie
messages the same merge had just re-read from the Odie chat. Deduplication
runs only within the Zendesk half, so the two copies never met and every
message sent before escalation rendered twice.

Carry over only messages the user sent through Zendesk, which is what the
reconnect recovery was for: those are the ones the composer marks with a
`temporary_id`, and the Odie half never has one.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@escapemanuele
escapemanuele force-pushed the fix/help-center-duplicate-user-message branch from ac521ae to 842e7b2 Compare September 1, 2026 12:30
Comment thread packages/odie-client/src/hooks/use-get-combined-chat.ts Outdated
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

Looks like one of the E2E tests has failed.

You can fix them following these steps:

  1. Check out this branch locally:
    gh pr checkout 113945
  2. Start Claude Code in the repo:
    claude
  3. Run the /fix-e2e-tests skill, passing this PR number:
    /fix-e2e-tests 113945
    

@escapemanuele
escapemanuele merged commit 2490b60 into trunk Sep 1, 2026
11 checks passed
@escapemanuele
escapemanuele deleted the fix/help-center-duplicate-user-message branch September 1, 2026 12:49
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