Skip to content

Support durable browser pool clear and zero updates - #219

Open
IlyaasK wants to merge 1 commit into
mainfrom
hypeship/cli-browser-pool-update-parity
Open

Support durable browser pool clear and zero updates#219
IlyaasK wants to merge 1 commit 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 how pool PATCH payloads are built (including clearing profile/proxy/extensions/policy); mistakes could alter live pool behavior, but scope is CLI-only with strong validation and serialized JSON tests.

Overview
kernel browser-pools update can now express explicit clears and zero values that the API treats differently from omission.

--fill-rate uses an Int64Flag so --fill-rate 0 is sent (pausing auto-fill) instead of being dropped. New --clear-profile, --clear-proxy, --clear-extensions, and --clear-chrome-policy remove durable pool config; empty extensions / chrome_policy on the wire go through SetExtraFields because the SDK omits empty collections. validateBrowserPoolUpdateInput rejects conflicting set/clear flags and negative fill rates before any API call. Empty {} chrome policy now clears policy (replacing the old warning-only behavior). README documents the new flags.

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

Preserve omitted values while allowing explicit zero fill rates and durable proxy, profile, extension, and Chrome policy clears. Verify the serialized SDK request bodies and reject conflicting or invalid inputs before making API calls.
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.

1 participant