Files
fusion/.changeset/cli-agent-hybrid-chat.md
gsxdsm 85f70148a1 feat(dashboard): wire cli-agent chat surface and runner glue; fix stale engine mocks (U12 completion)
Mount CliChatSurface in ChatView for cli-backed chat sessions (sessions carrying
cliExecutorAdapterId): the message-pane + composer region is delegated to the
surface (transcript/raw-terminal toggle for hybrid/native adapters, terminal-only
for the generic adapter), while regular sessions keep the standard composer. The
existing message list and composer JSX are captured once as render thunks and
passed through, so there is no parallel message/composer UI.

Add a narrow telemetry seam: TelemetryHub gains an optional onEvent tap (also
settable post-construction via setEventListener) invoked with each sanitized
event after routing — best-effort, a throwing listener never breaks ingest. This
is the seam the CliChatSessionRunner uses to build the durable transcript from
the same sanitized events the hook route already feeds the hub, without the hub
becoming a general subscriber bus.

Fix the stale @fusion/engine vi.mocks across dashboard tests: object-literal
mocks that fully replace the module now also return listCliAdapterDescriptors
(added by U15's cli-agent-settings route, evaluated at module load). Mocks that
spread importOriginal/importActual already pick it up.

Tests: new ChatView.cli-mount.test.tsx (cli session → CliChatSurface, regular
session → normal composer, generic → terminal-only); telemetry-hub onEvent tap
coverage. chat-attachment-routes, chat-cli-sessions, cli-agent-hooks-route,
ChatView.cli-toggle all green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 03:02:27 -07:00

1.2 KiB

@runfusion/fusion
@runfusion/fusion
minor

CLI-agent hybrid chat (U12): a chat session can select a cli-agent executor and be driven by a long-lived CLI agent process. Adapter transcript telemetry maps to durable chat_messages rows at user/assistant/tool-summary granularity (raw tool noise stays in the terminal), with the shared redactSecrets pass applied before persistence so transcripts never become a secret store. Composer sends route through the inject path with FIFO queueing; the flush decision re-fetches authoritative session state rather than trusting a cached busy flag. The chat surface gains a transcript ↔ raw-terminal toggle (terminal owns input, composer hidden in terminal mode); generic-tier sessions render terminal-only with no toggle. New per-session cliExecutorAdapterId linkage on chat_sessions.

ChatView now mounts CliChatSurface for cli-backed sessions (the message-pane + composer region is delegated to it; regular sessions keep the standard composer), and the engine TelemetryHub gains a narrow optional onEvent tap (settable via setEventListener) so the chat transcript runner can observe the same sanitized events the hook route already feeds, without the hub becoming a subscriber bus.