Skip to content

fix(test): mount pending MCP App calls - #741

Merged
ScriptedAlchemy merged 1 commit into
mainfrom
fix/736-browser-app-pending
Sep 7, 2026
Merged

fix(test): mount pending MCP App calls#741
ScriptedAlchemy merged 1 commit into
mainfrom
fix/736-browser-app-pending

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

Closes #736.

Summary

  • Make MountBrowserAppOptions.toolResult optional: omission mounts the opening call in flight, publishes its input, and leaves cancellation/result/error to the mounted harness publishers.
  • Derive canonical hostContext.toolInfo.tool from toolName / toolDefinition, fill the existing object-schema default for partial definitions, merge caller host context, and reject conflicting tool names.
  • Name invalid MCP App host-context fields in bridge construction errors instead of reporting only generic unstable values.
  • Prove cancellation through the convention-first MCP App, preserve initial-result behavior, and document the public contract in English and Chinese.

Proof

The browser-App suite observes onToolInput render checking, then proves each terminal path independently: cancellation renders through onToolCancelled, a later result renders degraded, and a later isError result renders unavailable. The existing initial result still arrives during mount and rejects later cancellation. It also verifies derived full tool metadata, caller-context merging, partial tool definitions, and conflicting metadata rejection.

Local merge gate

Branch contains origin/main at 240d7b0a97.

pnpm build && pnpm typecheck && pnpm lint && pnpm test:unit
# passed: build, typecheck, lint (1,493 files), 4,482 tests / 0 failed (4,476 passed, 6 skipped)

AGENT_BUNDLE_WORKBENCH_PREBUILT=1 AGENT_BUNDLE_PACKAGE_PREBUILT=1 pnpm exec rstest --config rstest.integration.config.ts \
  packages/agent-bundle/tests/examples-contract.test.ts \
  packages/agent-bundle/tests/mcp-apps-compile.test.ts \
  packages/agent-bundle/tests/serve-app.test.ts \
  packages/workbench/tests/mcp-app-preview-browser.test.ts \
  packages/workbench/tests/mcp-app-frame.test.ts \
  packages/workbench/tests/mcp-app-real.e2e.test.ts \
  packages/workbench/tests/examples-real.e2e.test.ts \
  packages/workbench/tests/web-command.e2e.test.ts
# passed: 60 / 60

pnpm --filter @agent-bundle-example/mcp-app check
pnpm --dir examples/mcp-app test:browser-app
# passed: validate/build/typecheck; 14 / 14 browser-App tests

pnpm docs:site:build
# passed: locale parity, 0 broken links / 29,989 anchors

Deslop

Deslop: GPT-5.6 Sol, 1 edit (moved the opening-result test helper before its first use).

Self-review

Reviewer: Claude Fable 5.1 Thinking (high), change-risk-reviewer, two passes.

Finding Disposition
Medium: deriving toolInfo made a name-only toolDefinition fail for missing inputSchema Fixed by filling the harness's existing { type: 'object' } default; browser regression added.
Low: example prose made opening-tool gating appear to apply to onToolCancelled Fixed in English and Chinese; route listeners and global cancellation are now distinct.
Low: caller toolInfo conflict detection is name-only Accepted: the opening tool name is the routing identity; the canonical definition always comes from harness options, and docs tell callers not to duplicate it.
Low: explicit deferred terminal state is not replayed after a second ui/initialize Accepted: mountBrowserApp models one mounted opening call; no rebind surface is exposed by the harness.
Info: pending bindings carry an internal empty result for loadResource() fallback Accepted: browser-App mounts compiled srcdoc and never resolves its resource through that fallback; no placeholder reaches the App wire.
Low: default display context now survives a partial caller context Accepted and documented: merging defaults plus caller fields is the requested harness behavior.

Second pass: both fixes verified; no remaining merge blockers.

@changeset-bot

changeset-bot Bot commented Sep 7, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 398c99b

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 Patch
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 7, 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-07T09:03:09.825828Z 398c99b 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.

@ScriptedAlchemy
ScriptedAlchemy merged commit 42d666c into main Sep 7, 2026
5 checks passed

@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: 398c99b16a

ℹ️ 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 packages/agent-bundle/src/dev/mcp-apps/mcp-app-bridge.ts
Comment thread packages/agent-bundle/src/test/browser.ts
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.

[P2] mountBrowserApp cannot mount an in-flight opening call, so agent-bundle/app's onToolCancelled has no browser-app case

1 participant