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

Support durable browser pool clear and zero updates#219
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.

IlyaasK added 2 commits August 6, 2026 16:58
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.
@IlyaasK
IlyaasK requested a review from Sayan- August 7, 2026 14:47
@IlyaasK
IlyaasK merged commit 23680fe into main Aug 7, 2026
7 checks passed
@IlyaasK
IlyaasK deleted the hypeship/cli-browser-pool-update-parity branch August 7, 2026 17:53

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit e3b5b42. Configure here.

Comment thread cmd/browser_pools.go
Viewport: viewport,
ChromePolicy: chromePolicy,
ChromePolicyFile: chromePolicyFile,
ClearChromePolicy: clearChromePolicy,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Zero fill rate shown as unset

Low Severity

formatFillRate still maps a 0 fill rate to -, so after a successful --fill-rate 0 pause update, browser-pools get presents the pool as having no fill rate instead of a paused 0 value. JSON output still carries the real number.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit e3b5b42. Configure here.

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