Files
fusion/packages
gsxdsm 059016ef3c FN-7765: fix dashboard chat crash when plugin CLI sessions omit session.state
Fix a "Response failed" crash for plugin CLI runtime chats (grok/droid/cursor) whose sessions expose top-level `messages` and stream via `onText` without a pi-shaped `session.state`.

- Read messages/errorMessage null-safely from `session.state`, falling back to top-level `session.messages` when state is absent, in both the room responder and streaming response extraction paths
- Keep `state.errorMessage` optional so successful streams from state-less sessions no longer throw TypeErrors, while pi/openclaw/hermes provider errors still surface correctly
- Add regression tests covering state-less plugin CLI sessions in chat-manager.test.ts
- Add changeset for the fix

Files changed:
 .changeset/fn-7765-grok-cli-chat-crash.md          |  7 ++
 packages/dashboard/src/__tests__/chat-manager.test.ts | 90 ++++++++++++++++++++++
 packages/dashboard/src/chat.ts                     | 35 ++++++---
 3 files changed, 121 insertions(+), 11 deletions(-)

Fusion-Task-Id: FN-7765

Fusion-Task-Lineage: 80e33a97-e971-4aec-a4cf-29d97c5c5e62

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-10 00:22:59 -07:00
..
2026-07-08 16:27:10 -07:00
2026-07-08 16:27:10 -07:00
2026-07-08 16:27:10 -07:00
2026-07-08 16:27:10 -07:00