Skip to content

Show user-message metadata before assistant streaming completes #1244

Closed

Description

@paullizer

Issue

A newly submitted user message keeps its temporary browser ID until the assistant stream finishes, so its metadata drawer cannot load even though the message and metadata are already persisted. Users see Message metadata unavailable (temporary ID not updated). during long-running responses.

Steps to Reproduce

  1. Open a chat and submit a message that produces a long-running or tool-driven response.
  2. While the assistant response is still streaming, expand the submitted user message's metadata drawer.
  3. Observe that the user message metadata fails to load; refresh the page and observe that the persisted metadata is available.

Expected Behavior

The user message should be reconciled to its persisted message ID as soon as the backend saves it, allowing its metadata drawer to load while the assistant response continues. Assistant-message metadata may remain unavailable until the assistant response is finalized and persisted.

Actual Behavior

The client receives and applies user_message_id only from the terminal SSE event. Until then, the metadata drawer retains the temp_user_* ID and displays an error. If the drawer is opened before reconciliation, its retry path continues using the stale temporary ID.

Impact

This creates a misleading metadata failure during long-running chat, tabular analysis, document actions, image generation, and shared-chat workflows. Refreshing works around the issue, but interrupts the live response experience.

Notes

The fix should emit or relay a nonterminal user-message persistence SSE event immediately after the user message is saved, reconcile the temporary DOM ID on receipt, and recover an already-open metadata drawer with the real ID. This must cover the main chat stream, document-action/analyze streams, image-generation compatibility bridge, and collaboration stream proxy. Terminal responses should retain user_message_id for backward compatibility and cancellation/recovery safety.

Acceptance Criteria

  • A submitted user message can load metadata after persistence while its paired assistant response is still running.
  • An already-open metadata drawer recovers automatically when the real message ID arrives.
  • Standard, document-action/analyze, image-generation, and shared-chat streaming paths expose or relay the persistence signal.
  • Assistant metadata remains deferred until the assistant message is finalized.
  • Terminal events retain user_message_id for backward compatibility and cancellation/recovery behavior.
  • Regression coverage validates SSE ordering, stream relaying, and browser-side temporary-ID reconciliation.

Activity

  1. paullizer commented on Aug 14, 2026

    @paullizer
    ContributorAuthor

    Implementation is complete on the working branch.

    What changed:

    • Added a nonterminal user_message_persisted SSE event after durable storage across standard chat, document-action/analyze, image-generation compatibility, and collaboration streams.
    • Reconciled temporary user-message IDs immediately so metadata can load while the assistant is still running.
    • Preserved collaboration-local IDs, terminal metadata refresh, disconnect/recovery states, and stale-request protection.
    • Kept Mask/Edit/Delete/Retry gated until terminal completion so early reconciliation cannot mutate an in-flight turn.
    • Added focused functional and Playwright regression coverage, fix documentation, release notes, and app version 0.250.197.

    Validation completed:

    • 13 focused functional regressions passed.
    • Live metadata Playwright coverage passed, including hidden-drawer refresh, server error, abort, failed recovery, manual reattach, stale retry cancellation, reparented action menus, and mutation gating.
    • Stop-button, thinking-placeholder, and mask-control UI regressions passed in isolated runs.
    • Route policy, JavaScript/Python syntax, XSS added-line, broken-access-control, and diff/whitespace checks passed.

    Docs: docs/explanation/fixes/USER_MESSAGE_METADATA_STREAMING_FIX.md and docs/explanation/release_notes.md.

  2. paullizer commented on Aug 19, 2026

    @paullizer
    ContributorAuthor

    Shipped in v0.250.202 via #1247.

    Release note entries:

    • v0.250.202: Live User Message Metadata During Streaming

    Full notes: https://microsoft.github.io/simplechat/explanation/release_notes/

    Closing as completed. This issue stayed open after the fix merged because pull requests target Development while the repository default branch is main, so GitHub never applied the Fixes # keyword automatically.

  3. moved this from Pending Evaluation to Released in Simple Chat Roadmapon Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions