-
Notifications
You must be signed in to change notification settings - Fork 216
Fix three critical bugs causing bash/tmux session leaks #2804
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
0fd0ea6
8fb7862
e63469d
d0289a6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,6 +16,7 @@ | |
| register_builtins_agents(enable_browser=True) | ||
| register_gemini_tools(enable_browser=True) | ||
| register_planning_tools() | ||
| register_builtins_agents() | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 Critical: Duplicate registration call. Remove this duplicate line.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟠 Important: Duplicate function call. This line calls While harmless (the function is idempotent via Recommendation: Remove this line, keep only line 16. |
||
|
|
||
|
|
||
| # Tool listing | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,13 +19,15 @@ | |
| def register_default_tools(enable_browser: bool = True) -> None: | ||
| """Register the default set of tools.""" | ||
| # Tools are now automatically registered when imported | ||
| from openhands.tools.delegate import DelegateTool | ||
| from openhands.tools.file_editor import FileEditorTool | ||
| from openhands.tools.task_tracker import TaskTrackerTool | ||
| from openhands.tools.terminal import TerminalTool | ||
|
|
||
| logger.debug(f"Tool: {TerminalTool.name} registered.") | ||
| logger.debug(f"Tool: {FileEditorTool.name} registered.") | ||
| logger.debug(f"Tool: {TaskTrackerTool.name} registered.") | ||
|
Comment on lines
+22
to
29
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 Critical - Scope Creep: These DelegateTool changes are completely unrelated to "fixing tmux session leaks" as described in the PR title and description. This PR mixes unrelated changes:
Split the DelegateTool changes into a separate PR with proper description and justification. |
||
| logger.debug(f"Tool: {DelegateTool.name} registered.") | ||
|
|
||
| if enable_browser: | ||
| from openhands.tools.browser_use import BrowserToolSet | ||
|
|
@@ -44,6 +46,7 @@ def get_default_tools( | |
| register_default_tools(enable_browser=enable_browser) | ||
|
|
||
| # Import tools to access their name attributes | ||
| from openhands.tools.delegate import DelegateTool | ||
| from openhands.tools.file_editor import FileEditorTool | ||
| from openhands.tools.task_tracker import TaskTrackerTool | ||
| from openhands.tools.terminal import TerminalTool | ||
|
|
@@ -52,6 +55,7 @@ def get_default_tools( | |
| Tool(name=TerminalTool.name), | ||
| Tool(name=FileEditorTool.name), | ||
| Tool(name=TaskTrackerTool.name), | ||
| Tool(name=DelegateTool.name), | ||
| ] | ||
| if enable_browser: | ||
| from openhands.tools.browser_use import BrowserToolSet | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟠 Important: This cleanup logic is overly aggressive - it kills ALL sessions on the "openhands" socket without checking if they're actually stale.
Problem: What if multiple agent-server instances share the same tmux socket? What if there are legitimate long-running sessions that should persist across server restarts?
Better approach: Track session ownership (e.g., PID file, session metadata) and only kill sessions that belong to this server instance or are truly orphaned.