Skip to content

fix(cli): pass timeout through to OpenClaw#82

Merged
yan5xu merged 2 commits intoepiral:mainfrom
ox01024:fix/openclaw-timeout
Mar 22, 2026
Merged

fix(cli): pass timeout through to OpenClaw#82
yan5xu merged 2 commits intoepiral:mainfrom
ox01024:fix/openclaw-timeout

Conversation

@ox01024
Copy link
Copy Markdown
Contributor

@ox01024 ox01024 commented Mar 19, 2026

Closes #78

Summary

  • pass --timeout <ms> through to openclaw browser
  • keep the Node child-process timeout slightly above the CLI timeout
  • extend evaluate to a longer timeout window than the default OpenClaw 30s

Verification

  • pnpm build
  • npx openclaw browser --help confirms the CLI supports --timeout <ms>
  • local success-path verification is blocked here because the current OpenClaw gateway exits early with gateway closed

@yan5xu
Copy link
Copy Markdown
Collaborator

yan5xu commented Mar 19, 2026

Fix direction is correct — timeout was never passed to OpenClaw CLI before. Two things to confirm:

  1. --timeout parameter position: the flag is placed before subcommand args (openclaw browser --timeout 120000 evaluate --fn ...). Can you confirm OpenClaw CLI parses this correctly? Some CLI frameworks require global flags after the subcommand.

  2. Not locally verified: PR description mentions local verification was blocked by "gateway closed". Would be good to get a success-path test before merging.

Code-wise LGTM — the +5s buffer design is smart. Approve once the above are confirmed.

@ox01024
Copy link
Copy Markdown
Contributor Author

ox01024 commented Mar 19, 2026

@yan5xu Addressed in bb0d3b1:

  1. The --timeout position did need a change. I reproduced locally that openclaw browser --timeout 5000 status --json can fail, while openclaw browser status --timeout 5000 --json works reliably. The bridge now inserts --timeout after the browser subcommand (status, tabs, open, evaluate, etc.) instead of before it.
  2. Added a regression test for the argument ordering in openclaw-bridge.test.ts, and updated the CLI test script to run it.
  3. Local verification:
    • pnpm --filter @bb-browser/cli test
    • pnpm --filter @bb-browser/cli build
    • smoke-tested OpenClaw locally with subcommand-scoped timeout on status, tabs, open, and evaluate

Please take another look when you have a moment.

@yan5xu yan5xu merged commit 7c2ee5e into epiral:main Mar 22, 2026
yan5xu added a commit that referenced this pull request Mar 22, 2026
- #82: extract EXEC_TIMEOUT_BUFFER_MS constant for magic number 5000
- #91: remove failed tabs from sessionOpenedTabs to prevent stale entries
- #25: update platform/command counts from 35/97 to 36/103

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ox01024 ox01024 deleted the fix/openclaw-timeout branch March 22, 2026 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

site --openclaw does not pass timeout through to openclaw browser evaluate

2 participants