Skip to content

πŸ™Œ OpenHands: AI-Driven Development

Fix for issue where some cases use `WORK_PORT` and some use `APP_PORT` (#9830)

Tim O'Farrell6d7ab8a02261
diff --git a/openhands/runtime/impl/local/local_runtime.py b/openhands/runtime/impl/local/local_runtime.py
index 0a850794dc..e31016fbbe 100644
--- a/openhands/runtime/impl/local/local_runtime.py
+++ b/openhands/runtime/impl/local/local_runtime.py
@@ -623,8 +623,16 @@ def _create_server(
os.getenv('VSCODE_PORT') or str(find_available_tcp_port(*VSCODE_PORT_RANGE))
)
app_ports = [
- int(os.getenv('APP_PORT_1') or str(find_available_tcp_port(*APP_PORT_RANGE_1))),
- int(os.getenv('APP_PORT_2') or str(find_available_tcp_port(*APP_PORT_RANGE_2))),
+ int(
+ os.getenv('WORK_PORT_1')
+ or os.getenv('APP_PORT_1')
+ or str(find_available_tcp_port(*APP_PORT_RANGE_1))
+ ),
+ int(
+ os.getenv('WORK_PORT_2')
+ or os.getenv('APP_PORT_2')
+ or str(find_available_tcp_port(*APP_PORT_RANGE_2))
+ ),
]
# Get user info