Skip to content

Commit 4771197

Browse files
feat: Auto-default refresh_on_profile_update when browser pool profile changes
1 parent 2b86ff3 commit 4771197

5 files changed

Lines changed: 22 additions & 13 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 127
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel/kernel-9143bc729ef60beffa0bbd9b601bb095083e41e23c8994553e69302f586882f5.yml
3-
openapi_spec_hash: bd04c530cfa8188af0e63a784129645d
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel/kernel-25b48b79d356843aeda41e5e5c3c407c5bd5c12f9548500ffc0a6696e6acd941.yml
3+
openapi_spec_hash: f710169690ab7aca30c91968e752cff7
44
config_hash: 77ee715aa17061166f9a02b264a21b8d

src/kernel/resources/browser_pools.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ def create(
122122
the same project as the browser session.
123123
124124
refresh_on_profile_update: When true, flush idle browsers when the profile the pool uses is updated, so
125-
pool browsers pick up the latest profile data. Requires a profile to be set on
126-
the pool.
125+
pool browsers pick up the latest profile data. When a profile is provided during
126+
creation, this defaults to true. Requires a profile to be set on the pool.
127127
128128
start_url: Optional URL to navigate to when a new browser is warmed into the pool.
129129
Best-effort: failures to navigate do not fail pool fill. Only applied to
@@ -291,7 +291,10 @@ def update(
291291
proxy unchanged.
292292
293293
refresh_on_profile_update: If provided, replaces whether idle browsers are flushed when the profile the
294-
pool uses is updated. Requires a profile to be set on the pool.
294+
pool uses is updated. When the pool's profile reference is changed (including
295+
newly attached) and this field is omitted, it defaults to true. Re-sending the
296+
same profile reference leaves this setting unchanged. Clearing the profile also
297+
disables this setting. Requires a profile to be set on the pool.
295298
296299
size: If provided, replaces the number of browsers to maintain in the pool. The
297300
maximum size is determined by your organization's pooled sessions limit (the sum
@@ -697,8 +700,8 @@ async def create(
697700
the same project as the browser session.
698701
699702
refresh_on_profile_update: When true, flush idle browsers when the profile the pool uses is updated, so
700-
pool browsers pick up the latest profile data. Requires a profile to be set on
701-
the pool.
703+
pool browsers pick up the latest profile data. When a profile is provided during
704+
creation, this defaults to true. Requires a profile to be set on the pool.
702705
703706
start_url: Optional URL to navigate to when a new browser is warmed into the pool.
704707
Best-effort: failures to navigate do not fail pool fill. Only applied to
@@ -866,7 +869,10 @@ async def update(
866869
proxy unchanged.
867870
868871
refresh_on_profile_update: If provided, replaces whether idle browsers are flushed when the profile the
869-
pool uses is updated. Requires a profile to be set on the pool.
872+
pool uses is updated. When the pool's profile reference is changed (including
873+
newly attached) and this field is omitted, it defaults to true. Re-sending the
874+
same profile reference leaves this setting unchanged. Clearing the profile also
875+
disables this setting. Requires a profile to be set on the pool.
870876
871877
size: If provided, replaces the number of browsers to maintain in the pool. The
872878
maximum size is determined by your organization's pooled sessions limit (the sum

src/kernel/types/browser_pool.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ class BrowserPoolConfig(BaseModel):
9191
refresh_on_profile_update: Optional[bool] = None
9292
"""
9393
When true, flush idle browsers when the profile the pool uses is updated, so
94-
pool browsers pick up the latest profile data. Requires a profile to be set on
95-
the pool.
94+
pool browsers pick up the latest profile data. When a profile is provided during
95+
creation, this defaults to true. Requires a profile to be set on the pool.
9696
"""
9797

9898
start_url: Optional[str] = None

src/kernel/types/browser_pool_create_params.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ class BrowserPoolCreateParams(TypedDict, total=False):
7171
refresh_on_profile_update: bool
7272
"""
7373
When true, flush idle browsers when the profile the pool uses is updated, so
74-
pool browsers pick up the latest profile data. Requires a profile to be set on
75-
the pool.
74+
pool browsers pick up the latest profile data. When a profile is provided during
75+
creation, this defaults to true. Requires a profile to be set on the pool.
7676
"""
7777

7878
start_url: str

src/kernel/types/browser_pool_update_params.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,10 @@ class BrowserPoolUpdateParams(TypedDict, total=False):
7777
refresh_on_profile_update: bool
7878
"""
7979
If provided, replaces whether idle browsers are flushed when the profile the
80-
pool uses is updated. Requires a profile to be set on the pool.
80+
pool uses is updated. When the pool's profile reference is changed (including
81+
newly attached) and this field is omitted, it defaults to true. Re-sending the
82+
same profile reference leaves this setting unchanged. Clearing the profile also
83+
disables this setting. Requires a profile to be set on the pool.
8184
"""
8285

8386
size: int

0 commit comments

Comments
 (0)