Skip to content

chore(dev): replace chrome worktree symlink with stable agent-browser e2e harness#1014

Merged
buremba merged 1 commit into
mainfrom
feat/drop-chrome-symlink
May 21, 2026
Merged

chore(dev): replace chrome worktree symlink with stable agent-browser e2e harness#1014
buremba merged 1 commit into
mainfrom
feat/drop-chrome-symlink

Conversation

@buremba
Copy link
Copy Markdown
Member

@buremba buremba commented May 21, 2026

What

Retire the ~/.config/lobu-dev/active/chrome symlink-swap dev flow (task-use.sh) and replace it with a stable agent-browser-managed Chrome harness for Owletto e2e.

Why

The symlink swap never actually worked. Chrome canonicalizes the unpacked-extension path when you "Load unpacked", and reloads from that captured real path — it never re-resolves the symlink. So task-use's retarget was a no-op; the extension stayed pinned to whichever worktree was active at first load.

How

make e2e-browser (scripts/e2e-browser.sh) launches or reuses a stable agent-browser session named owletto with:

  • a persistent profile at ~/.config/lobu-dev/chrome
  • --extension pointed at the current worktree's apps/chrome source

The extension's fixed manifest key pins its ID regardless of load path, so chrome.storage.local (gateway URL + access/refresh tokens) persists in the profile and carries across worktrees — pair once, reuse from any agent session, mirroring the installed Mac app. agent-browser's CDP-launched Chrome also sidesteps Google Chrome stable's --load-extension gating.

Drive it from any session: agent-browser --session owletto <cmd>; RESTART=1 to pick up source/worktree changes.

Changes

  • delete scripts/task-use.sh; drop its calls from task-setup.sh / task-clean.sh
  • remove the task-use Makefile target, add e2e-browser
  • document the Chrome/Mac e2e approach in AGENTS.md

Validation

  • scripts pass bash -n; make help lists e2e-browser, no task-use; zero residual refs
  • make e2e-browser launches the owletto session, loads + enables the extension (verified via screenshot of chrome://extensions), creates the persistent profile, and reuses on a second run
  • confirmed chrome.storage.local lands under Default/Local Extension Settings/<fixed-id> in the profile

No TS/product code touched (shell + Makefile + docs only).

Summary by CodeRabbit

  • New Features

    • Added a make command to run Chrome e2e with a persistent browser profile and extension support.
    • Added a RESTART=1 option to restart or refresh browser sessions between runs.
  • Documentation

    • Added a detailed e2e browser setup and usage guide, including Mac app usage and session driving tips.
  • Chores

    • Removed legacy per-worktree task activation/auto-activation steps in favor of the new e2e-browser workflow.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 21, 2026

📝 Walkthrough

Walkthrough

The PR removes per-worktree Chrome symlink auto-activation, adds scripts/e2e-browser.sh to launch/reuse a persistent agent-browser Chrome profile, exposes make e2e-browser [RESTART=1], and updates documentation; setup/clean scripts no longer call the removed task-use workflow.

Changes

e2e-browser workflow migration

Layer / File(s) Summary
e2e-browser script and documentation
scripts/e2e-browser.sh, AGENTS.md
New scripts/e2e-browser.sh launches or reuses a persistent Chrome profile running the owletto agent-browser harness with --restart flag support, extension validation, gateway URL detection from .env.local, and session status checks. AGENTS.md documents the stable profile approach, the Mac Owletto.app alternative, and explicitly guides against re-introducing per-worktree symlinks.
Makefile target replacement
Makefile
Updates .PHONY targets, help output, and target definitions to replace task-use with e2e-browser, which invokes the new script with optional --restart when RESTART=1 is set.
Remove task-use auto-activation from setup/clean workflows
scripts/task-setup.sh, scripts/task-clean.sh, scripts/task-use.sh
task-setup.sh no longer auto-invokes task-use.sh after marking a worktree; task-clean.sh removes the fallback reset logic that invoked task-use.sh main when the active task was deleted; the deprecated task-use.sh script is removed entirely. A comment reference in task-clean.sh is updated to match task-setup.sh's rationale.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • lobu-ai/lobu#912: Related edits to e2e/scripts and task-use symlink behavior; both PRs touch Chrome extension/worktree handling.
  • lobu-ai/lobu#891: Prior changes to task/worktree "use" flow that this PR removes or replaces.
  • lobu-ai/lobu#876: Changes involving the owletto extension and e2e harness that relate to the new e2e-browser usage.

Poem

🐰 A little rabbit hops to test and play,
One profile stays through night and day,
No symlink swaps, no floppy chore,
The owletto session opens the door. 🥕

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description includes a thorough explanation (What/Why/How), validation details, and file change summary, but lacks the Test plan checklist from the template. Add the Test plan section with checkboxes indicating which validations were run (e.g., bash -n check, make help verification, functional e2e-browser test).
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: replacing a chrome worktree symlink approach with a stable agent-browser e2e harness, which directly reflects the core objective of this PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/drop-chrome-symlink

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov-commenter
Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

… e2e harness

The ~/.config/lobu-dev/active/chrome symlink swap (task-use.sh) never worked:
Chrome canonicalizes the unpacked-extension path at load time and reloads from
that captured real path, so retargeting the symlink was a no-op. Remove it.

Replace with `make e2e-browser` (scripts/e2e-browser.sh): launches/reuses a
stable agent-browser session ("owletto") with a persistent profile
(~/.config/lobu-dev/chrome) and --extension pointed at the current worktree.
The extension's fixed manifest key pins its ID across worktrees, so
chrome.storage.local (gateway URL + auth) persists — pair once, reuse from any
agent session, like the installed Mac app. agent-browser's CDP-launched Chrome
also isn't subject to Google Chrome stable's --load-extension gating.

- delete scripts/task-use.sh; drop its calls from task-setup.sh/task-clean.sh
- remove the `task-use` Makefile target, add `e2e-browser`
- document the Chrome/Mac e2e approach in AGENTS.md
@buremba buremba force-pushed the feat/drop-chrome-symlink branch from eb9263e to be15550 Compare May 21, 2026 03:14
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/e2e-browser.sh`:
- Around line 74-75: The agent-browser launch is currently masked by "|| true",
hiding failures; remove the "|| true" from the agent-browser invocation and
instead capture its exit status (e.g., check $? or use set -e) so failures cause
the script to fail or be handled explicitly; only print the success message ("->
launched '$session'") when the agent-browser command actually succeeded, and
apply the same fix to the similar launch block around lines 80-84 to avoid
misleading success output.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 03f16474-ac1b-4c35-830f-176b8fe727eb

📥 Commits

Reviewing files that changed from the base of the PR and between 176a3f1 and eb9263e.

📒 Files selected for processing (6)
  • AGENTS.md
  • Makefile
  • scripts/e2e-browser.sh
  • scripts/task-clean.sh
  • scripts/task-setup.sh
  • scripts/task-use.sh
💤 Files with no reviewable changes (2)
  • scripts/task-use.sh
  • scripts/task-setup.sh

Comment thread scripts/e2e-browser.sh
Comment on lines +74 to +75
agent-browser --session "$session" --profile "$profile" --extension "$ext" --headed open "$url" >/dev/null 2>&1 || true
echo "-> launched '$session'"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Do not swallow browser launch failures on the main launch path.

At Line 74, || true masks startup failures, but Lines 80-84 still print success. This can mislead e2e runs into proceeding without a real harness.

Proposed fix
-  agent-browser --session "$session" --profile "$profile" --extension "$ext" --headed open "$url" >/dev/null 2>&1 || true
+  if ! agent-browser --session "$session" --profile "$profile" --extension "$ext" --headed open "$url" >/dev/null 2>&1; then
+    echo "error: failed to launch '$session' with extension/profile" >&2
+    exit 1
+  fi
   echo "-> launched '$session'"
   echo "   profile:   $profile"
   echo "   extension: $ext"
 fi

Also applies to: 80-84

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/e2e-browser.sh` around lines 74 - 75, The agent-browser launch is
currently masked by "|| true", hiding failures; remove the "|| true" from the
agent-browser invocation and instead capture its exit status (e.g., check $? or
use set -e) so failures cause the script to fail or be handled explicitly; only
print the success message ("-> launched '$session'") when the agent-browser
command actually succeeded, and apply the same fix to the similar launch block
around lines 80-84 to avoid misleading success output.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
scripts/e2e-browser.sh (1)

86-90: ⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Browser launch failure is still masked by || true.

This issue was previously flagged in the past review. Line 86's || true suppresses the launch failure, but lines 87-90 still report success, misleading e2e runs into proceeding without a working browser harness.

🐛 Proposed fix
-  agent-browser --session "$session" --profile "$profile" --extension "$ext" --headed open "$url" >/dev/null 2>&1 || true
+  if ! agent-browser --session "$session" --profile "$profile" --extension "$ext" --headed open "$url" >/dev/null 2>&1; then
+    echo "error: failed to launch '$session' with extension/profile" >&2
+    exit 1
+  fi
   echo "-> launched '$session'"
   echo "   profile:   $profile"
   echo "   extension: $ext"

Note: Line 84 (reuse path) is intentionally non-fatal per the comment on line 83, since a down gateway shouldn't fail the script when the browser is already verified running.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/e2e-browser.sh` around lines 86 - 90, The agent-browser launch is
being masked by the trailing "|| true" which hides failures while the subsequent
echo lines still report success; update the agent-browser invocation (the
command that starts with "agent-browser --session \"$session\" --profile
\"$profile\" --extension \"$ext\" --headed open \"$url\"") to remove "|| true"
and instead check its exit status: if it fails, log an explicit error and exit
non‑zero so the script stops (or otherwise handle the failure path), while
keeping the reuse-path behavior mentioned earlier non‑fatal as intended; ensure
the success echo lines only run when the agent-browser command actually
succeeded.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Duplicate comments:
In `@scripts/e2e-browser.sh`:
- Around line 86-90: The agent-browser launch is being masked by the trailing
"|| true" which hides failures while the subsequent echo lines still report
success; update the agent-browser invocation (the command that starts with
"agent-browser --session \"$session\" --profile \"$profile\" --extension
\"$ext\" --headed open \"$url\"") to remove "|| true" and instead check its exit
status: if it fails, log an explicit error and exit non‑zero so the script stops
(or otherwise handle the failure path), while keeping the reuse-path behavior
mentioned earlier non‑fatal as intended; ensure the success echo lines only run
when the agent-browser command actually succeeded.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 3d5bd84f-6c9d-4796-b4ed-4f370a1d8349

📥 Commits

Reviewing files that changed from the base of the PR and between eb9263e and be15550.

📒 Files selected for processing (6)
  • AGENTS.md
  • Makefile
  • scripts/e2e-browser.sh
  • scripts/task-clean.sh
  • scripts/task-setup.sh
  • scripts/task-use.sh
💤 Files with no reviewable changes (2)
  • scripts/task-use.sh
  • scripts/task-setup.sh
✅ Files skipped from review due to trivial changes (1)
  • AGENTS.md

@buremba buremba merged commit 95f4ca8 into main May 21, 2026
22 checks passed
@buremba buremba deleted the feat/drop-chrome-symlink branch May 21, 2026 15:20
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