Skip to content

feat(browser): isolate harness-browser profiles per Octop user - #568

Open
jubaoliang wants to merge 1 commit into
developfrom
feature/browser-per-user-profile-isolation
Open

feat(browser): isolate harness-browser profiles per Octop user#568
jubaoliang wants to merge 1 commit into
developfrom
feature/browser-per-user-profile-isolation

Conversation

@jubaoliang

Copy link
Copy Markdown
Collaborator

Summary

  • Replace the legacy shared/default Playwright session router (browser/sessions.py) with per-user harness-browser profiles (user-<id>), so concurrent Octop users no longer share one Chrome session, cookie jar, or recording.
  • Backend endpoints (harness-sessions, handoff, shutdown, record/replay) now always derive the browser profile from the authenticated user (or the IM thread's agent owner for gateway turns) instead of trusting client-supplied profile / session_id params.
  • Add BrowserProfileMiddleware to pin any model-selected browser_use tool call to the current turn's Octop-user profile, preventing cross-user profile access from the agent side.
  • Add api/routers/browser/env.py (env-status/install probe, split out of the old sessions router) and drop the now-unused REST tab-switch endpoints/types from the dashboard.
  • Dedupe ThreadRegistry.get_or_create's duplicated session-refresh branch into _refresh_session_if_needed.

Test plan

  • make all (format-all + lint + typecheck + full pytest suite): 2924 passed, 8 skipped.
  • Pre-commit hook re-ran the full suite + dashboard npm run build: 2924 passed, 41 skipped, dashboard build succeeded.

Replace the legacy shared/default Playwright session router with
per-user harness-browser profiles (`user-<id>`) so concurrent users no
longer share one Chrome session, cookie jar, or recording. The backend
now always derives the profile from the authenticated user (or the IM
thread's agent owner) instead of trusting client-supplied profile/session
ids, and a BrowserProfileMiddleware pins tool-selected profiles to the
same boundary. Also dedupes ThreadRegistry's session-refresh logic.
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