Skip to content

Have the Expert open the onboarding conversation - #8467

Open
cstns wants to merge 1 commit into
8383-suppress-tourfrom
8369-open-conversation
Open

Have the Expert open the onboarding conversation#8467
cstns wants to merge 1 commit into
8383-suppress-tourfrom
8369-open-conversation

Conversation

@cstns

@cstns cstns commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

The Expert speaks first on the onboarding page, so the frontend needs a way to start a turn the user has not typed.

Heads up for whoever reviews this

This is the first PR in the stack whose behaviour cannot be verified from the frontend side. It sends the opening turn and renders whatever comes back. Whether the Expert actually produces a sensible first turn for an empty query is the other half, and that lives in the expert flows (#8371), not here.

If the agent is not ready for it, nothing errors. Verify input accepts an empty string, the fast-reply switch does not match it, and the turn goes to the LLM as an empty user message. So the page opens, the request goes out, a reply comes back and renders. It reads as working right up until you look at what the Expert actually said. A blank or confused first message is the failure mode, not a stack trace.

So testing this means reading the opening turn, not just checking that one appears.

What it does

openConversation sends a turn with an empty query. That is not a new protocol: resumeToolApprovals already does exactly this, described in its own comment as "an ordinary chat request with no query". Worth noting the expert-side Verify input check turns out to be looser than #8371 assumed, it requires query to be a string rather than to be non-empty, so an empty string already passes it today.

Two things it deliberately does not do:

  • No user message is added. The user has not said anything, so nothing of theirs belongs in the transcript.
  • The session clock is left unstarted. This is the concern raised in Let the Expert open a chat session before the user types #8371. The expiry warning fires at 25 minutes and the session is declared expired at 28, tracking the agent's own 30 minute history GC. If that clock started when the conversation opened, someone reading the first question could be told their history had expired without ever having typed. handleQuery already starts the clock on the first turn where it is unset, so the user's first reply picks it up naturally.

The onboarding flag is added to both branches of the context getter. They build their objects separately, so a field added to one goes missing depending on load timing. It is sourced from ux.isOnboarding, which tracks the conversation rather than the deployment: it stays true after the Expert moves the user into the editor, and goes false once onboarding is finished or skipped, so a later ordinary chat is not treated as one. That settles the open question on #8370.

Also drops onboardingFixture.js, the hardcoded placeholder transcript that stood in while this was missing, along with its seeding call and the stale TEMPORARY comment. The drawer's canned welcome was already suppressed on this surface, so nothing else was hardcoded. The old guard is kept: a transcript holding only canned messages counts as empty and gets cleared, so arriving from the drawer does not leave its greeting in the way, while a real conversation is left alone, which is what makes the page resumable.

Closes #8369
Closes #8370

@cstns
cstns added this pull request to stack #8441 September 10, 2026 11:44
@cstns cstns added the area:frontend For any issues that require work in the frontend/UI label Sep 10, 2026
@cstns cstns self-assigned this Sep 10, 2026
@cstns cstns added area:ff-expert FlowFuse AI Assistant type:enhancement labels Sep 10, 2026
@cstns cstns changed the title [8369] Have the Expert open the onboarding conversation Have the Expert open the onboarding conversation Sep 10, 2026
@cstns
cstns force-pushed the 8369-open-conversation branch 2 times, most recently from 93f5f11 to c96e33a Compare September 10, 2026 11:57
@codecov

codecov Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (8383-suppress-tour@2ffcb1d). Learn more about missing BASE report.

Additional details and impacted files
@@                  Coverage Diff                  @@
##             8383-suppress-tour    #8467   +/-   ##
=====================================================
  Coverage                      ?   76.88%           
=====================================================
  Files                         ?      460           
  Lines                         ?    24741           
  Branches                      ?     6596           
=====================================================
  Hits                          ?    19022           
  Misses                        ?     5719           
  Partials                      ?        0           
Flag Coverage Δ
backend 76.88% <ø> (?)

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.

The Expert speaks first on the onboarding page, so the frontend needs a way
to start a turn the user has not typed. openConversation sends a turn with an
empty query, the same shape resumeToolApprovals already uses, and the agent
tells onboarding apart from ordinary support by the onboarding flag now
carried on the context object.

Two things it deliberately does not do. No user message is added, since the
user has not said anything. And the session clock is left unstarted, so the
25 minute warning and 28 minute expiry begin when the user first replies
rather than while they are still reading the opening question.

The onboarding flag goes on both branches of the context getter: they build
their objects separately, so a field added to one goes missing depending on
load timing. It tracks the conversation rather than the deployment, staying
true after the Expert moves the user into the editor and going false once
onboarding is finished or skipped.

Drops the hardcoded placeholder transcript that stood in while this was
missing. A transcript holding only canned messages still counts as empty and
gets cleared, so arriving from the drawer does not leave its greeting in the
way, while a real conversation is left alone and picked up where it stopped.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ff-expert FlowFuse AI Assistant area:frontend For any issues that require work in the frontend/UI type:enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Send the onboarding flag to the Expert with each turn Open the onboarding conversation without waiting for the user

1 participant