Skip to content

Add session name & tags to browsers and acquire (kernel-go-sdk v0.65.0)#177

Merged
bmsaadat merged 2 commits into
mainfrom
bmsaadat/cli-api-field-support
Jun 9, 2026
Merged

Add session name & tags to browsers and acquire (kernel-go-sdk v0.65.0)#177
bmsaadat merged 2 commits into
mainfrom
bmsaadat/cli-api-field-support

Conversation

@bmsaadat

@bmsaadat bmsaadat commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Adds name and tags support to the browser commands — browsers create/get/update/delete/list and browser-pools acquire — modeled on the existing profiles CLI and the hypeman --tag KEY=VALUE convention: create/acquire set them, get/list/JSON echo them, list gains a --tag filter plus a Name column, and lookups now accept <id-or-name>. This requires bumping kernel-go-sdk v0.58.0 → v0.65.0, whose unrelated breaking changes are absorbed in a separate first commit — all list endpoints became paginated (so browser-pools/proxies/credential-providers/extensions list now read pages and gain --limit/--offset flags), proxy config unions were renamed, and the proxy API dropped carrier entirely. The PR is two clean commits — migration first, then feature — and adds unit tests across the new flags, the tag parser, and the shared acquire-params helper. Note one user-visible change: kernel proxies create --carrier is no longer accepted (mobile create also no longer takes zip/asn), because the upstream API removed mobile carrier selection.


Note

Medium Risk
SDK bump changes list/pagination and proxy create semantics (dropped --carrier); behavior is covered by tests but users with mobile carrier scripts will break.

Overview
Bumps kernel-go-sdk to v0.65.0 and adds browser session name and tags across the CLI: browsers create / pool acquire accept --name and repeatable --tag KEY=VALUE; list filters with --tag, shows a Name column, and broadens --query; get/update/delete/view take <id-or-name>. Pool leases share buildAcquireParams so browser-pools acquire and browsers create --pool-* forward name/tags the same way.

The SDK upgrade also drives paginated list handling for browser-pools, proxies, extensions, and credential-providers (--limit / --offset), renamed proxy config unions, and removal of mobile --carrier (plus warnings when --zip/--asn are passed for mobile). README and unit tests cover the new flags, tag parsing, and acquire helper.

Reviewed by Cursor Bugbot for commit 188bbf9. Bugbot is set up for automated code reviews on this repo. Configure here.


Manual testing

Tested end-to-end against a locally running Kernel API (KERNEL_BASE_URL=http://localhost:3001) using the CLI built from this branch — creating, querying, and deleting real browsers, pools, and proxies and asserting both the CLI output and the request params forwarded to the API. All scenarios below passed locally; every test resource was cleaned up afterward.

Area Scenario Result
Build / auth CLI builds, authenticates, and reaches the local API ✅ pass
Flags / help create exposes --name/--tag; list exposes --query/--tag/--limit/--offset; acquire exposes --name/--tag; all four migrated list commands expose --limit/--offset ✅ pass
Relabel get/view/update/delete show <id-or-name>; update no-arg error and delete usage corrected ✅ pass
Create --name + repeatable --tag → name and sorted tags in table and JSON ✅ pass
Create duplicate name rejected (Conflict: browser session name already exists) ✅ pass
Create special-character tag key (region.us=1) round-trips ✅ pass
get / view resolve by ID and by name (same session); name/tags in detail + JSON; view -o json{liveViewUrl}; not-found handled ✅ pass
update resolves by name and applies change; -o json echoes name/tags; no --name/--tag flags (creation-only) ✅ pass
delete mixed ID + name in one call; idempotent on already-deleted ✅ pass
list Name column; --tag deepObject filter; multiple --tag ANDed; --query matches name; JSON carries name/tags ✅ pass
pool acquire --name/--tag applied per-lease and echoed; cleared on release ✅ pass
create-from-pool --pool-name --name --tag forwards name/tags to the acquired lease; both-pool-flags rejected ✅ pass
proxies migration datacenter/isp/residential/mobile create OK; mobile --zip/--asn warns and still creates; residential keeps zip/asn; --carrier flag gone, no Carrier in get/list/check ✅ pass
pagination --limit/--offset on browsers / pools / proxies list ✅ pass
negative proxies create --carrierUnknown flag; -o yaml rejected; app list unaffected ✅ pass

Environment notes (not CLI issues): the local stack throttles rapid successive creates (spaced requests succeed) and does not enforce the documented 50-tag max; custom-proxy create requires a reachable proxy (the server connection-tests it). The create --pool-* --stealth conflict still uses an interactive confirm that blocks under non-TTY — pre-existing behavior, worth a follow-up. The ">20 items, no silent truncation" case wasn't exercised (would need many live browsers); the pagination mechanism itself was validated via --limit/--offset.

🤖 Generated with Claude Code

bmsaadat and others added 2 commits June 8, 2026 21:22
Mechanical migration required by the SDK bump (no new features). The bump is
needed for upcoming browser/acquire name+tags support, but v0.65.0 also ships
unrelated breaking changes that the cmd packages must absorb to compile:

- All list endpoints are now paginated. Update the List interface signatures
  and call sites for browser pools, proxies, credential providers, and
  extensions to take *ListParams and read OffsetPagination.Items. Because the
  pre-bump List returned the full unpaginated slice, these four commands gain
  --limit/--offset flags so they can page through results (matching the
  existing browsers/profiles/api-keys list convention) instead of silently
  truncating to the first page.
- Browser pool update Size is now param.Opt[int64].
- Proxy config unions were renamed (ProxyNewParamsConfigDatacenterProxyConfig →
  ProxyNewParamsConfigDatacenter, OfProxyNewsConfig… → OfDatacenter, etc.).
- The proxy API dropped `carrier` from both request (mobile create) and
  response configs, so the CLI no longer accepts --carrier or displays Carrier
  (mobile get/list now surface City/State instead). Mobile create also no
  longer supports zip/asn; passing them warns and they are ignored. The proxy
  command docs in README.md are trimmed to match.

Tests updated to the new fake List signatures and config shapes, plus
limit/offset forwarding tests for the proxy, extension, and credential-provider
list commands.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Surface the new Kernel API name/tags fields in the CLI, modeled on the
profiles command and the hypeman CLI tag convention.

browsers:
- create: --name and repeatable --tag KEY=VALUE (parsed with a hypeman-style
  parser that warns on malformed pairs); forwarded to BrowserNewParams.
- get/view/update/delete now accept <id-or-name> (SDK resolves either); name
  and tags are shown in the get detail table, the JSON output, and a new Name
  column in list.
- list: --tag KEY=VALUE filter (deepObject, ANDed) and --query now also
  matches name.
- create --pool-id/--pool-name: --name/--tag now apply to the acquired lease.
- Note: name/tags are creation-time only. get/list and JSON responses echo
  them, but update cannot change them (the SDK BrowserUpdateParams has no
  name/tags), so update offers no such flags.

browser-pools acquire: --name and --tag apply per-lease (cleared on release),
forwarded to BrowserPoolAcquireParams and shown in the acquired-session table.

The per-lease acquire params (name/tags/timeout) are built by a single shared
buildAcquireParams helper used by both `browser-pools acquire` and the
`browsers create --pool-*` path, so the two cannot silently diverge.

Adds parseKeyValueSpecs/tagsFromFlag/formatTags helpers and tests for create,
list, get (incl. JSON output), acquire, pool-list limit/offset forwarding, the
buildAcquireParams forwarding contract, the parser, and the malformed-tag
warning path. README is updated for the new browser and acquire flags.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedgolang/​github.com/​kernel/​kernel-go-sdk@​v0.58.0 ⏵ v0.65.072 +1100100100100

View full report

@firetiger-agent

Copy link
Copy Markdown

Created a monitoring plan for this PR.

What this PR does: Adds optional browser session names and tag filtering to the kernel CLI, and enables pagination (--limit/--offset) on browser-pool, proxy, extensions, and credential-provider list commands. Users can now name sessions at creation and look them up by name instead of ID. This is a CLI-only change — no server-side code is modified.

Intended effect:

  • POST /browsers (name + tags fields): baseline 0–7 server errors/hr; confirmed if the new optional name/tags params are accepted with no new 4xx/5xx surge.
  • POST /browser-pools/:id/acquire (name + tags): baseline near 0 errors on acquire; confirmed if acquire continues without errors.
  • GET /proxies / /extensions / /credential-providers (pagination params): baseline 0 server errors on list endpoints; confirmed if limit/offset params are accepted cleanly.

Risks:

  • 400 validation on POST /browsers – if the API rejects name or tags fields (type mismatch or uniqueness collision), users get silent CLI errors; alert if POST /browsers 4xx rate exceeds 2% (baseline ~0.5%).
  • Proxy SDK type rename regression – field rename (OfProxyNewsConfigDatacenterProxyConfigOfDatacenter) could silently send empty config; alert if POST /v1/proxies error rate exceeds 5%.
  • Mobile --carrier removal – existing user scripts calling kernel proxies create --type mobile --carrier <x> will break with a flag-not-found error; not observable via API telemetry; first user invocation surfaces it.
  • API 5xx overall regression – alert if server errors/hr exceeds 100 (baseline 0–47/hr).

Status updates will be posted automatically on this PR as monitoring progresses.

View monitor

@Sayan- Sayan- left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

thanks for making this easy to review!

@bmsaadat bmsaadat merged commit 06fbbaa into main Jun 9, 2026
7 checks passed
@bmsaadat bmsaadat deleted the bmsaadat/cli-api-field-support branch June 9, 2026 15:38
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