Skip to content

fix(browser): prevent remote browser timeout stalls and cancellation conflicts - #114131

Merged
steipete merged 1 commit into
mainfrom
codex/autoqa-browser-nested-timeouts-01f8bd9d
Jul 26, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/autoqa-browser-nested-timeouts-01f8bd9d

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where users running Browser tools on remote Browser nodes could see misleading outer-watchdog timeouts, stalled cancellation, or interference between concurrent Browser sessions when nested timers reach Node timer limits or one running session is cancelled.

Why This Change Was Made

Keep the existing Browser action, node-invocation, and Gateway RPC watchdogs distinct and bounded, and bind tool cancellation once in the canonical node-proxy factory. Explicit request signals and the existing safe pre-dispatch host-fallback ownership remain intact. This does not change public Browser CLI, HTTP, provider, authentication, or protocol contracts.

User Impact

Remote Browser actions report the correct inner timeout, cancellation reaches the intended in-flight action, and cancelling one of ten concurrent Browser tool executions does not cancel the other nine.

Evidence

  • Current-main fail-first owner proof: 31 failed, 127 passed before either production owner was changed; all 158 Browser proxy, tool, and node-host cases pass after the fix.
  • All 137 current-main restart-recovery cases independently pass.
  • The mocked Gateway regression proves ten actual Browser tool executions, with one aborted and nine independent completed survivors; it is not claimed as a live-provider run.
  • Separately, an isolated current-main live GPT-5.4 Gateway scenario completed ten simultaneously active medium-sized model sessions, with ten distinct runs, ten persisted final outputs, ten durable artifacts, no pending runs, and no failures.
  • Complete four-path isolated Testbox changed gate: exitCode 0; production and test typechecks, clean 245-rule lint, formatting, plugin, SDK, database, and import-cycle guards.
  • Fresh official committed-head gpt-5.6-sol high review: patch is correct, zero findings, confidence 0.93.

@openclaw-barnacle openclaw-barnacle Bot added size: L maintainer Maintainer-authored PR labels Jul 26, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. labels Jul 26, 2026
@clawsweeper

clawsweeper Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 26, 2026, 11:58 AM ET / 15:58 UTC.

ClawSweeper review

What this changes

This PR gives Browser actions, node invocation, and Gateway RPC separate bounded timeout budgets, and carries each Browser tool invocation’s abort signal into its remote node-proxy request.

Merge readiness

⛔ Blocked until real behavior proof from a real setup is added - 5 items remain

Keep this PR open for explicit Browser-owner review. The patch targets a real remote-node timeout and cancellation boundary, but the supplied proof is primarily mocked and test-gate evidence; it does not show an after-fix run through a real remote Browser node. The maintainer label also requires human handling rather than automated cleanup.

Priority: P2
Reviewed head: 684663d6e21ac4d621fbad6d59c87f7b6431b56c
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The patch has substantial focused regression coverage, but real remote Browser-node behavior proof is still missing for this timeout and cancellation boundary.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: The PR body reports focused tests and a mocked Gateway concurrency regression, but no after-fix run through a real remote Browser node; please add redacted terminal output, logs, or a recording and update the PR body so a fresh review can run.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The PR body reports focused tests and a mocked Gateway concurrency regression, but no after-fix run through a real remote Browser node; please add redacted terminal output, logs, or a recording and update the PR body so a fresh review can run.
Evidence reviewed 4 items Changed runtime boundary: The PR changes the remote Browser proxy’s timeout calculation and the Browser tool’s proxy construction, rather than a public CLI, provider, auth, or protocol surface.
Cancellation isolation coverage: The added proxy test is intended to cover independently bounded delegated requests, and the expanded Browser-tool tests cover concurrent request cancellation and idempotency-key observation.
Provided validation evidence: The PR body reports focused Browser proxy/tool/node-host tests plus a changed gate, but explicitly describes the Gateway concurrency regression as mocked; its separate live Gateway model-session scenario does not demonstrate a remote Browser-node action.
Findings None None.
Security None None.

How this fits together

The Browser plugin routes a Browser tool action either to local host control or through a selected remote Browser node via Gateway RPC. This change adjusts the timeout and cancellation handoff around that remote-node path so the tool receives the relevant inner failure and cancellation reaches only its own request.

flowchart LR
  A[Browser tool action] --> B[Browser tool runtime]
  B --> C{Remote Browser node selected?}
  C -- Yes --> D[Browser node proxy]
  D --> E[Node invocation watchdog]
  E --> F[Gateway RPC watchdog]
  F --> G[Remote Browser action result]
  B --> H[Tool cancellation signal]
  H --> D
Loading

Decision needed

Question Recommendation
Do the Browser owners accept this timeout-budget and abort-signal change after reviewing a real remote Browser-node run that cancels one request while concurrent Browser actions complete? Require remote-node proof before merge: Ask for a redacted terminal/log or recorded run through a real remote Browser node that shows the inner timeout and isolates one cancellation from concurrent requests.

Why: The patch changes nested watchdog ownership and cancellation propagation in a user-facing remote execution path; tests are substantial, but the available proof does not directly exercise the deployed remote Browser-node boundary.

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The PR body reports focused tests and a mocked Gateway concurrency regression, but no after-fix run through a real remote Browser node; please add redacted terminal output, logs, or a recording and update the PR body so a fresh review can run.
  • Resolve merge risk (P2) - The timeout-budget change is availability-sensitive: an incorrect nesting or clamp can still cause premature remote Browser failures or stalls under long-running actions.
  • Resolve merge risk (P1) - The supplied proof does not demonstrate the after-fix behavior against a real remote Browser node; the live Gateway session exercise is not equivalent to the Browser proxy path.
  • Complete next step (P2) - Browser-owner judgment and real remote-node proof are required before merge; the maintainer label prevents automated cleanup.
Agent review details

Security

None.

PR surface

Source +19, Tests +446. Total +465 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 2 31 12 +19
Tests 2 465 19 +446
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 496 31 +465

Review metrics

None.

Merge-risk options

Maintainer options:

  1. Add real remote-node behavior proof (recommended)
    Before merge, show the changed path on a real remote Browser node so the nested watchdog and cancellation ownership are verified outside mocks.
  2. Accept the mock boundary
    Browser owners may accept the existing focused tests if they explicitly consider the Gateway mock a sufficient representation of the remote-node transport contract.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Add redacted after-fix evidence from a real remote Browser node: run concurrent Browser actions, cancel one, and show the cancelled request plus the surviving completed requests.

Technical review

Best possible solution:

Preserve the bounded, per-request timeout and cancellation design if Browser owners confirm it against a real remote Browser-node action, with redacted evidence showing one cancelled request and unaffected concurrent requests.

Do we have a high-confidence way to reproduce the issue?

No high-confidence live reproduction is available in the supplied evidence. The code and added regressions make the remote-proxy timeout and cancellation path source-reproducible, but they do not show the failure on a real remote Browser node.

Is this the best way to solve the issue?

Unclear: separating watchdog budgets and passing the invocation signal through the canonical proxy factory is a plausible narrow fix, but direct remote-node proof is needed to establish that it is the best production solution.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 01f8bd9d12d2.

Labels

Label changes:

  • add P2: The PR addresses a bounded but user-visible remote Browser reliability problem rather than a confirmed broad outage or release blocker.
  • add merge-risk: 🚨 availability: It modifies nested timeout and cancellation behavior that can cause remote Browser requests to stall or fail prematurely if the budgets are incorrect.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body reports focused tests and a mocked Gateway concurrency regression, but no after-fix run through a real remote Browser node; please add redacted terminal output, logs, or a recording and update the PR body so a fresh review can run.

Label justifications:

  • P2: The PR addresses a bounded but user-visible remote Browser reliability problem rather than a confirmed broad outage or release blocker.
  • merge-risk: 🚨 availability: It modifies nested timeout and cancellation behavior that can cause remote Browser requests to stall or fail prematurely if the budgets are incorrect.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body reports focused tests and a mocked Gateway concurrency regression, but no after-fix run through a real remote Browser node; please add redacted terminal output, logs, or a recording and update the PR body so a fresh review can run.

Evidence

What I checked:

  • Changed runtime boundary: The PR changes the remote Browser proxy’s timeout calculation and the Browser tool’s proxy construction, rather than a public CLI, provider, auth, or protocol surface. (extensions/browser/src/browser-node-proxy.ts:70, 684663d6e21a)
  • Cancellation isolation coverage: The added proxy test is intended to cover independently bounded delegated requests, and the expanded Browser-tool tests cover concurrent request cancellation and idempotency-key observation. (extensions/browser/src/browser-node-proxy.test.ts:1, 684663d6e21a)
  • Provided validation evidence: The PR body reports focused Browser proxy/tool/node-host tests plus a changed gate, but explicitly describes the Gateway concurrency regression as mocked; its separate live Gateway model-session scenario does not demonstrate a remote Browser-node action. (684663d6e21a)
  • Maintainer-handling gate: The GitHub context shows the PR is labeled maintainer; repository policy requires it to remain open for explicit maintainer judgment rather than automatic cleanup. (AGENTS.md:1, 01f8bd9d12d2)

Likely related people:

  • steipete: The provided PR context attributes the only proposed commit affecting the Browser proxy and Browser tool paths to steipete; current-main feature-history ownership could not be independently established in this read-only review environment. (role: current branch author and recent Browser-path contributor; confidence: low; commits: 684663d6e21a; files: extensions/browser/src/browser-node-proxy.ts, extensions/browser/src/browser-tool.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Add redacted evidence from a real remote Browser-node action showing one cancellation while concurrent requests remain independent.
  • Have a Browser-path owner confirm that the three timeout budgets match the deployed node-invocation and Gateway contracts.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete

Copy link
Copy Markdown
Contributor Author

Maintainer and Browser-owner decision for reviewed head 684663d: accept the exact Browser-owner transport proof and proceed with the native maintainer workflow.

I independently inspected the complete production chain: extensions/browser/src/browser-tool.ts:441-523, extensions/browser/src/browser-node-proxy.ts:65-187, src/agents/tools/gateway.ts:503-545, src/gateway/server-methods/nodes.invoke.ts:158-211 and :475-520, extensions/browser/src/node-host/invoke-browser.ts:142-175 and :228-318, src/plugin-sdk/number-runtime.ts, and packages/normalization-core/src/number-coercion.ts:104-204.

Those actual owner implementations confirm that the tool execution signal reaches the Gateway transport through callGatewayTool, the node registry receives the separately bounded node-invocation timeout and unique idempotency key, and the real Browser-node handler owns the inner action watchdog and detailed timeout envelope. Reserving both 5,000 ms grace windows before the canonical Node maximum preserves the required action < node < RPC ordering. The pre-dispatch-only host fallback and explicit request-signal priority remain intact.

Real remote Browser-node proof was not run and is not claimed. I explicitly accept the contract-faithful owner regression because it executes the real Browser tool and canonical proxy, asserts the complete real Gateway request envelope and all three budgets, verifies one cancelled request with nine independent successful concurrent survivors, and includes the actual node-host watchdog suite. The honest fail-before/after is 31 failed / 127 passed to 158 passed; all 137 current restart-recovery cases pass. The separate live GPT-5.4 ten-session Gateway scenario is genuine but is not remote Browser-node proof.

Both exact-head hosted openclaw/ci-gate and Real behavior proof succeed, the isolated complete changed gate succeeds, and the fresh committed-head official review has zero findings. This comment is the explicit human maintainer decision requested by the ClawSweeper review; the optional real Browser-node artifact is deferred rather than misrepresented.

@steipete
steipete merged commit bba7e30 into main Jul 26, 2026
129 of 137 checks passed
@steipete
steipete deleted the codex/autoqa-browser-nested-timeouts-01f8bd9d branch July 26, 2026 16:04
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: L status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant