Skip to content

fix(browser-worker): per-conversation browser session isolation — cookies/login state bleed across conversations via shared navPage #11539

Closed

Description

@mrveiss

Part of umbrella #11536 (OpenManus research adoption, Task 3).

Problem

The browser worker holds a single global navPage (autobot-browser-worker/playwright-server.js, let navPage = null) — one browser, one context, one page for ALL conversations and users. Cookies and login state from one conversation are visible to the next: log in to a site in conversation A, and conversation B (potentially another user) browses with those credentials. This is session bleed, not just a missing feature.

Per-session contexts already exist in autobot-backend/research_browser_manager.py (ResearchBrowserSession(session_id, conversation_id) — dedicated context per session) but the chat workflow path does not use them; send_to_browser_vm() (autobot-backend/api/browser_mcp.py:543-583) talks to the shared page.

Proposal

  • Browser worker: map session_id → Playwright BrowserContext (one browser process, N isolated contexts), with idle GC mirroring the docker workspace pattern (services/docker_task_workspace.py idle expiry).
  • send_to_browser_vm() passes the conversation/session id on every call.
  • Reuse/converge with research_browser_manager.py session semantics rather than inventing a parallel mechanism (canonical-source rule).

Acceptance Criteria

  • Two concurrent conversations get isolated cookie jars (test: set cookie in A, assert absent in B)
  • Contexts are GC'd after configurable idle timeout
  • Existing single-session behavior unchanged for a lone conversation
  • No second session-management implementation left behind (converge with research_browser_manager)

Activity

  1. github-actions commented on Jul 18, 2026

    @github-actions
    Contributor

    PR #11915 (merged to Dev_new_gui) references this issue with a close keyword.

    fix(browser-worker): per-conversation session isolation via per-session contexts (#11539)

    If this issue is fully resolved, close it manually. If work remains, no action is needed.

  2. mrveiss commented on Jul 18, 2026

    @mrveiss
    OwnerAuthor

    Closed — merged to Dev_new_gui via #11915 (squash 8ef5b62). Per-session Playwright BrowserContext isolation: new session-store.js (one context per session_id), idle GC (env-driven BROWSER_SESSION_IDLE_TIMEOUT_MS/GC_INTERVAL_MS), session_id threaded through send_to_browser_vm + all /mcp/* handlers + the web_search fallback chain + the visual-browser proxy (playwright.py) and its Vue callers (VisualBrowserPanel per-conversation, PopoutChromiumBrowser). Verified: JS 9/9 (cookie-in-A absent-in-B isolation proof + GC-recheck race), py 9/9 + 5/5 (distinct session_id on the wire, live tool-dispatch threading, default fallback), 247+78 regression green, flake8/stylelint/vue-tsc clean, api.ts regenerated. Review BLOCKER (visual-browser proxy sharing default navPage) fixed. Discovery: 11925 (KnowledgeResearchPanel single-operator carve-out).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions