Skip to content

Conversation

@amir-ghasemi
Copy link
Collaborator

This pull request implements a robust system for replaying buffered SSE events for background tasks, ensuring that when a user returns to a session, all agent messages and embeds are processed through the same frontend code path as live streaming. This guarantees consistency and proper embed resolution, even if tasks completed while the user was away. The changes span frontend logic, backend embed resolution logging, and database schema updates.

Frontend: Background Task Replay & Consistency

  • Added logic in ChatProvider.tsx to detect background tasks with buffered events and replay them using a new replayBufferedEvents function, ensuring agent messages and embeds are resolved consistently via SSE processing. [1] [2] [3] [4] [5] [6] [7] [8]
  • Prevented duplicate saves and message deserialization during event replay by tracking replay state and skipping redundant operations.
  • Improved session reload logic to prefer replaying buffered events, falling back to legacy data only if no events are available.

Backend: Database & Migration

  • Added Alembic migration to create a new sse_event_buffer table for persisting SSE events, with indexes and additional columns in the tasks table to track event buffer state. This enables efficient event replay and state tracking for background tasks.

Backend: Embed Resolution Debugging

  • Enhanced logging in embed resolver (resolver.py) and gateway component (component.py) to include more context about embed types, input text, and resolved output, aiding in debugging and traceability of embed processing. [1] [2] [3] [4]

@amir-ghasemi amir-ghasemi requested a review from efunneko February 7, 2026 00:37
@github-actions
Copy link

github-actions bot commented Feb 7, 2026

WhiteSource Policy Violation Summary

✅︎ No Blocking Whitesource Policy Violations found in solaceai/solace-agent-mesh-ui-pr-996!

@amir-ghasemi amir-ghasemi marked this pull request as ready for review February 8, 2026 02:00
@amir-ghasemi amir-ghasemi changed the title refactor: add persistent SSE event buffer for background task replay refactor(DATAGO-124692): add persistent SSE event buffer for background task replay Feb 8, 2026
Copy link
Collaborator

@efunneko efunneko left a comment

Choose a reason for hiding this comment

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

There is missing auth checks in one endpoint, which needs to be addressed

We should also make sure there are tests to verify the auth for accessing the new endpoints

@amir-ghasemi amir-ghasemi requested a review from efunneko February 8, 2026 22:25
@sonarqube-solacecloud
Copy link

Quality Gate failed Quality Gate failed

Failed conditions
64.2% Coverage on New Code (required ≥ 70%)
B Security Rating on New Code (required ≥ A)

See analysis details on SonarQube

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE SonarQube for IDE

Copy link
Collaborator

@efunneko efunneko left a comment

Choose a reason for hiding this comment

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

Looks good!

@efunneko efunneko merged commit bc5a678 into main Feb 9, 2026
24 of 27 checks passed
@efunneko efunneko deleted the amir/bg-refactor branch February 9, 2026 14:18
Hugo-Pare pushed a commit that referenced this pull request Feb 9, 2026
…nd task replay (#996)

This implements a robust system for replaying buffered SSE events for background tasks, ensuring that when a user returns to a session, all agent messages and embeds are processed through the same frontend code path as live streaming. This guarantees consistency and proper embed resolution, even if tasks completed while the user was away. The changes span frontend logic, backend embed resolution logging, and database schema updates.
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.

2 participants