Skip to content

fix: add timeout to Bing search request and replace bare except clauses#1355

Open
Ricardo-M-L wants to merge 1 commit intoFoundationAgents:mainfrom
Ricardo-M-L:fix/bing-search-missing-timeout
Open

fix: add timeout to Bing search request and replace bare except clauses#1355
Ricardo-M-L wants to merge 1 commit intoFoundationAgents:mainfrom
Ricardo-M-L:fix/bing-search-missing-timeout

Conversation

@Ricardo-M-L
Copy link
Copy Markdown

Changes

1. Missing timeout in Bing search (app/tool/search/bing_search.py)

session.get(url=url) has no timeout — a slow or unresponsive Bing server blocks the agent indefinitely. Added timeout=30.

2. Bare except: in terminal cleanup (app/sandbox/core/terminal.py)

Three bare except: clauses in close() catch SystemExit and KeyboardInterrupt, preventing graceful shutdown. Replaced with except Exception:.

3. Bare except: in shell tool cleanup (app/tool/sandbox/sb_shell_tool.py)

Same issue in tmux session cleanup on error path.

1. bing_search.py: Add timeout=30 to session.get() to prevent
   indefinite hang on unresponsive servers.

2. terminal.py: Replace 3 bare `except:` with `except Exception:` in
   cleanup code to allow KeyboardInterrupt/SystemExit to propagate.

3. sb_shell_tool.py: Same bare except fix in tmux session cleanup.
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