openclaw - 💡(How to fix) Fix Browser: add explicit import from existing-session profile into managed openclaw profile [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#56793Fetched 2026-04-08 01:47:43
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0

Add an explicit one-shot import/clone flow that copies a user browser profile into a managed openclaw browser profile.

Root Cause

Add an explicit one-shot import/clone flow that copies a user browser profile into a managed openclaw browser profile.

RAW_BUFFERClick to expand / collapse

Summary

Add an explicit one-shot import/clone flow that copies a user browser profile into a managed openclaw browser profile.

Problem

Today openclaw and existing-session profiles are separate by design.

  • managed openclaw profiles launch with their own user-data-dir
  • existing-session profiles attach to a live Chrome/Chromium session via Chrome MCP

There is currently no supported way to seed a managed openclaw profile from the user's existing browser state.

Why this should not be automatic

Automatic copying on startup would be surprising and fragile:

  • it can race with a live browser session
  • it can pull in lock files and transient state
  • it mixes personal browser state into a managed profile without explicit intent

Proposed behavior

Add an explicit import command/API, for example:

  • CLI: openclaw browser profiles import --from user --to openclaw
  • or server route: POST /profiles/import

Suggested flow:

  1. stop/reset the destination managed profile
  2. resolve the source browser user-data-dir
  3. copy/import into the managed OpenClaw profile dir
  4. strip transient lock/runtime files
  5. relaunch the managed profile

Acceptance

  • import is explicit, not automatic
  • works for same-machine same-user browser data
  • leaves source profile untouched
  • destination remains a normal managed openclaw profile after import
  • docs explain that this is a one-time import, not live sync

extent analysis

Fix: Implement Explicit One-Shot Import/Clone Flow

To implement the proposed behavior, we will create a CLI command and a server route to handle the import process.

Fix Plan

  • Step 1: Stop/Reset Destination Managed Profile
    • Use the following code snippet to stop and reset the destination profile:

import subprocess import shutil

def reset_destination_profile(profile_dir): # Stop the managed profile subprocess.run(["pkill", "-f", "openclaw"]) # Reset the profile directory shutil.rmtree(profile_dir) # Recreate the profile directory os.makedirs(profile_dir)

* **Step 2: Resolve Source Browser User-Data-Dir**
  * Use the following code snippet to resolve the source browser user-data-dir:
  ```python
import os

def resolve_source_profile_dir():
    # Resolve the source browser user-data-dir
    source_dir = os.path.join(os.path.expanduser("~"), ".config/chromium")
    return source_dir
  • Step 3: Copy/Import into Managed OpenClaw Profile Dir
    • Use the following code snippet to copy the source profile into the destination profile:

import shutil

def copy_profile(source_dir, destination_dir): # Copy the source profile into the destination profile shutil.copytree(source_dir, destination_dir)

* **Step 4: Strip Transient Lock/Runtime Files**
  * Use the following code snippet to strip transient lock/runtime files:
  ```python
import os

def strip_transient_files(profile_dir):
    # Strip transient lock/runtime files
    for root, dirs, files in os.walk(profile_dir):
        for file in files:
            if file.endswith(".lock") or file.endswith(".runtime"):
                os.remove(os.path.join(root, file))
  • Step 5: Relaunch Managed Profile
    • Use the following code snippet to relaunch the managed profile:

import subprocess

def relaunch_profile(profile_dir): # Relaunch the managed profile subprocess.run(["openclaw", "--user-data-dir", profile_dir])


### Verification
To verify that the fix worked, run the following command:
```bash
openclaw browser profiles import --from user --to openclaw

This should import the user's existing browser state into the managed OpenClaw profile.

Extra Tips

  • Make sure to handle errors and exceptions properly in the implementation.
  • Consider adding logging and monitoring to track the import process.
  • Ensure that the implementation is secure and follows best practices for handling user data.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING