Skip to content

Send Expert chat messages one at a time - #8876

Open
andypalmi wants to merge 2 commits into
feat/expert-build-trackingfrom
feat/expert-send-queue
Open

andypalmi wants to merge 2 commits into
feat/expert-build-trackingfrom
feat/expert-send-queue

Conversation

@andypalmi

Copy link
Copy Markdown
Contributor

Every message to the Expert is now queued so only one is in flight per session. Before, the instance ready/failed notice was published straight away, so if the instance came up while a reply was still streaming, two turns ran on the same session and each overwrote the other's chat history. That showed up as two separate chats.

Chat turns, opening a conversation, approval resumes and the instance notices all go through one queue in the Expert store. A job is finished when its reply arrives, or when the turn is stopped or errors.

  • Stop only ends the turn in flight. The next queued message goes out after it, and can be stopped in turn.
  • Start Over drops the queue and no longer stays waiting on the old session's reply.
  • The "workspace ready" card still shows straight away, only the message to the Expert waits for its turn.
  • The composer stays disabled while a reply is pending, so queued messages are the system notices only. Sending several user messages at once needs the Expert to accept a list, so that is left for later.

Tests cover a notice arriving mid-turn, order, stop letting the next one through, and Start Over clearing the queue.

Queue every send to the Expert (chat turns, opening a conversation,
approval resumes and the instance ready/failed notices) so only one
message is in flight per session. A turn is finished when its reply
arrives or it is stopped; Stop only ends the turn in flight and the next
queued message goes out. Start Over drops the queue.
@andypalmi
andypalmi requested a review from cstns October 9, 2026 12:50
@andypalmi
andypalmi added this pull request to stack #8828 October 9, 2026 12:50
@codecov

codecov Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.54%. Comparing base (21c5dca) to head (e228dc5).

Additional details and impacted files
@@                     Coverage Diff                     @@
##           feat/expert-build-tracking    #8876   +/-   ##
===========================================================
  Coverage                       78.54%   78.54%           
===========================================================
  Files                             475      475           
  Lines                           25760    25760           
  Branches                         6857     6857           
===========================================================
  Hits                            20234    20234           
  Misses                           5526     5526           
Flag Coverage Δ
backend 78.54% <ø> (ø)

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.

Question and plan cards already stop being answerable once anything is
posted after them. Approval cards stayed clickable, so a decision could be
sent for a call the Expert had already cancelled.

This branch was successfully deployed

1 active deployment
staging — e228dc56 Deployed Oct 9, 2026 by andypalmi via Deploy application #12358
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