Skip to content
This repository was archived by the owner on Sep 1, 2026. It is now read-only.

Commit a2af713

Browse files
authored
feat: add use_touch and release 3.23.0 (#364)
* feat: add use_touch session option * release: 3.23.0
1 parent 9fe6865 commit a2af713

10 files changed

Lines changed: 37 additions & 8 deletions

File tree

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "3.22.0"
2+
".": "3.23.0"
33
}

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## 3.23.0 (2026-08-19)
4+
5+
Full Changelog: [v3.22.0...v3.23.0](https://github.com/browserbase/stagehand-python/compare/v3.22.0...v3.23.0)
6+
7+
### Features
8+
9+
* expose `use_touch` for session start ([#364](https://github.com/browserbase/stagehand-python/pull/364))
10+
311
## 3.22.0 (2026-07-21)
412

513
Full Changelog: [v3.21.0...v3.22.0](https://github.com/browserbase/stagehand-python/compare/v3.21.0...v3.22.0)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "stagehand"
3-
version = "3.22.0"
3+
version = "3.23.0"
44
description = "The official Python library for the stagehand API"
55
dynamic = ["readme"]
66
license = "MIT"

src/stagehand/_custom/session.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -725,6 +725,7 @@ def _sync_start(
725725
*,
726726
model_name: str,
727727
act_timeout_ms: float | Omit = omit,
728+
use_touch: bool | Omit = omit,
728729
browser: session_start_params.Browser | Omit = omit,
729730
browserbase_session_create_params: session_start_params.BrowserbaseSessionCreateParams | Omit = omit,
730731
browserbase_session_id: str | Omit = omit,
@@ -744,6 +745,7 @@ def _sync_start(
744745
self,
745746
model_name=model_name,
746747
act_timeout_ms=act_timeout_ms,
748+
use_touch=use_touch,
747749
browser=_resolve_start_browser(self._client, browser),
748750
browserbase_session_create_params=browserbase_session_create_params,
749751
browserbase_session_id=browserbase_session_id,
@@ -769,6 +771,7 @@ async def _async_start(
769771
*,
770772
model_name: str,
771773
act_timeout_ms: float | Omit = omit,
774+
use_touch: bool | Omit = omit,
772775
browser: session_start_params.Browser | Omit = omit,
773776
browserbase_session_create_params: session_start_params.BrowserbaseSessionCreateParams | Omit = omit,
774777
browserbase_session_id: str | Omit = omit,
@@ -788,6 +791,7 @@ async def _async_start(
788791
self,
789792
model_name=model_name,
790793
act_timeout_ms=act_timeout_ms,
794+
use_touch=use_touch,
791795
browser=_resolve_start_browser(self._client, browser),
792796
browserbase_session_create_params=browserbase_session_create_params,
793797
browserbase_session_id=browserbase_session_id,

src/stagehand/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
__title__ = "stagehand"
4-
__version__ = "3.22.0" # x-release-please-version
4+
__version__ = "3.23.0" # x-release-please-version

src/stagehand/resources/sessions.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -922,6 +922,7 @@ def start(
922922
*,
923923
model_name: str,
924924
act_timeout_ms: float | Omit = omit,
925+
use_touch: bool | Omit = omit,
925926
browser: session_start_params.Browser | Omit = omit,
926927
browserbase_session_create_params: session_start_params.BrowserbaseSessionCreateParams | Omit = omit,
927928
browserbase_session_id: str | Omit = omit,
@@ -953,6 +954,8 @@ def start(
953954
954955
act_timeout_ms: Timeout in ms for act operations (deprecated, v2 only)
955956
957+
use_touch: Actuate coordinate pointer actions as trusted touch taps instead of mouse input for mobile layouts
958+
956959
browserbase_session_id: Existing Browserbase session ID to resume
957960
958961
dom_settle_timeout_ms: Timeout in ms to wait for DOM to settle
@@ -992,6 +995,7 @@ def start(
992995
{
993996
"model_name": model_name,
994997
"act_timeout_ms": act_timeout_ms,
998+
"use_touch": use_touch,
995999
"browser": browser,
9961000
"browserbase_session_create_params": browserbase_session_create_params,
9971001
"browserbase_session_id": browserbase_session_id,
@@ -1885,6 +1889,7 @@ async def start(
18851889
*,
18861890
model_name: str,
18871891
act_timeout_ms: float | Omit = omit,
1892+
use_touch: bool | Omit = omit,
18881893
browser: session_start_params.Browser | Omit = omit,
18891894
browserbase_session_create_params: session_start_params.BrowserbaseSessionCreateParams | Omit = omit,
18901895
browserbase_session_id: str | Omit = omit,
@@ -1916,6 +1921,8 @@ async def start(
19161921
19171922
act_timeout_ms: Timeout in ms for act operations (deprecated, v2 only)
19181923
1924+
use_touch: Actuate coordinate pointer actions as trusted touch taps instead of mouse input for mobile layouts
1925+
19191926
browserbase_session_id: Existing Browserbase session ID to resume
19201927
19211928
dom_settle_timeout_ms: Timeout in ms to wait for DOM to settle
@@ -1955,6 +1962,7 @@ async def start(
19551962
{
19561963
"model_name": model_name,
19571964
"act_timeout_ms": act_timeout_ms,
1965+
"use_touch": use_touch,
19581966
"browser": browser,
19591967
"browserbase_session_create_params": browserbase_session_create_params,
19601968
"browserbase_session_id": browserbase_session_id,

src/stagehand/types/session_start_params.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ class SessionStartParams(TypedDict, total=False):
3434
act_timeout_ms: Annotated[float, PropertyInfo(alias="actTimeoutMs")]
3535
"""Timeout in ms for act operations (deprecated, v2 only)"""
3636

37+
use_touch: Annotated[bool, PropertyInfo(alias="useTouch")]
38+
"""Actuate coordinate pointer actions as trusted touch taps instead of mouse input for mobile layouts."""
39+
3740
browser: Browser
3841

3942
browserbase_session_create_params: Annotated[

tests/api_resources/test_sessions.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,6 +1115,7 @@ def test_method_start_with_all_params(self, client: Stagehand) -> None:
11151115
session = client.sessions.start(
11161116
model_name="openai/gpt-5.4-mini",
11171117
act_timeout_ms=0,
1118+
use_touch=True,
11181119
browser={
11191120
"cdp_url": "ws://localhost:9222",
11201121
"launch_options": {
@@ -2323,6 +2324,7 @@ async def test_method_start_with_all_params(self, async_client: AsyncStagehand)
23232324
session = await async_client.sessions.start(
23242325
model_name="openai/gpt-5.4-mini",
23252326
act_timeout_ms=0,
2327+
use_touch=True,
23262328
browser={
23272329
"cdp_url": "ws://localhost:9222",
23282330
"launch_options": {

tests/test_sessions_create_helper.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
def test_sessions_create_returns_bound_session(respx_mock: MockRouter, client: Stagehand) -> None:
2121
session_id = "00000000-0000-0000-0000-000000000000"
2222

23-
respx_mock.post("/v1/sessions/start").mock(
23+
start_route = respx_mock.post("/v1/sessions/start").mock(
2424
return_value=httpx.Response(
2525
200,
2626
json={
@@ -37,8 +37,10 @@ def test_sessions_create_returns_bound_session(respx_mock: MockRouter, client: S
3737
)
3838
)
3939

40-
session = client.sessions.start(model_name="openai/gpt-5-nano")
40+
session = client.sessions.start(model_name="openai/gpt-5-nano", use_touch=True)
4141
assert session.id == session_id
42+
start_call = cast(Call, start_route.calls[0])
43+
assert json.loads(start_call.request.content)["useTouch"] is True
4244

4345
session.navigate(url="https://example.com")
4446
assert navigate_route.called is True
@@ -53,7 +55,7 @@ async def test_async_sessions_create_returns_bound_session(
5355
) -> None:
5456
session_id = "00000000-0000-0000-0000-000000000000"
5557

56-
respx_mock.post("/v1/sessions/start").mock(
58+
start_route = respx_mock.post("/v1/sessions/start").mock(
5759
return_value=httpx.Response(
5860
200,
5961
json={
@@ -70,8 +72,10 @@ async def test_async_sessions_create_returns_bound_session(
7072
)
7173
)
7274

73-
session = await async_client.sessions.start(model_name="openai/gpt-5-nano")
75+
session = await async_client.sessions.start(model_name="openai/gpt-5-nano", use_touch=True)
7476
assert session.id == session_id
77+
start_call = cast(Call, start_route.calls[0])
78+
assert json.loads(start_call.request.content)["useTouch"] is True
7579

7680
await session.navigate(url="https://example.com")
7781
assert navigate_route.called is True

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)