Skip to content

fix: long mobile media recordings time out - #99455

Merged
steipete merged 2 commits into
openclaw:mainfrom
NianJiuZst:codex/mobile-media-invoke-timeouts
Jul 3, 2026
Merged

steipete merged 2 commits into
openclaw:mainfrom
NianJiuZst:codex/mobile-media-invoke-timeouts

Conversation

@NianJiuZst

@NianJiuZst NianJiuZst commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Long camera_clip and screen_record actions could outlive the default 30-second agent-to-Gateway transport timeout. The forwarded node invocation has its own timer, so one shared timeout value also left the enclosing transport with no time to receive and process the node result.

Why This Change Was Made

Recording actions now use two lifecycle-owned budgets:

  • node invoke: requested duration plus 30 seconds;
  • enclosing Gateway transport: node invoke budget plus another 30 seconds.

The existing 300-second tool duration cap remains unchanged. Explicit timeoutMs and invokeTimeoutMs overrides remain independent so callers retain cancellation control at either layer.

The same helper owns both camera_clip and screen_record, avoiding parallel timeout policy.

AI-assisted: yes. Maintainer deep review rewrote the original shared-timeout approach, added focused table-driven coverage, ran fresh autoreview, and exercised the final path against a real source Gateway and Android emulator node.

User Impact

Long mobile camera clips and screen recordings can finish without the outer Gateway request expiring first. Existing short recordings, duration limits, dangerous-command opt-in, and explicit timeout behavior remain intact.

Evidence

Exact head: b6b05aad0b257353c18ad3b54fc1c3a0d1ff460c

  • node scripts/run-vitest.mjs src/agents/tools/nodes-tool.test.ts
    • 42 tests passed.
    • Both recording actions prove the 300-second clamp, 330-second node deadline, and 360-second transport deadline.
    • Explicit 5-second transport and 10-second node deadlines remain independent.
  • Fresh autoreview
    • Clean at 0.94 confidence after restoring the shipped 300-second duration cap.
  • Current-source Android live proof
    • Built :app:assemblePlayDebug, installed on emulator-5554, connected and re-approved through an exact-source Gateway.
    • Invoked camera_clip through the patched agent nodes tool with durationMs=31000 and audio disabled.
    • Completed in 33.979 seconds, crossing the former 30-second boundary.
    • Returned a 2,903,226-byte MP4; ffprobe duration: 30.781767 seconds.
  • Duplicate search
    • No competing open issue or pull request found for this timeout ownership bug.

Screen recording requires an interactive Android MediaProjection consent prompt, so live proof uses camera_clip; focused tests cover the identical shared timeout path for both actions.

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: XS labels Jul 3, 2026
@NianJiuZst
NianJiuZst marked this pull request as ready for review July 3, 2026 08:58
@clawsweeper

clawsweeper Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 3, 2026, 7:34 AM ET / 11:34 UTC.

Summary
The PR adds a shared recording timeout helper for camera_clip and screen_record that gives the node invoke and Gateway transport separate bounded budgets, with focused nodes tool tests.

PR surface: Source +24, Tests +4. Total +28 across 2 files.

Reproducibility: yes. from source inspection. Current main allows recording durations up to 300,000ms while the agent transport and Gateway node invoke timers default to 30,000ms; I did not run a failing live current-main repro.

Review metrics: 1 noteworthy metric.

  • Recording timeout policy: 2 actions changed. camera_clip and screen_record now get longer bounded default wait budgets, which maintainers should notice before merge.

Merge readiness
Overall: 🦞 diamond lobster
Proof: 🦞 diamond lobster
Patch quality: 🦞 diamond lobster
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Risk before merge

  • Current-head broad CI still had several jobs in progress at inspection; no patch defect is indicated, but merge should wait for required checks.

Maintainer options:

  1. Decide the mitigation before merge
    Merge the shared recording timeout helper once required current-head checks finish, preserving explicit transport and invoke timeout overrides.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • No automated repair is needed; the remaining action is maintainer merge review after current-head checks finish.

Security
Cleared: The diff only changes bounded timeout forwarding in an existing node media path plus tests; it does not touch secrets, dependencies, workflows, permissions, or package resolution.

Review details

Best possible solution:

Merge the shared recording timeout helper once required current-head checks finish, preserving explicit transport and invoke timeout overrides.

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

Yes from source inspection. Current main allows recording durations up to 300,000ms while the agent transport and Gateway node invoke timers default to 30,000ms; I did not run a failing live current-main repro.

Is this the best way to solve the issue?

Yes. The dedicated node media tool is the narrow owner for these recording wait budgets, and using the existing node.invoke.timeoutMs contract is safer than changing generic Gateway defaults or adding a new API.

AGENTS.md: found and applied where relevant.

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

Label changes

Label justifications:

  • P2: This is a normal-priority user-visible bug fix for long paired-node media recordings with a limited agent tool blast radius.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): Sufficient: the PR body and maintainer comment include exact-source Android emulator/Gateway live output for camera_clip completing past 30 seconds with MP4 duration verification, and the proofed commit has the same tree as the current head.
  • proof: sufficient: Contributor real behavior proof is sufficient. Sufficient: the PR body and maintainer comment include exact-source Android emulator/Gateway live output for camera_clip completing past 30 seconds with MP4 duration verification, and the proofed commit has the same tree as the current head.
Evidence reviewed

PR surface:

Source +24, Tests +4. Total +28 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 26 2 +24
Tests 1 36 32 +4
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 62 34 +28

What I checked:

Likely related people:

  • steipete: History shows prior media duration validation and node invoke timer work, and this PR's final tree-equivalent commit rewrote the timeout-budget shape. (role: feature-history owner and recent PR branch maintainer; confidence: high; commits: 49f36ab58dca, 068e02684b63, 26ef325219e5; files: src/agents/tools/nodes-tool-media.ts, src/agents/tools/nodes-tool.test.ts, src/agents/tools/gateway.ts)
  • vincentkoc: Recent history includes media helper trimming, node registry cleanup, and node event payload fixes in the same node/media/gateway area. (role: recent adjacent contributor; confidence: medium; commits: 3881cb34260a, 9594300f8c92, 58de2b689fdf; files: src/agents/tools/nodes-tool-media.ts, src/agents/tools/nodes-tool.test.ts, src/gateway/node-registry.ts)
  • zengLingbiao: Recent merged work updated screen snapshot media behavior and adjacent nodes tool coverage in the same tool family. (role: recent media-path contributor; confidence: medium; commits: 4c9e7f6c6171; files: src/agents/tools/nodes-tool-media.ts, src/agents/tools/nodes-tool.test.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.

@NianJiuZst
NianJiuZst force-pushed the codex/mobile-media-invoke-timeouts branch from 28850e6 to 5390352 Compare July 3, 2026 09:09
@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. labels Jul 3, 2026
@steipete steipete self-assigned this Jul 3, 2026
@steipete
steipete force-pushed the codex/mobile-media-invoke-timeouts branch from 5390352 to b6b05aa Compare July 3, 2026 11:18
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed 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. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Jul 3, 2026
@NianJiuZst
NianJiuZst force-pushed the codex/mobile-media-invoke-timeouts branch from b6b05aa to 4a08902 Compare July 3, 2026 11:29
@steipete

steipete commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Land-ready verification for exact head b6b05aad0b257353c18ad3b54fc1c3a0d1ff460c:

  • Deep review moved the nested timeout policy into one shared helper. Public tool duration remains capped at 300 seconds; the node invocation defaults to requested duration plus 30 seconds; the Gateway transport defaults to the node deadline plus another 30 seconds. Explicit caller overrides remain authoritative.
  • Focused proof: node scripts/run-vitest.mjs src/agents/tools/camera-tool.test.ts src/agents/tools/screen-tool.test.ts — 2 files, 42 tests passed.
  • Fresh autoreview found and repaired an accidental 60-second cap contraction; final rerun reported no accepted/actionable findings (0.94 confidence).
  • Exact-source live proof: built and installed the Play debug APK on emulator-5554, paired it with an isolated real Gateway, allowed camera.clip, then invoked a 31-second front-camera clip through the patched agent nodes tool. The invocation completed in 33.979 seconds, Gateway logged node.invoke success after 33.394 seconds, and ffprobe verified a 30.781767-second MP4 (2,903,226 bytes).
  • Hosted exact-head CI run 28657124052: passed.
  • Duplicate search: no competing issue or PR found for long-running camera/screen node invocation timeouts.

Known proof gap: emulator camera output was validated as a real playable MP4 and through Gateway timing/logs; no useful visual screenshot distinguishes this timeout-only behavior change.

@steipete

steipete commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Exact-head closeout for 4a089021c79b5ff5c88e9e49782dd73d0135d7a5:

  • This head is a parent-only rebase of the already live-tested tree (17f555b275a561380406feb304e06afebe36e9bb); the implementation and focused-test trees are byte-identical.
  • Focused proof: node scripts/run-vitest.mjs src/agents/tools/nodes-tool.test.ts — 42 tests passed.
  • Fresh autoreview: no accepted/actionable findings after restoring the shipped 300-second media duration cap (0.94 confidence).
  • Live current-source Android proof: Play debug APK on emulator-5554, isolated real Gateway, approved Android node, and agent nodes invocation of camera_clip with durationMs=31000. Gateway completed node.invoke after 33.394 seconds; the tool returned in 33.979 seconds; ffprobe verified a 30.781767-second MP4 (2,903,226 bytes).
  • Hosted exact-head CI run 28657665815: passed.
  • Duplicate search: no competing issue or PR found.

The timeout-only change has no meaningful screenshot delta; the real media artifact, Gateway timing, and exact-source invocation are the useful proof.

@steipete
steipete merged commit d354e9e into openclaw:main Jul 3, 2026
96 checks passed
@steipete

steipete commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 4, 2026
* fix node media recording invoke timeouts

* refactor(agents): separate recording timeout budgets

---------

Co-authored-by: NianJiuZst <180004567+NianJiuZst@users.noreply.github.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants