Skip to content

Commit 8c85318

Browse files
docs(openapi): describe unified concurrency limit, deprecate max_pooled_sessions (CUS-275)
1 parent 9b3ba00 commit 8c85318

7 files changed

Lines changed: 49 additions & 41 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: 125
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel/kernel-ba32039d3975da7aa6d28e5184f0a44c9fbfe36ab7dbc71985d14e2ecc0867b9.yml
3-
openapi_spec_hash: a9f32fc90c2add2ae85af828c298e35b
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel/kernel-db45aab5b114bc0848eab997c85bfc02a653be9f929f8d090ec24187462733ee.yml
3+
openapi_spec_hash: 82f4282312699f8d54bec207e981efe8
44
config_hash: 06186eb40e0058a2a87ac251fc07415d

src/kernel/resources/organization/limits.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@ def retrieve(
5656
timeout: float | httpx.Timeout | None | NotGiven = not_given,
5757
) -> OrgLimits:
5858
"""
59-
Get the organization's concurrent session ceiling and the default per-project
60-
concurrency cap applied to projects without an explicit override.
59+
Get the organization's concurrency limit — the maximum browsers running at once
60+
across on-demand sessions and browser pool reservations — and the default
61+
per-project concurrency cap applied to projects without an explicit override.
6162
"""
6263
return self._get(
6364
"/org/limits",
@@ -81,13 +82,12 @@ def update(
8182
"""
8283
Set the default per-project concurrency cap applied to projects without an
8384
explicit override. Set the value to 0 to remove the default; omit to leave it
84-
unchanged. The default cannot exceed the organization's concurrent session
85-
ceiling.
85+
unchanged. The default cannot exceed the organization's concurrency limit.
8686
8787
Args:
88-
default_project_max_concurrent_sessions: Default maximum concurrent browser sessions for projects without an explicit
89-
override. Set to 0 to remove the default; omit to leave unchanged. Cannot exceed
90-
the organization's concurrent session ceiling.
88+
default_project_max_concurrent_sessions: Default maximum concurrent browsers for projects without an explicit override.
89+
Set to 0 to remove the default; omit to leave unchanged. Cannot exceed the
90+
organization's concurrency limit.
9191
9292
extra_headers: Send extra headers
9393
@@ -143,8 +143,9 @@ async def retrieve(
143143
timeout: float | httpx.Timeout | None | NotGiven = not_given,
144144
) -> OrgLimits:
145145
"""
146-
Get the organization's concurrent session ceiling and the default per-project
147-
concurrency cap applied to projects without an explicit override.
146+
Get the organization's concurrency limit — the maximum browsers running at once
147+
across on-demand sessions and browser pool reservations — and the default
148+
per-project concurrency cap applied to projects without an explicit override.
148149
"""
149150
return await self._get(
150151
"/org/limits",
@@ -168,13 +169,12 @@ async def update(
168169
"""
169170
Set the default per-project concurrency cap applied to projects without an
170171
explicit override. Set the value to 0 to remove the default; omit to leave it
171-
unchanged. The default cannot exceed the organization's concurrent session
172-
ceiling.
172+
unchanged. The default cannot exceed the organization's concurrency limit.
173173
174174
Args:
175-
default_project_max_concurrent_sessions: Default maximum concurrent browser sessions for projects without an explicit
176-
override. Set to 0 to remove the default; omit to leave unchanged. Cannot exceed
177-
the organization's concurrent session ceiling.
175+
default_project_max_concurrent_sessions: Default maximum concurrent browsers for projects without an explicit override.
176+
Set to 0 to remove the default; omit to leave unchanged. Cannot exceed the
177+
organization's concurrency limit.
178178
179179
extra_headers: Send extra headers
180180

src/kernel/resources/projects/limits.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,13 @@ def update(
104104
max_concurrent_invocations: Maximum concurrent app invocations for this project. Set to 0 to remove the cap;
105105
omit to leave unchanged.
106106
107-
max_concurrent_sessions: Maximum concurrent browser sessions for this project. Set to 0 to remove the
108-
cap; omit to leave unchanged.
107+
max_concurrent_sessions: Maximum concurrent browsers for this project, covering both on-demand sessions
108+
and browser pool reservations. Set to 0 to remove the cap; omit to leave
109+
unchanged.
109110
110-
max_pooled_sessions: Maximum pooled sessions capacity for this project. Set to 0 to remove the cap;
111-
omit to leave unchanged.
111+
max_pooled_sessions: Deprecated: pooled browsers now count toward `max_concurrent_sessions`. Requests
112+
that set this field are rejected with a 400 once the unified concurrency limit
113+
is enabled for your organization.
112114
113115
extra_headers: Send extra headers
114116
@@ -218,11 +220,13 @@ async def update(
218220
max_concurrent_invocations: Maximum concurrent app invocations for this project. Set to 0 to remove the cap;
219221
omit to leave unchanged.
220222
221-
max_concurrent_sessions: Maximum concurrent browser sessions for this project. Set to 0 to remove the
222-
cap; omit to leave unchanged.
223+
max_concurrent_sessions: Maximum concurrent browsers for this project, covering both on-demand sessions
224+
and browser pool reservations. Set to 0 to remove the cap; omit to leave
225+
unchanged.
223226
224-
max_pooled_sessions: Maximum pooled sessions capacity for this project. Set to 0 to remove the cap;
225-
omit to leave unchanged.
227+
max_pooled_sessions: Deprecated: pooled browsers now count toward `max_concurrent_sessions`. Requests
228+
that set this field are rejected with a 400 once the unified concurrency limit
229+
is enabled for your organization.
226230
227231
extra_headers: Send extra headers
228232

src/kernel/types/organization/limit_update_params.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010

1111
class LimitUpdateParams(TypedDict, total=False):
1212
default_project_max_concurrent_sessions: Optional[int]
13-
"""
14-
Default maximum concurrent browser sessions for projects without an explicit
15-
override. Set to 0 to remove the default; omit to leave unchanged. Cannot exceed
16-
the organization's concurrent session ceiling.
13+
"""Default maximum concurrent browsers for projects without an explicit override.
14+
15+
Set to 0 to remove the default; omit to leave unchanged. Cannot exceed the
16+
organization's concurrency limit.
1717
"""

src/kernel/types/organization/org_limits.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,16 @@
1010
class OrgLimits(BaseModel):
1111
default_project_max_concurrent_sessions: Optional[int] = None
1212
"""
13-
Default maximum concurrent browser sessions applied to every project that has no
13+
Default maximum concurrent browsers applied to every project that has no
1414
explicit per-project override. Null means no org-level default, so such projects
1515
are uncapped (only the org-wide limit applies). Applies to existing and newly
1616
created projects.
1717
"""
1818

1919
max_concurrent_sessions: Optional[int] = None
2020
"""
21-
The organization's effective concurrent browser session ceiling, from its plan
22-
or an override. Read-only and shared across all projects in the org; a
21+
The organization's effective concurrency limit — the maximum browsers running at
22+
once, covering both on-demand sessions and browser pool reservations — from its
23+
plan or an override. Read-only and shared across all projects in the org; a
2324
per-project default cannot exceed it.
2425
"""

src/kernel/types/projects/limit_update_params.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@ class LimitUpdateParams(TypedDict, total=False):
1616
"""
1717

1818
max_concurrent_sessions: Optional[int]
19-
"""Maximum concurrent browser sessions for this project.
20-
21-
Set to 0 to remove the cap; omit to leave unchanged.
19+
"""
20+
Maximum concurrent browsers for this project, covering both on-demand sessions
21+
and browser pool reservations. Set to 0 to remove the cap; omit to leave
22+
unchanged.
2223
"""
2324

2425
max_pooled_sessions: Optional[int]
25-
"""Maximum pooled sessions capacity for this project.
26+
"""Deprecated: pooled browsers now count toward `max_concurrent_sessions`.
2627
27-
Set to 0 to remove the cap; omit to leave unchanged.
28+
Requests that set this field are rejected with a 400 once the unified
29+
concurrency limit is enabled for your organization.
2830
"""

src/kernel/types/projects/project_limits.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@ class ProjectLimits(BaseModel):
1515
"""
1616

1717
max_concurrent_sessions: Optional[int] = None
18-
"""Maximum concurrent browser sessions for this project.
19-
20-
Null means no project-level cap.
18+
"""
19+
Maximum concurrent browsers for this project, covering both on-demand sessions
20+
(`browsers.create()`) and browser pool reservations. Null means no project-level
21+
cap.
2122
"""
2223

2324
max_pooled_sessions: Optional[int] = None
24-
"""Maximum pooled sessions capacity for this project.
25+
"""Deprecated: pooled browsers now count toward `max_concurrent_sessions`.
2526
26-
Null means no project-level cap.
27+
Always null once the unified concurrency limit is enabled for your organization.
2728
"""

0 commit comments

Comments
 (0)