Skip to content

Fix browser agent stability: GPT-5 timeout guardrails and network capture cleanup#167

Merged
nwang783 merged 4 commits into
mainfrom
162-bug-investigate-browser-use-timeout
Jan 19, 2026
Merged

Fix browser agent stability: GPT-5 timeout guardrails and network capture cleanup#167
nwang783 merged 4 commits into
mainfrom
162-bug-investigate-browser-use-timeout

Conversation

@nwang783

@nwang783 nwang783 commented Jan 19, 2026

Copy link
Copy Markdown
Owner

Summary

This PR addresses browser agent stability issues, specifically GPT-5 model timeouts that were causing browser tasks to fail prematurely.

Changes

1. Remove broken filter_type parameter (745dd6f)

  • Removed non-functional filter_type parameter from get_network_requests tool
  • Updated documentation in browser_base.txt prompt template
  • Cleaned up network_capture.py and browser_use_adapter.py

2. Add GPT-5 timeout guardrails (7ec86d4)

  • Added environment variables for operational tuning:
    • TEMPO_BROWSER_USE_LLM_TIMEOUT: LLM response timeout (seconds)
    • TEMPO_BROWSER_USE_MAX_FAILURES: Max consecutive failures before abort
    • TEMPO_BROWSER_USE_MAX_HISTORY_ITEMS: Cap on conversation history items
    • TEMPO_BROWSER_USE_MAX_COMPLETION_TOKENS: Max tokens for LLM response
  • Implemented automatic guardrails for GPT-5 models:
    • Minimum 120s timeout (observed 60s timeouts in production)
    • Minimum 3 failure retries
  • Removed verbose debug logging no longer needed

3. Add validation and documentation (1566156)

  • Added _parse_env_int() helper with input validation and clear warning messages
  • Added logging when GPT-5 guardrails are applied for operational visibility
  • Documented all new environment variables in config.example.toml

Testing

  • All existing tests pass
  • Manual verification of import and helper function behavior

Files Changed

  • tempo/agents/browser.py - Added stability settings with validation
  • tempo/infra/browser_use_llm.py - Added max_completion_tokens support
  • tempo/tools/browser_task_tool.py - Removed debug logging
  • tempo/tools/network_capture.py - Removed filter_type parameter
  • tempo/tools/browser_use_adapter.py - Removed filter_type parameter
  • tempo/prompts/templates/browser_base.txt - Updated documentation
  • config.example.toml - Documented new environment variables

nwang added 3 commits January 17, 2026 16:22
…system tools

- Add debug logging to browser_task_tool.py to trace timeout issues:
  - Log agent configuration (max_failures, step_timeout, llm_timeout) before run
  - Log completion state (consecutive_failures, is_done, is_successful) after run
  - Warn when agent exits with 3+ consecutive failures

- Remove duplicate file_read/file_write from browser_use_adapter.py:
  - Browser-use already provides built-in write_file, read_file, replace_file
  - Removed tempo-sec duplicates to avoid confusion
  - Shell tool can be used for Docker container file operations if needed
@nwang783 nwang783 linked an issue Jan 19, 2026 that may be closed by this pull request
- Add _parse_env_int() helper with validation and warning for invalid values
- Log when GPT-5 guardrails are applied for operational visibility
- Document TEMPO_BROWSER_USE_* env vars in config.example.toml
@nwang783 nwang783 changed the title 162 bug investigate browser use timeout Fix browser agent stability: GPT-5 timeout guardrails and network capture cleanup Jan 19, 2026
@nwang783 nwang783 merged commit d8b407d into main Jan 19, 2026
3 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.

Bug: Investigate Browser Use Timeout

1 participant