Skip to content

Support durable browser pool clear and zero updates - #219

Merged
IlyaasK merged 3 commits into
mainfrom
hypeship/cli-browser-pool-update-parity
Aug 7, 2026
Merged

IlyaasK merged 3 commits into
mainfrom
hypeship/cli-browser-pool-update-parity

Conversation

@IlyaasK

@IlyaasK IlyaasK commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • preserve explicit --fill-rate 0 on browser-pool updates
  • add clear controls for proxy, profile, extensions, and Chrome policy
  • serialize SDK-supported empty PATCH sentinels exactly
  • reject conflicting set/clear flags before making a request

Why

The merged browser-pool API distinguishes omission from explicit empty and zero values. The CLI previously could not express several durable clear operations and silently omitted a zero fill rate.

Implementation

Update flags track whether numeric values were explicitly supplied. Empty arrays and objects use the SDK's SetExtraFields escape hatch because generated omitzero fields otherwise drop them. Create behavior is unchanged.

Verification

  • go test -short -timeout=2m ./...
  • go vet ./...
  • gofmt -l cmd
  • git diff --check
  • serialized JSON scenario tests for omission, zero, every clear sentinel, and conflicting flags
  • targeted mutation checks: 5/5 durable PATCH mutations killed
  • crap4go: validator CRAP 15.1; Update improved from baseline 91.3 to 78.7 through added coverage

Note

Medium Risk
Changes PATCH payload semantics for browser pools (clear sentinels and fill-rate zero), which can alter live pool behavior when users run update; scope is limited to the CLI update path with new validation and tests.

Overview
kernel browser-pools update now matches the API’s distinction between omitting a field and sending explicit empty/zero values.

Fill rate: --fill-rate uses an Int64Flag so --fill-rate 0 is sent (pauses automatic filling) instead of being dropped when the value was previously treated as “unset.”

Clear flags: New --clear-profile, --clear-proxy, --clear-extensions, and --clear-chrome-policy remove durable pool config (alongside existing --clear-start-url). Conflicting set/clear combinations are rejected in validateBrowserPoolUpdateInput before any API call.

Wire format: Empty extensions and chrome_policy use the SDK SetExtraFields escape hatch so [] and {} survive omitzero encoding. Inline/file {} chrome policy now clears policy instead of warning and doing nothing.

README documents the new flags and behavior. Tests replace empty-policy warning cases with JSON serialization and validation coverage.

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

Loading
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