Repository navigation
fix(assistant): one opening message, decided once the status has settled - #4735
Conversation
…led (abilityai/trinity-enterprise#1356) Cause: right after setup the panel's first status read arrives while the instance's account report is still pending, so it carries no opening line from Trinity. The panel wrote its own hello at once (store.welcome from AssistantWidget.hello()), and the settle re-read a moment later brought Trinity's line, which greet() put in the hello's place. Before both, the empty panel's static words showed for the length of the fleet read: three openings in the first seconds. Fix: the panel decides its opening once the reads it is written from are in and the status has settled; until then it shows a skeleton, not a message or a starter menu. greet() no longer adds a line already on screen, so a reload or a second sign-in that hears the same line again shows it once. Tests: assistantWidget.mount.spec.js "one opening, decided once" (3 new) records every opening shown across first open, reload and a second sign-in. Reverting the widget change turns all three red (plus the updated hold test); reverting the greet() dedupe turns the reload case red. Co-Authored-By: Claude Opus 5.5 <[email protected]>
PR Validation — APPROVEHead validated: Independent probe (my own spec, run against the head, not committed)I mounted the panel with a status mock I could steer and recorded every opening it showed at each step. Each run covered mount, open, and the full settle back-off plus 30 s timeouts. Each scenario was repeated for first open, reload and a second sign-in where noted.
Mutation: with What a person sees if the status never settles: the two-line skeleton ( CI
Checklist
Warnings (non-blocking)
Draft #4736 (same panel)The two PRs conflict textually in all three shared files:
The changes are compatible in meaning. Merge #4735 first: it is a small P1 fix, ready now, and #4736 is a draft waiting on companion PRs. Then rebase #4736 onto it, keeping both:
#4736's Recommendation: APPROVE, once |
Keeps both sides of the conflict: - AssistantWidget startTalking(): #4735's openingDecided gate (agent list and example names read, status settled) now also gates the first-session OPENING, so the question is never decided on an early, incomplete status or an empty fleet that has not loaded yet. - stores/assistant greet(): the first-session early return and #4735's dedupe of an opener already on screen. - The panel spec: both describe blocks. Validator notes on #4735 taken: the pending-opening placeholder no longer hides on statusError, so a failed settle re-read keeps it instead of leaving a blank conversation; and its bars use the pre-status skeleton's grays. Tests (each shown red under the matching mutation, then restored): - first-session question waits for the settled status (red with the old `!store.status` gate); - waits for the agent list: a person with their own agent gets the hello (red with `prepared` dropped from openingDecided); - a failed re-read keeps the placeholder (red with `&& !store.statusError`); - dashboardHidesExamples.mount.spec.js: how the Dashboard decides which example agents to hide (system agent not counted as own, hand-off to the network store, show-on-request remembered, cleared on unmount). Refs abilityai/trinity-enterprise#1355 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Fixes abilityai/trinity-enterprise#1356 (private tracker; closed by hand at release).
Cause
On a newly set-up instance the assistant panel's first status read arrives while the instance's account report is still pending, so it carries no opening line from Trinity. The panel then wrote its own hello at once (
store.welcome(hello())inAssistantWidget.vue). That hello is the leftover: the settle re-read a moment later brought Trinity's opening line, andgreet()put it in the hello's place (stores/assistant.js). Before both, the empty panel's static words showed while the fleet was read, so a new person saw up to three openings in the first seconds.The cause is in the platform frontend, not the backend module or Trinity's opening.
Fix
AssistantWidget.vue: the opening is decided once. That happens after the reads the hello is written from have come back (fleet, example agents) and after the status has settled (openingDecided). Until then the panel shows a skeleton (aria-busy, design-system recipe), not a message or a starter menu.stores/assistant.jsgreet(): a line already on screen (same key or text) is not added again. A reload or a second sign-in that hears the same line shows it once.Tests
describe('one opening, decided once')intests/unit/assistantWidget.mount.spec.js(3 tests). Each test records every opening the panel shows at each step: mount, open, and through the whole settle back-off. It does this on first open, on reload and on a second sign-in, and asserts exactly one distinct opening in each case: Trinity's line, the panel's own hello, or the panel's static words.greet()dedupe reverted, the reload case goes red (two copies of the same line).assistantWidget.mount.spec.js: 100/100. Assistant-related specs plus the raw-colour, loading-gate and source-text ratchets: 62 files, 1334/1334. The full frontend unit suite did not finish inside the local time budget; CI runs it.🤖 Generated with Claude Code