Skip to content

Agent streaming - #3534

Open
tevanburen wants to merge 36 commits into
devfrom
agent-streaming
Open

Agent streaming#3534
tevanburen wants to merge 36 commits into
devfrom
agent-streaming

Conversation

@tevanburen

@tevanburen tevanburen commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Description

Adds a full agent mode (RunAgent) to Playground — a server-driven agent harness loop that streams messages, tool calls, and subagent activity back to the client, as an alternative to the existing client-orchestrated chat flow. Requires the companion Semoss backend agent-streaming branch to function.

Changes Made

SDK (libs/sdk)

  • New agent.ts / agent.types.ts / agent-subscription.ts: pure API wrappers for RunAgent, GetAgentRun, GetSubagentRuns, and tool-decision pixels, plus a subscribeAgentRun polling/reconciliation subscription and shared item-event merging — decoupling the wire protocol from Playground-specific state.

Agent mode entry & UI (room-input.tsx, new-room-page.tsx, constants.ts, slash-command context)

  • /agent-harness (and hidden /harness) slash commands to switch a room into agent mode.
  • Consolidated room-input mode/workspace/exit chips into one, added an agent-mode indicator, and synced agent mode into the new-room store so a mode set before persistence isn't lost.
  • Decoupled workspace selection from chat vs. agent mode.

Streaming & tool execution (agent-harness.ts, response-message.store.ts, response-message-tool*.tsx, tools-view.tsx)

  • Core agent-harness.ts store: submits agent runs, applies streamed item events (message/reasoning/tool/subagent) onto the room's message tree, reconnects an in-progress run after a page reload, and resumes a paused run on a tool decision.
  • Proper "ask" UI and tool grouping for agent-run tool calls, plus title/open-tool fixes.
  • Fixed a stuck-loading bug in ToolsView for tools with no resolvable MCP app behind them.

Subagents

  • Subagent status renders as its own card (styled like the "large" ask-mode tool card) instead of a raw tool pill, with per-status treatment (running / waiting-for-input / completed / failed / cancelled).
  • Reconstructs every turn's subagents from the durable AGENT_RUN table on reload — not just the tail turn's — positioned under the message that spawned them.
  • Clicking a subagent card opens a side panel (reusing the existing sidebar tab system) showing its response/error, kept live via a room-wide lookup.
  • Subagent tool calls (spawn/named/check/wait) now render normally, both live and after reload, matching regular tools.

Cancellation

  • Stop button shows a plain spinner instead of an actionable-looking Stop control during agent-mode turns, since agent runs can't yet be reliably interrupted server-side.

How to Test

  1. In a room, run /agent-harness to switch into agent mode.
  2. Send a message that triggers tool calls — verify tool calls group/ungroup correctly and ask-mode tools show the approve/decline UI.
  3. Ask the model to spawn a subagent (anonymous or named) — a styled subagent card should appear live; clicking it opens a side panel with its response.
  4. Refresh mid-run and after a completed run with subagents from an earlier turn — the run should reconnect (or show its correct terminal state), and all historical subagents should reappear under their spawning message.
  5. Confirm the Stop button shows a spinner, not a clickable Stop, during an agent-mode turn.

Notes

@tevanburen tevanburen self-assigned this Aug 11, 2026
@snyk-io

snyk-io Bot commented Aug 11, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@tevanburen tevanburen linked an issue Aug 11, 2026 that may be closed by this pull request
@tevanburen
tevanburen changed the base branch from 778-update-react-to-lts-19-2 to dev August 11, 2026 14:42
Comment thread libs/sdk/src/api/agent.ts
*/
export const submitAgentRun = async (
params: {
roomId: string;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we comment each of the parameters / the return?

Comment thread libs/sdk/src/api/agent.ts Outdated
Comment thread libs/sdk/src/api/agent.ts Outdated
@tevanburen
tevanburen marked this pull request as ready for review August 14, 2026 20:35
@tevanburen
tevanburen requested a review from a team as a code owner August 14, 2026 20:35
@johbaxter

Copy link
Copy Markdown
Contributor

Yeah skill file for this @tevanburen

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.

Agent harness SDK updates

4 participants