Skip to content

Recover WebMCP sessions after missed events - #360

Merged
rgarcia merged 1 commit into
mainfrom
hypeship/recover-webmcp-sessions
Sep 1, 2026
Merged

Recover WebMCP sessions after missed events#360
rgarcia merged 1 commit into
mainfrom
hypeship/recover-webmcp-sessions

Conversation

@rgarcia

@rgarcia rgarcia commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • remove and detach page sessions that exhaust browser-surface initialization so a later target refresh can attach a fresh CDP session
  • reconcile iframe targets that disappear from Target.getTargets, removing stale sessions and their WebMCP registrations even when a destroy event is missed
  • model active iframe targets in the WebMCP CDP test server and add focused recovery regressions

Why

Browser-surface reconciliation recovered failed target attachment and missing page targets, but two terminal paths only cleared bookkeeping flags. A session that exhausted initialization could remain permanently ineligible for reattachment, while a missed iframe destroy event could leave stale tools discoverable.

Testing

  • go test -race -count=100 ./lib/browsersurface
  • go test -race -count=20 ./lib/browsersurface ./lib/webmcpclient
  • go vet ./...
  • full non-E2E go test -race

@rgarcia
rgarcia requested a review from sjmiller609 September 1, 2026 15:55
@rgarcia
rgarcia merged commit cdec69c into main Sep 1, 2026
11 checks passed
@rgarcia
rgarcia deleted the hypeship/recover-webmcp-sessions branch September 1, 2026 15:57
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.

2 participants