Repository navigation
fix: provision the agent-browser runtime for its skill stub - #6
Merged
Merged
Conversation
The web preset installs the agent-browser skill stub but never its CLI or browser binaries, so every agent-browser command failed with command not found (#4). - aginit init gains a conditional provisioning step: npm i -g agent-browser when the CLI is missing, then agent-browser install for the browser binaries; failures mark the setup incomplete - init and doctor detect kernel.apparmor_restrict_unprivileged_userns=1 (and kernel.unprivileged_userns_clone=0) and report the persisted sysctl fix plus the narrower --no-sandbox alternative, never changing system settings on the user's behalf - aginit doctor verifies the runtime when the project ships the skill: CLI presence and upstream agent-browser doctor --quick --offline --json findings
antomanc
added a commit
that referenced
this pull request
Oct 10, 2026
The web preset installs the agent-browser skill stub but never its CLI or browser binaries, so every agent-browser command failed with command not found (#4). - aginit init gains a conditional provisioning step: npm i -g agent-browser when the CLI is missing, then agent-browser install for the browser binaries; failures mark the setup incomplete - init and doctor detect kernel.apparmor_restrict_unprivileged_userns=1 (and kernel.unprivileged_userns_clone=0) and report the persisted sysctl fix plus the narrower --no-sandbox alternative, never changing system settings on the user's behalf - aginit doctor verifies the runtime when the project ships the skill: CLI presence and upstream agent-browser doctor --quick --offline --json findings
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4
The web preset installs the
.agents/skills/agent-browserskill stub, but nothing ever installed the CLI or the browser it drives — everyagent-browsercommand fails withcommand not found, and even a working CLI would then die on Ubuntu's sandbox restriction.What changed
New
src/adapters/agent-browser.tssetupAgentBrowser()—npm i -g agent-browseronly when the CLI is missing from PATH, thenagent-browser installfor the browser binaries (idempotent, ~0.1s when already present). A failed provisioning returnsfalseso init reports an incomplete setup, matching the Graft contract.findUsernsRestriction()— detectskernel.apparmor_restrict_unprivileged_userns=1andkernel.unprivileged_userns_clone=0. Detect & warn only: reports the persisted sysctl fix (/etc/sysctl.d/99-agent-browser-userns.conf) and the narrower--args "--no-sandbox"alternative, never changes system settings, never fails the run.runAgentBrowserDiagnostics()— orchestrates upstream's ownagent-browser doctor --quick --offline --json(0.2s) instead of duplicating browser-health logic.aginit init— conditional step[6/7] Provisioning agent-browser runtime, gated on the skill being inskills.sourcesor its stub already on disk. Non-web projects stay at 6 steps. Honors--dry-run(prints would-run lines) and--no-skills.aginit doctor— three new checks, only when the project ships the skill (or Playwright for the sandbox one):agent-browser CLI— presence + version, suggestionnpm i -g agent-browser && agent-browser installagent-browser browser runtime— upstream quick/offline JSON findings with their fixesChrome sandbox (unprivileged user namespaces)— the sysctl from the issue, with both remediationsVerification
pnpm typecheck && pnpm test && pnpm build— 12 files, 97 tests (13 new intests/agent-browser.test.ts: detection, provisioning success/failure/dry-run, sandbox warning rendering, init wiring, doctor output)✓ agent-browser CLI (0.39.0)/✓ browser runtime/✓ Chrome sandbox; a config without the skill prints no agent-browser output at all; the missing-CLI case prints the exact install suggestion; a simulated blocked kernel renders both fixes while still succeeding;--dry-runshows correct 7-step numbering with no writesNotes:
npm i -gregardless of the project's package manager — it matches the skill stub's own install line, npm ships with Node, and pnpm/yarn-global bin dirs are not reliably on PATH (same precedent as the Graft suggestion).