Skip to content

feat(mcp): signal cancellation to running browser tools - #2009

Merged
BlueHotDog merged 2 commits into
integration/mcp-2026-07-28from
feat/browser-tool-cancellation-context
Oct 27, 2026
Merged

BlueHotDog merged 2 commits into
integration/mcp-2026-07-28from
feat/browser-tool-cancellation-context

Conversation

@BlueHotDog

Copy link
Copy Markdown
Collaborator

Scope

Independent browser cancellation layer: a controller per active tools/call request, exact typed request-ID cancellation, abort on detach/transport close/error, signal forwarding through MCP.serverInterface and BrowserTool.execute. Existing browser tools accept an optional signal; tools that do not cooperate may still finish. No new JavaScript or bindings. 82 net-new code/test lines, below 100.

This is NOT end-to-end cancellation. Backend agent cancellation still needs the replay-owner durable CancelRequested/OutcomeUnknown hook before emitting notifications/cancelled. Relay wiring follows after #1994; this PR does not depend on that adapter.

Semantics

A cancellation request signals work but does not resolve it. IDs remain reserved while execution is outstanding. Actual completion after cancellation remains available for reconciliation. Disconnect aborts work and suppresses disconnected responses using the existing response-once gate. No synthetic cancelled ToolResult, rollback claim, retry policy or second durable ledger. Subscription teardown remains distinct and unchanged. Confirmed cooperative cancellation/outcome classification remains a follow-up with the durable lifecycle contract.

Test-first evidence and checks

  • New MCP integration test failed before registry implementation: expected execution signal aborted=true, got false.
  • make -C libs/frontman-client check: 113 tests pass and formatting passes (does not include the independent feat(client): add request-scoped relay cancellation adapter #1994 tests).
  • make -C libs/frontman-protocol test: 32 tests pass.
  • make -C libs/frontman-protocol check-schemas: passes, wire schemas unchanged.
  • make -C libs/frontman-astro-browser check: 14 tests pass and formatting passes.
  • make clean && make build: all 859 modules compile.
  • make -C libs/client test: 500 tests pass; existing ChatToggle act warnings printed.
  • make check-source-comments: passes. Also fixed feat(client): add request-scoped relay cancellation adapter #1994 source-comment check in a separate follow-up commit, no history rewrite.
  • Backend runtime/precommit/strict-compile not yet run: exclusive coordinator slot requested. The backend cancellation reproduction test remains separate and uncommitted until its layer can be validated.

No merge requested or performed.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 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-10-27T09:12:52.374732Z 99c006f Manual request
ℹ️ 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.

@BlueHotDog

Copy link
Copy Markdown
Collaborator Author

Additional validation: make -C apps/frontman_server strict-compile now passes in both dev and test environments, after restoring the exact locked dependencies inside this isolated workspace. Dependency builds printed upstream warnings, but both strict project compiles exited successfully. make -C apps/frontman_server lint also passes formatter and strict Credo. Backend runtime suites and precommit remain pending the exclusive PaperTiger slot; no backend runtime has been started.

@BlueHotDog

Copy link
Copy Markdown
Collaborator Author

Fixed dead-code CI in follow-up commit (no rewrite). Internal server execution now requires its always-present signal. Exported browser tool execute entry points are marked @LiVe because their optional cancellation argument is supplied through the first-class BrowserTool module interface. No blanket analyzer suppression or behavior changes. make clean && make build, make reanalyze (Analysis reported 0 issues), frontman-client check (113 tests), client test (500 tests), source-comment check and diff whitespace check pass. Total remains 90 net-new code/test lines (98 including changeset), below 100. Exact-head review is being coordinated by the landing parent; no duplicate review request from this thread.

@BlueHotDog

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review the current head 99c006fca74f5f37fd29eb61fe3e064b331c6fe3 after the dead-code fix.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 99c006fca7

ℹ️ 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".

@BlueHotDog
BlueHotDog merged commit b99dd3f into integration/mcp-2026-07-28 Oct 27, 2026
32 checks passed
@BlueHotDog
BlueHotDog deleted the feat/browser-tool-cancellation-context branch October 27, 2026 09:22
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