Skip to content

refactor(expert): send Expert chat messages through a chat publisher - #9073

Open
andypalmi wants to merge 2 commits into
refactor/expert-chat-subscriberfrom
refactor/expert-chat-publisher
Open

andypalmi wants to merge 2 commits into
refactor/expert-chat-subscriberfrom
refactor/expert-chat-publisher

Conversation

@andypalmi

Copy link
Copy Markdown
Contributor

Description

  1. Chat requests, aborts, votes, system notices and the answers to the agent's in-flight requests are sent by a chat publisher (frontend/src/publishers/expert-chat.publisher.ts) built on the team publisher contract, instead of from the product-expert store.
  2. The publisher shares the agent's connection with the chat subscriber and keeps the session it connected with. A send while disconnected fails instead of being dropped.
  3. The team publisher contract gains the same connection key and credentials hooks as the subscriber one.
  4. The store connects and disconnects both and no longer holds MQTT code. Turn tracking and the send queue stay in the store, since they are chat state rather than transport.

Related Issue(s)

Closes #9030

Checklist

  • I have read the contribution guidelines
  • Suitable unit/system level tests have been added and they pass
  • Documentation has been updated
    • Upgrade instructions
    • Configuration details
    • Concepts
  • Changes flowforge.yml?
    • Issue/PR raised on FlowFuse/helm to update ConfigMap Template
    • Issue/PR raised on FlowFuse/CloudProject to update values for Staging/Production
  • Link to Changelog Entry PR, or note why one is not needed.
    • Not needed: no user-facing change.

Labels

  • Includes a DB migration? -> add the area:migration label

Chat requests, aborts, votes, system notices and the answers to the agent's
in-flight requests move out of the product-expert store into an Expert chat
publisher built on the team publisher contract. It shares the agent's
connection with the chat subscriber, keeps the session it connected with, and
fails a send while disconnected rather than dropping it. The store connects
both and keeps the turn and send-queue state.

The team publisher contract gains the same connection key and credentials
hooks as the subscriber one.
@andypalmi andypalmi self-assigned this Oct 27, 2026
@andypalmi
andypalmi requested review from Steve-Mcl and cstns October 27, 2026 16:43
@andypalmi
andypalmi added this pull request to stack #9075 October 27, 2026 16:44
@codecov

codecov Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.62%. Comparing base (d7cac90) to head (2848f75).

Additional details and impacted files
@@                       Coverage Diff                        @@
##           refactor/expert-chat-subscriber    #9073   +/-   ##
================================================================
  Coverage                            79.61%   79.62%           
================================================================
  Files                                  475      475           
  Lines                                26086    26086           
  Branches                              6954     6954           
================================================================
+ Hits                                 20769    20770    +1     
+ Misses                                5317     5316    -1     
Flag Coverage Δ
backend 79.62% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@andypalmi
andypalmi removed this pull request from stack #9075 October 27, 2026 17:46
@andypalmi
andypalmi added this pull request to stack #9076 October 27, 2026 17:46

This branch was successfully deployed

1 active deployment
staging — 2848f754 Deployed Oct 27, 2026 by andypalmi via Deploy application #12790
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.

Move sending Expert chat messages out of the store

1 participant