Repository navigation
fix(browser): budget sequential action watchdogs - #104659
Conversation
|
Land-ready verification for final head Automated proof
Live Gateway / agent / browser proofI started a real isolated Gateway with a managed Chromium profile, paired a real browser node, supplied the OpenAI credential through the approved secret path without printing it, and talked to the agent on
The first black-box pass exposed two adjacent gaps that are fixed in this PR: batch fields were absent from the model-facing flat schema, and the computed proxy deadline was not propagated to the separate I also inspected Playwright 1.61.1 source for locator/action/wait timeout behavior and mouse delay sequencing. No proof gaps remain for the touched host, CLI, browser-proxy, or paired-node watchdog paths. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 47c125b938
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| command: "browser.proxy", | ||
| // node.invoke owns a separate watchdog from browser.proxy. Keep both | ||
| // bounded, with enough outer slack for the proxy result to cross back. | ||
| timeoutMs: gatewayTimeoutMs, |
There was a problem hiding this comment.
Keep the outer Gateway timeout above node.invoke
This sets the node.invoke watchdog to the same value that callGatewayTool uses as the outer Gateway request timeout (see src/agents/tools/gateway.ts:506 and src/gateway/node-registry.ts:620-657). When browser.proxy legitimately consumes its budget and the node response arrives near the invoke deadline, the agent-side Gateway call can time out at the same moment instead of delivering the result/error; the intended second slack window needs to make the outer call longer than node.invoke, not equal to it.
Useful? React with 👍 / 👎.
|
Merged via squash.
|
* fix(browser): budget sequential action watchdogs * chore: leave browser release note to release flow
What Problem This Solves
Composite browser waits and nested batches execute their phases serially, but direct, CLI, browser-proxy, and node-invoke watchdogs were sized from one phase, a maximum, or a fixed 20/30/60 second deadline. Valid work could be aborted midway and a retry could repeat already-completed page side effects. The agent tool also omitted
batch/actionsfrom its model-facing schema, and malformed permissive batch input could crash timeout calculation before the browser route returned its normal validation error.Closes #104457.
Why This Change Was Made
One recursive, saturating action-budget policy now mirrors the actual sequential runtime phases, including per-action Playwright timeouts, bounded delays, navigation grace, composite wait conditions, nested batches, and the wider scroll/evaluate timeout contract. Direct requests, CLI waits, browser proxy calls, and paired-node calls reuse that owner; the computed deadline is propagated through both
browser.proxyand the separatenode.invokewatchdog. Explicit caller timeout overrides remain authoritative, the existing whole-request floor remains, and transport watchdogs stay enabled.The flat provider-compatible agent schema now advertises
batch,actions, andstopOnErrorwithout introducing recursive JSON Schema. Runtime budgeting tolerates malformed permissive children long enough for the browser route to return its canonical validation error.User Impact
Long composite waits and nested batches can finish once across host, CLI, and paired-node browser automation instead of failing at an unrelated outer deadline. Genuine Playwright locator errors still surface, and invalid batch input now returns an actionable validation error rather than a JavaScript
.reduce()crash. This does not parallelize actions, remove timeout protection, widen browser/navigation permissions, or change the per-agent trust boundary.Evidence
tbx_01kx9742wgnqkm9m5v1yqjaaqd: 140/140 focused browser tests.openai/gpt-5.4+ managed browser:COMPOSITE_SUCCESS Budget Proof(cc3b1457-7973-45b7-95f3-7d8f24e5e907; 3 Browser calls, 0 failures, no fallback);DIRECT_BATCH A,B,C,D(e483fc58-9107-49f6-b7c7-cf7e77565b39; 2 Browser calls, 0 failures);NODE_BATCH A,B,C,D(e8f206d5-6181-4aa9-8596-598b8058873a; 2 Browser calls, 0 failures);{kind:"batch",requests:[]}returnedactions are required, not a runtime crash.AI-assisted implementation and review. No agent transcript attached.