Skip to content

refactor(dev)!: delete the callerless runtime App preview path - #852

Merged
ScriptedAlchemy merged 7 commits into
mainfrom
chore/remove-runtime-app-path
Sep 25, 2026
Merged

ScriptedAlchemy merged 7 commits into
mainfrom
chore/remove-runtime-app-path

Conversation

@ScriptedAlchemy

@ScriptedAlchemy ScriptedAlchemy commented Sep 25, 2026 •

Copy link
Copy Markdown
Owner

Follow-up to #845. After #629 deleted the Runtime Playground and #845 deleted the Workbench runtime App bridge, nothing calls the runtime App path. This PR deletes it end to end. It is breaking, so the changeset is agent-bundle minor.

Reachability (confirmed zero before deleting)

  • Workbench callers: none. McpPage (Advanced) and McpAppPreview (App routes) mount artifact sessions only. Nothing constructs a runtime-bound McpSessionController binding or calls attachApp or any McpAppClient runtime method.
  • Route tables: /api/runtime/apps/** was only the runtime branch of McpAppRoutes. /api/runtime/mcp/sessions/** was only RuntimeMcpRoutes, registered in ForegroundServer. Both had no client other than the code deleted here.
  • Public exports: DevServerSession.openRuntimeClientSurface (from agent-bundle and agent-bundle/api) is the only public member removed. RuntimeMcpRoutes, RuntimeClientSurfaceProxy, and McpAppRuntimePreviewService were exported only from the internal dev/index.ts, which is not a package entry point.
  • Examples and dynamic imports: none reference the removed routes, methods, or events.

Deleted

  • agent-bundle, server side:
    • dev/mcp-app-runtime-preview-service.ts, dev/mcp-app-runtime-binding-service.ts, dev/runtime-mcp-routes.ts, dev/runtime-client-surface-proxy.ts, and their tests.
    • The runtime branch of mcp-app-routes.ts.
    • The runtime preview lane, RuntimeClientSurfaceBindings, and openRuntimeClientSurface in workbench-server.ts.
    • The RuntimeMcpRoutes wiring and DevRuntimeController.emit (its only callers were deleted).
    • DevRuntimeClientSurfaceProxyBinding.
    • The runtime.app.updated and runtime.hmr.client-* event types.
    • The runtime preview re-exports in contracts/mcp-apps.ts.
  • Workbench:
    • The runtime methods, document-policy and consent bookkeeping, and runtime.app.updated subscription on McpAppClient.
    • openRuntime/restartRuntime/closeRuntime/executeRuntime on McpRouteClient.
    • The runtime binding kind and attachApp in McpSessionController and the session model.
    • The HMR client-count state in runtime-model.ts, which nothing read.
    • scripts/capture-runtime-playground.mjs, which only drove the removed Playground.
  • Tests: cases that only protected the removed shape. The artifact App and session tests stay.
  • Docs:
    • docs/diagnostics.md rows for AB8010, AB8022 (410 case), AB8023 (runtime operation and 413 cases), AB8204 (MCP session revision), and the MCP App section header.
    • The Workbench guide's client-surface iframe sentence, in en and zh.
    • docs/effect-conventions.md.
    • The capture recipe in examples/rsc-agent-runtime/README.md.
    • The regenerated topology block.

No diagnostic code becomes wholly unreachable. Each affected code is still emitted by another route, so the rows are edited rather than retired.

Browser contract boundary fix

The deleted preview service had been pulling @types/node into the browser-only tsconfig.web-host.json program. That hid the fact that contracts/mcp-apps.ts and mcp-app-bridge.ts type-imported from the Node module mcp-app-sandbox.ts. This PR moves the sandbox and consent type declarations into a Node-free mcp-app-sandbox-types.ts leaf with a single definition and no re-export shim, points the five importers at it, and drops the unused isMcpAppConsentCapability re-export.

Kept on purpose

The runtime provider contract stays: DevRuntimeSession.mcpRegistry and clientSurface(), createRuntimeMcpRegistry from agent-bundle/api, run results' app.mcpBinding, and the DevRuntimeMcp* protocol types. The rsc-agent-runtime example implements and tests them directly. The host no longer consumes them, so they are the next candidate, but removing them changes the provider API and the example and needs its own PR.

Local gate

All runs are on a branch merged with current origin/main, including #832.

Review

change-risk-reviewer (Claude Opus 5.5) found no blockers. It confirmed that the artifact MCP App and session paths, the runtime runs, status, and surfaces routes, and the Workbench runtime backend are unchanged, and that the changeset and docs match the source.

  • Should-fix, fixed: DevRuntimeController.emit had no callers left and is now deleted.
  • Nit, not changed: docs/assets/rsc-runtime-workbench/fidelity-ledger.md still describes the old capture tool. It and its screenshots are a historical evidence record, so I left them.

Since the Runtime Playground and the Workbench runtime App bridge were
deleted (#629, #845), nothing calls the runtime App lane. Remove it end to
end: the dev server's /api/runtime/apps and /api/runtime/mcp/sessions routes,
the runtime preview and binding services, the runtime client-surface proxy
and its session bindings, DevServerSession.openRuntimeClientSurface, the
runtime methods on the Workbench McpAppClient and McpRouteClient, the
runtime-bound McpSessionController mode and App attachment, and the
runtime.app.updated / runtime.hmr.client-* events with the Workbench's
unread HMR client counts. Delete the Runtime Playground capture script and
its README recipe.
…t graph

Move the MCP App sandbox and consent type declarations into a Node-free
mcp-app-sandbox-types.ts leaf and point every importer at it. The deleted
runtime preview service had been pulling @types/node into the browser-only
web-host program, which hid that contracts/mcp-apps.ts reached the Node
sandbox module. Also delete DevRuntimeController.emit, whose only callers
were the removed client-surface proxy and preview service, and drop the
deleted consent files from the topology test fixture.
@changeset-bot

changeset-bot Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 7d24b8b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
agent-bundle Minor
create-agent-bundle Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@changeset-bot

changeset-bot Bot commented Sep 25, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1da7238

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
agent-bundle Minor
create-agent-bundle Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-25T03:55:10.567511Z 5403a09 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@pkg-pr-new

pkg-pr-new Bot commented Sep 25, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle@852
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/create-agent-bundle@852
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/rsc-markdown-stream@852
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/@agent-bundle/runtime@852

commit: 1da7238

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5403a094f8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .changeset/remove-runtime-app-routes.md Outdated
"agent-bundle": minor
---

Remove the Workbench runtime App preview path. The dev server no longer serves `/api/runtime/apps/**` or `/api/runtime/mcp/sessions/**`, `DevServerSession` (from `agent-bundle` and `agent-bundle/api`) drops `openRuntimeClientSurface`, and `DevRuntimeEventInput` no longer accepts `runtime.app.updated`, `runtime.hmr.client-connected`, or `runtime.hmr.client-disconnected`. The `AB8022` 410 and `AB8023` 413 runtime App responses are gone; both codes keep their other meanings. Runtime runs, status, surfaces, and MCP App previews for artifact sessions are unchanged.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Append the PR number to the changeset summary

This is the sole changeset for a breaking publishable-package change, but its summary ends with unchanged. rather than the required (#PR) suffix. As written, the generated release notes lose the required PR attribution; append the actual PR number.

AGENTS.md reference: AGENTS.md:L124-L125

Useful? React with 👍 / 👎.

@ScriptedAlchemy
ScriptedAlchemy merged commit 78d75f2 into main Sep 25, 2026
3 checks passed
@github-actions github-actions Bot mentioned this pull request Sep 25, 2026
ScriptedAlchemy added a commit that referenced this pull request Sep 25, 2026
* refactor(dev)!: delete the runtime provider MCP contract

Nothing in the host consumes a provider's MCP registry, clientSurface(), or
run results' app binding since the runtime App path was removed (#852).
Delete them from agent-bundle: the RuntimeMcpRegistry implementation and
createRuntimeMcpRegistry, DevRuntimeSession.mcpRegistry and clientSurface(),
DevRuntimeInspectionEnvelope.app, the runtime.mcp.* events and their fields,
and every DevRuntimeMcp*/RuntimeMcp* type. The Workbench runtime client now
rejects an app field in run inspections.

Rework examples/rsc-agent-runtime so its dev provider no longer hosts an
in-process MCP registry or App client surface: activation commits only the
generation store, generation metadata drops the registry descriptors and
digests, and MCP tool runs no longer return an App binding. Hooks and MCP
tools still share the durable kernel, which a new lifecycles e2e step
checks end to end.

* fix(example): recover from a failed prepared-runtime reconcile

Return the runtime to active once a reconcile succeeds after a failed one,
abort a prepared activation when the test seam throws, cover a provider-path
latch on an active session, and describe what the dev session still serves.

* docs(changeset): reference #855
@ScriptedAlchemy
ScriptedAlchemy deleted the chore/remove-runtime-app-path branch September 25, 2026 20:20
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.

1 participant