Skip to content

Commit 56c9983

Browse files
feat: Pass through tool_page_unloaded and disable SDK retries for WebMCP invoke failures
Stainless-Generated-From: a670dcf1aed08939b4b2790f0506c5d9c9c0fb7f
1 parent 29433e1 commit 56c9983

2 files changed

Lines changed: 17 additions & 9 deletions

File tree

‎src/kernel/resources/browsers/webmcp/webmcp.py‎

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,16 @@ def invoke_tool(
8282
across navigation. Inspect a populated form, obtain any required confirmation,
8383
then submit through Playwright or computer interaction without invoking the tool
8484
again. If the tab or embedded frame disappears, or the request times out after
85-
invocation begins, the response reports outcome_unknown and the tool is not
86-
retried. CDP-backed custom tool outputs above 240 KiB return an error rather
87-
than a truncated result.
85+
invocation begins, the response reports outcome_unknown. If the tool's page is
86+
reloaded or replaced by a navigation the tool did not start, and the tool never
87+
responds, the response reports tool_page_unloaded once the replacement page
88+
loads, or right away if the tool's tab crashes. Neither failure is retried, and
89+
both set X-Should-Retry to false because the tool may have had side effects.
90+
CDP-backed custom tool outputs above 240 KiB return an error rather than a
91+
truncated result.
8892
8993
Args:
90-
input: Tool input, limited to 1 MiB after JSON serialization.
94+
input: Tool input, limited to 4 MiB after JSON serialization.
9195
9296
extra_headers: Send extra headers
9397
@@ -219,12 +223,16 @@ async def invoke_tool(
219223
across navigation. Inspect a populated form, obtain any required confirmation,
220224
then submit through Playwright or computer interaction without invoking the tool
221225
again. If the tab or embedded frame disappears, or the request times out after
222-
invocation begins, the response reports outcome_unknown and the tool is not
223-
retried. CDP-backed custom tool outputs above 240 KiB return an error rather
224-
than a truncated result.
226+
invocation begins, the response reports outcome_unknown. If the tool's page is
227+
reloaded or replaced by a navigation the tool did not start, and the tool never
228+
responds, the response reports tool_page_unloaded once the replacement page
229+
loads, or right away if the tool's tab crashes. Neither failure is retried, and
230+
both set X-Should-Retry to false because the tool may have had side effects.
231+
CDP-backed custom tool outputs above 240 KiB return an error rather than a
232+
truncated result.
225233
226234
Args:
227-
input: Tool input, limited to 1 MiB after JSON serialization.
235+
input: Tool input, limited to 4 MiB after JSON serialization.
228236
229237
extra_headers: Send extra headers
230238

‎src/kernel/types/browsers/webmcp_invoke_tool_params.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
class WebmcpInvokeToolParams(TypedDict, total=False):
1212
input: Required[Dict[str, object]]
13-
"""Tool input, limited to 1 MiB after JSON serialization."""
13+
"""Tool input, limited to 4 MiB after JSON serialization."""
1414

1515
tool_ref: Required[str]
1616

0 commit comments

Comments
 (0)