fix(helpers): resolve domain skills for subdomains and hyphenated hosts#165
Open
hnshah wants to merge 1 commit intobrowser-use:mainfrom
Open
fix(helpers): resolve domain skills for subdomains and hyphenated hosts#165hnshah wants to merge 1 commit intobrowser-use:mainfrom
hnshah wants to merge 1 commit intobrowser-use:mainfrom
Conversation
sauravpanda
pushed a commit
that referenced
this pull request
May 5, 2026
Adds an operator-facing skill for cloud.browser-use.com / api.browser-use.com,
covering the same REST surface that the harness's own admin.py already
uses (X-Browser-Use-API-Key header, /browsers, /profiles), plus a
companion script for the most common automation -- stopping zombie
sessions older than N minutes.
Live-tested on 2026-05-05 with a real BROWSER_USE_API_KEY:
POST /browsers 201 - shape verified incl. liveUrl on live.browser-use.com
PATCH /browsers/{id} stop 200 - returns final cost
GET /browsers 200 - paginated {items, totalItems, ...}
GET /profiles 200 - same envelope
GET /profiles/{id} 200 - cookieDomains=None on fresh profiles
GET /usage 404 - no public endpoint, doc'd accordingly
GET / 404 - no root metadata
The cleanup-zombies.py companion is the regression artefact; running it
in dry-run mode is the cheapest smoke test, and a full E2E loop
(spawn -> list -> stop -> re-list) was confirmed end-to-end during
authoring.
Notable wire gotchas surfaced and documented:
- Cost / proxy fields (proxyCost, browserCost, proxyUsedMb) are returned
as JSON strings, not numbers; cast to float before arithmetic.
- liveUrl host is live.browser-use.com (different from cloud.browser-use.com),
with the cdp WebSocket encoded as a ?wss= query parameter.
- cookieDomains can be null on a freshly-created profile despite
list_cloud_profiles' docstring describing it as an array.
- GET /usage returns 404 -- per-session cost lives on each browser
record; aggregate billing only on the dashboard.
Style follows the claude-ai/share-export (#267) pattern of
markdown-skill-with-companion-py, sized at 222 + 161 LOC. Discovery
under helpers.py:163's current logic would resolve cloud.browser-use.com
to "cloud/" rather than "browser-use-cloud/" -- the skill folder name
mirrors the convention used by claude-ai/, vercel/, and tasksquad-ai/
which are also not auto-discoverable today; PR #165 is the broader fix
for that.
Refs: PR #300 (run.py precedence fix in the same area), PR #267
(claude-ai companion-script pattern), PR #288 (vercel dashboard skill
header style).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
goto()extracts domain skills by taking the first segment of the hostname (booking.com→booking). This misses:booking.com→ folder isbooking-com, notbookingold.reddit.com→ looks forold, should findreddititch.io→ folder isitch-io,archive.org→ folder isarchive-orgAdded
_skill_dir()which tries a fallback chain:old.reddit.com→ tryold, thenreddit, thencom)booking.com→booking-com)Before / after
booking.combooking(missing)booking-comold.reddit.comold(missing)reddititch.ioitch(missing)itch-ioarchive.orgarchive(missing)archive-orgreddit.comredditreddit(unchanged)github.comgithubgithub(unchanged)Test plan
_skill_dir()against 11 URLs covering all casesgoto("https://www.booking.com")— returnsdomain_skills: ["scraping.md"]goto("https://old.reddit.com")— returnsdomain_skills: ["scraping.md"]github.com,reddit.com,stackoverflow.com) still resolve correctlySummary by cubic
Fixes domain-skill resolution in
goto()to correctly handle subdomains and hyphenated or multi-segment hosts. Adds_skill_dir()with a fallback search over hostname segments and the hyphenated full host.old.reddit.com→reddit).booking.com→booking-com,itch.io→itch-io).domain_skillsonly when a matching folder exists; otherwise response is unchanged.Written for commit a9299f7. Summary will update on new commits.