Skip to content

feat(agent): show_view opens the user's App Builder or canvas beside the chat - #3349

Merged
dylan-savage merged 11 commits into
feat/rocket-agent-browserfrom
feat/agent-show-view
Nov 18, 2026
Merged

dylan-savage merged 11 commits into
feat/rocket-agent-browserfrom
feat/agent-show-view

Conversation

@dylan-savage

Copy link
Copy Markdown
Collaborator

Summary

The agent now shows its work. When it changes an app or a pipeline, it first calls show_view, and the user's own App Builder (on Design) or pipeline canvas opens beside the chat. Each change appears there as the agent saves it. Until now show_view was an unmounted stub on this branch.

Opening a view beside the chat splits the editor area, and a split used to stop the running turn. The chat remounted and its hook stopped the turn on unmount. Now the conversation owns its live chat, and a tab only shows it.

This PR merges into feat/rocket-agent-browser, not develop.

  • show_view {path} takes apps/<folder> or pipelines/<name>.pipe. It is mounted only when the host has showView. A view that is already open comes to the front. Otherwise it opens in the group beside the chat, splitting the area if there is one group. The chat never moves and keeps focus.
  • A rearranged panel keeps the turn. AgentSession owns the TurnController, and useChatMessages takes an optional controller that it never creates or stops. A split, a dragged tab, or a closed neighbour keeps the messages, the queue, waiting approval cards, Stop, and the half-typed message. Closing the chat tab or switching teams still stops the turn.
  • The App Builder follows its stage pref live, so show_view switches an open builder to Design without reloading it.
  • Fixes found in the live runs:
    • In dev, StrictMode disposed AppBuilderProvider's prefs mirror, so stage changes never reached the builder. It now reads the realm hub's store for the app.
    • check_app and use_app also take apps/<folder>.
    • A dev session that is still loading keeps a write that lands meanwhile.
    • After a resize, the chat list stays at its latest row. Only a scroll up unpins it.

Type

Feature

Scope

  • Open only. There is no close, pause, or resume, and node_preview waits for custom nodes.
  • PipelineEditor.tsx has the same StrictMode prefs bug. It is not fixed here.
  • In the test runs, closed dev sessions stayed in memory (2 to 18), with never more than one live. dispose() removes them from the live set. The cause is not traced.

Blast radius

The shell chat changes reach every chat: useChatMessages, TurnController, ChatInputField, and MessageList. The new options are optional, and a caller that passes no controller works as before. ./builder shell:check passes with no contract change. Rod's App Builder gets the stage follow, through an optional subscribePrefs on its host, and the two fixes above.

Testing

  • At this tip, shared passes 358/358, rocket-ui 4/4, and shell 392/392. tsc is clean for apps/vscode (both configs), apps/shared, apps/rocket-ui, and packages/shell. apps/aparavi-ui has the same 2 errors as the base. Eslint adds nothing new on the changed files.
  • 21 mutations of the new code each fail a test.
  • Live in the builder in dev, over four runs with a fresh agent:
    • For app work, the model called show_view on its own, before its first edit, 5 times out of 5.
    • A builder open on another stage switches to Design without reloading. An open canvas comes to the front with no second copy.
    • The turn survived show_view's split, a drag to split, Split Right, and Close group. Closing the chat tab stopped it, and reopening read it back.
    • After the split, the chat stayed at its latest row (plain path 5/5, with a card or a queued message 4/4). Scrolling up by hand still stops it following.
    • check_app right after show_view built in the user's preview.
  • The final instruction line names pipelines, because the model opened the canvas only when asked. That line has not run live.
  • ./builder test in full: not run.

Checklist

  • Commit messages follow conventional commits
  • No secrets or credentials included. gitleaks passes in the pre-commit hook.
  • Wiki updated (if applicable): n/a
  • Breaking changes documented (if applicable): none.

Linked Issue

None.

🤖 Generated with Claude Code

dylan-savage and others added 11 commits November 18, 2026 11:24
useChatMessages takes an optional `controller` and returns the one it
drives. A passed controller is the caller's: the hook makes none and
never stops it, so a chat drawn again by a layout change keeps its
running turn. Without one the hook behaves as before.

The controller also holds the composer's unsent text, and
ChatInputField starts from it and writes to it when its `turn` has a
`draft`, so a half-typed message survives the redraw too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An open conversation now has one AgentSession, kept in a module map by
id. Every tab of it, and a tab a layout change draws again, gets that
instance and shows its one chat: the first tab's useChatMessages makes
the TurnController and the session adopts it; later tabs pass it back.

The session runs the chat's request, saves the rows when the chat goes
idle, and closes only when the host says the chat is really gone
(AgentHost.onChatClosed): it stops a running turn, saves the rows after
the stop, and leaves the map. A reopen waits for those saves before it
reads the file. attach, detach and the mount count go.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The rocket-ui host implements onChatClosed. It watches Documents and
calls back once when the conversation's tab document is gone (its last
tab closed) or Documents was destroyed (a team switch). A tab a layout
change draws again keeps its document, so a split or a moved tab no
longer stops the agent's turn. It checks once at subscribe, which
catches a tab closed while the session loaded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A dev session joined the change bus only after its batch read, so a
file written during the read was never adopted: the preview and
check_app kept the old text until the next write to that file. The
session now joins the bus before it reads the tree, holds what arrives
until the models exist, then adopts it. Adopting re-reads the file and
leaves a model that already matches alone. A failed open still keeps
no subscription.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The builder read its stage pref once, so a write from outside the
screen did nothing to an open builder. It now reads the pref again
when it subscribes and on every change, through a new optional
IAppBuilderHost.subscribePrefs that rocket-ui's web host implements
over its prefs store. STAGE_PREF_KEY is exported so the agent can write
the same key. VS Code has no subscribePrefs and keeps today's
read-once behavior.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
showBeside puts the user's App Builder or pipeline canvas beside a
chat using only Documents' existing verbs. A view already showing in
another group comes to the front there, so a canvas never gets a
duplicate. Otherwise it goes to the chat's layout neighbour, or to a
new group split off to the right when the chat's group is the only
one; a view in the chat's own group moves out rather than opening
twice. The chat is shown and its group made active last. It throws
when a team switch tore the editor area down mid-open or the view did
not open.

host.ts gains the UserView union the placement and show_view share.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
show_view takes one path, as list_workspace gives it: an app's folder
(apps/<folder>) or a pipeline file. It resolves the path to a UserView,
refusing every other spelling with its fix, and hands it to the host.
rocket-ui's host switches an app's builder to Design through its stage
pref, then places the view beside the turn's chat. The tool is mounted
only on a host with showView, and it is free: it changes only what is
on screen.

writePaths now holds the app or pipeline a show_view names, and the app
a check_app names, so same-step edits, views and checks of one app run
in the order the model lists them. A check by id or name orders against
nothing, as before.

The WORDS text waits for Dylan's approval (TODO marker on the constant).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AppBuilderProvider made its prefs mirror in useMemo and disposed it in
an effect cleanup. In dev, StrictMode replays that effect, so the
builder kept a mirror that was already disposed before its first
snapshot arrived: it never saw a stored stage or show_view's switch to
Design, and each open left one subscription behind.

It now reads the app's partition through appPrefsStore, the realm hub's
one mirror, which the dev-tool strip and the agent already use. Nothing
is disposed per mount, and the builder sees the agent's write at once.
This also drops the provider's deep shell import.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
show_view teaches the model apps/<folder>, and the model carried it
over: check_app apps/daybook-ui failed with "No app" and cost a step.
findApp now drops one leading apps/ before it matches a folder, so
check_app, deploy_app, publish_app and use_app all take that form. An
id or a name still matches only as given.

The loop keys use_app and check_app on the same spelling, so the
ordering key stays apps/<folder>, never apps/apps/<folder>.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A split draws the chat's group again, so MessageList mounts anew. It
smooth-scrolled to its end on mount, but Allotment sizes a new split
pane only after mount: the scroll aimed at the end of a wider list and
stopped short of the narrower one's, and its own scroll events had
already unpinned it. A waiting approval card could sit out of view.

On mount the list now jumps to its latest row before paint, and while
pinned it keeps it when its pane is resized. New rows still scroll in
smoothly, and a user who scrolled up is left where they are.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The agent opened the builder on its own for app work but only opened
the canvas when asked. Naming an app's screens and a pipeline as things
the user can see covers both. Dylan approved the wording, so the
TODO(Dylan) marker goes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review: 2

  • develop
  • release/.*

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions

Copy link
Copy Markdown
Contributor
🤖 Internal: Discord sync marker

Auto-managed by the Discord notification workflow. Stores the linked Discord message ID and forum thread ID. Do not edit or delete.

@github-actions github-actions Bot added docs Documentation module:ui Chat UI and Dropper UI tests labels Nov 18, 2026
@dylan-savage
dylan-savage merged commit 677eb82 into feat/rocket-agent-browser Nov 18, 2026
5 checks passed
@dylan-savage
dylan-savage deleted the feat/agent-show-view branch November 18, 2026 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation module:ui Chat UI and Dropper UI tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant