hermes - ✅(Solved) Fix [Bug]: Session closed unexpectedly when use camofox as browser tool [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
NousResearch/hermes-agent#20507Fetched 2026-05-06 06:36:31
View on GitHub
Comments
0
Participants
1
Timeline
5
Reactions
0
Author
Participants
Timeline (top)
labeled ×3cross-referenced ×1mentioned ×1

Error Message

When I attempted to get the second item, I hit the "No browser session" error, and after several attempts to reload the page, I started receiving the "Sorry! Something went wrong on our end" (HTTP 503) error from Amazon. This typically happens when Amazon's anti-bot systems detect the repeated, unstable session requests and temporarily block the IP or session. This is a perfect example for your bug report: The browser tool's inability to maintain a persistent session leads to repeated page reloads, which eventually triggers a site-wide block (503 error) from the target website.

Additional Logs / Traceback (optional)

Root Cause

Root Cause Analysis (optional)

PR fix notes

PR #20511: fix(browser): preserve Camofox sessions between turns

Description (problem / solution / changelog)

Summary

  • Preserve Camofox browser sessions during per-turn AIAgent resource cleanup so follow-up browser operations can continue in the same visible session.
  • Keep shutdown, inactivity reaping, and all-browser cleanup on the existing close path so idle/server-side sessions can still be reclaimed.
  • Add regression coverage for both the browser cleanup helper and the per-turn AIAgent._cleanup_task_resources call.

Fixes #20507

Tests

  • scripts/run_tests.sh tests/tools/test_browser_cleanup.py
  • scripts/run_tests.sh tests/tools/test_browser_cleanup.py tests/tools/test_zombie_process_cleanup.py -k 'camofox or cleanup'
  • git diff --check

Changed files

  • run_agent.py (modified, +1/-1)
  • tests/tools/test_browser_cleanup.py (modified, +26/-0)
  • tests/tools/test_zombie_process_cleanup.py (modified, +23/-0)
  • tools/browser_tool.py (modified, +27/-9)

Code Example

Report       https://paste.rs/3a2MJ
  agent.log    https://dpaste.com/HX2Y98Q7S
  gateway.log  https://dpaste.com/BV9DZV5D3

---
RAW_BUFFERClick to expand / collapse

Bug Description

When use camoufox as browser tool, the browser session closed right after the AI give me result, so I cannot continue further operations.

Steps to Reproduce

Hermes and Camofox are installed in a headless server in docker container, I've use VNC to monitor the browser status:

Send to AI: access amazon.com and search for chocolate, give me first item on screen.

AI: 🌐 browser_navigate: "https://www.amazon.com" 👆 browser_click: "@e1" 🌐 browser_navigate: "https://www.amazon.com/s?k=chocolate"

AI: The first item on the screen for "chocolate" is the Ferrero Rocher - Limited Edition Gift Pack - 48 pcs.

The VNC screen show the operations but it turn black (window closed) right after AI send me the result.

Send to AI: give me second item

AI: 📸 browser_snapshot... 🌐 browser_navigate: "https://www.amazon.com/s?k=chocolate" (×2) 🖥️ browser_console... 🌐 browser_navigate: "https://www.amazon.com/s?k=chocolate"

AI: As you suspected, the session dropped again immediately after providing the first result.

When I attempted to get the second item, I hit the "No browser session" error, and after several attempts to reload the page, I started receiving the "Sorry! Something went wrong on our end" (HTTP 503) error from Amazon. This typically happens when Amazon's anti-bot systems detect the repeated, unstable session requests and temporarily block the IP or session.

This is a perfect example for your bug report: The browser tool's inability to maintain a persistent session leads to repeated page reloads, which eventually triggers a site-wide block (503 error) from the target website.

Expected Behavior

The window should keep alife until AI close it manually.

Actual Behavior

The window closed right after AI return result.

Affected Component

Tools (terminal, file ops, web, code execution, etc.)

Messaging Platform (if gateway-related)

No response

Debug Report

Report       https://paste.rs/3a2MJ
  agent.log    https://dpaste.com/HX2Y98Q7S
  gateway.log  https://dpaste.com/BV9DZV5D3

Operating System

Ubuntu 24.04

Python Version

No response

Hermes Version

No response

Additional Logs / Traceback (optional)

Root Cause Analysis (optional)

No response

Proposed Fix (optional)

No response

Are you willing to submit a PR for this?

  • I'd like to fix this myself and submit a PR

extent analysis

TL;DR

The browser session is closing immediately after the AI returns the result, likely due to the browser tool's inability to maintain a persistent session.

Guidance

  • Investigate the Camofox browser tool configuration to see if there's an option to keep the browser session alive after completing a task.
  • Review the AI's interaction with the browser tool to ensure it's not sending a command to close the session after providing the result.
  • Check the agent.log and gateway.log files for any errors or clues that might indicate why the session is being closed.
  • Consider adding a delay or a "keep alive" mechanism to the AI's interaction with the browser tool to prevent the session from closing prematurely.

Example

No code snippet is provided as it's not clearly supported by the issue, but an example of a potential fix could involve modifying the AI's code to send a "keep alive" signal to the browser tool after completing a task.

Notes

The root cause of the issue is not explicitly stated, but it's likely related to the browser tool's configuration or the AI's interaction with it. Further investigation is needed to determine the exact cause and implement a fix.

Recommendation

Apply workaround: Implement a "keep alive" mechanism or modify the AI's code to prevent the browser session from closing prematurely, as the root cause is not explicitly stated and a fix is not provided.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - ✅(Solved) Fix [Bug]: Session closed unexpectedly when use camofox as browser tool [1 pull requests, 1 participants]