Skip to content

fix(browser): align agent live-browser discovery timeouts#154

Merged
artemgetmann merged 1 commit into
mainfrom
codex/agent-user-live-timeout-20260326-164117
Mar 26, 2026
Merged

fix(browser): align agent live-browser discovery timeouts#154
artemgetmann merged 1 commit into
mainfrom
codex/agent-user-live-timeout-20260326-164117

Conversation

@artemgetmann
Copy link
Copy Markdown
Owner

Review Fast Path

  • User path fixed: local agent/TUI browser tasks that target the user's live Chrome session no longer false-fail early while raw browser tabs still works.
  • Proof: on an isolated gateway in this worktree, browser --browser-profile user-live tabs returned two live https://example.com/ tabs and the exact agent smoke returned TITLE: Example Domain.
  • Shared-state footgun removed: agent browser discovery now uses the same 45s attach-discovery budget as the raw CLI path instead of a much shorter hidden timeout.
  • Still hurts: clean-worktree runtime verification still needed temporary dependency/build scaffolding in this repo; that packaging friction is separate from this bug.

Why This Matters

  • The browser subsystem was healthy, but the agent path lied about it.
  • user-live attach can take tens of seconds when Chrome MCP is attaching or waiting on approval prompts.
  • Raw CLI already tolerated that. The agent helper path did not.

Scope Boundary

  • What changed:
    • browser client timeout budgets for status, profiles, and tabs
    • client test coverage for those discovery calls
  • What did not change:
    • Chrome MCP attach logic itself
    • readiness-reporting behavior
    • Telegram transport behavior
  • What still hurts:
    • clean-worktree build/runtime ergonomics remain rough and should be treated separately

Verification

  • Targeted test:
    • pnpm vitest --configLoader runner run src/browser/client.test.ts
  • Runtime proof on isolated gateway:
    • OPENCLAW_GATEWAY_PORT=18891 node dist/index.js browser --browser-profile user-live tabs
    • returned two https://example.com/ tabs
  • Full agent-path smoke:
    • OPENCLAW_GATEWAY_PORT=18891 node dist/index.js agent --agent main --session-id user-live-smoke --json --timeout 180 --message "In my Google Chrome browser, use my existing tab via the live browser and reply with exactly: TITLE: <page title>"
    • returned TITLE: Example Domain

AI Assistance

  • AI-assisted
  • Testing degree: targeted + live-tested

- what:
  - raise browser status, profiles, and tabs client timeouts to the same 45s attach-discovery budget used by the CLI path.
  - add a client test that proves the longer timeout budget is applied to discovery calls.
- why:
  - user-live attach through Chrome MCP can take tens of seconds, so the old 3s/10s/15s budgets made the agent path false-fail while raw browser CLI still worked.
- risk:
  - browser discovery calls now wait longer before surfacing a real outage, which could slightly delay failure reporting for genuinely dead browser sessions.
@artemgetmann artemgetmann merged commit 4a6bf51 into main Mar 26, 2026
3 of 10 checks passed
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.

1 participant