Support durable browser pool clear and zero updates - #219
Open
IlyaasK wants to merge 1 commit into
Open
Conversation
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.
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
--fill-rate 0on browser-pool updatesWhy
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
SetExtraFieldsescape hatch because generatedomitzerofields otherwise drop them. Create behavior is unchanged.Verification
go test -short -timeout=2m ./...go vet ./...gofmt -l cmdgit diff --checkUpdateimproved from baseline 91.3 to 78.7 through added coverageNote
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 updatecan now express explicit clears and zero values that the API treats differently from omission.--fill-rateuses anInt64Flagso--fill-rate 0is sent (pausing auto-fill) instead of being dropped. New--clear-profile,--clear-proxy,--clear-extensions, and--clear-chrome-policyremove durable pool config; emptyextensions/chrome_policyon the wire go throughSetExtraFieldsbecause the SDK omits empty collections.validateBrowserPoolUpdateInputrejects 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.