magnificent-hairdresser-38202
09/04/2025, 4:30 AMworking_dir is defined. Hint: it’s added by this PR: https://github.com/All-Hands-AI/OpenHands/pull/9718. For local runtime, we have a bug where this value is always /workspace even though the real working directory is not. Note that in local runtime, we set working directory by SANDBOX_VOLUMES={real_working_dir}:/workspace:rw
Once you collect enough information, please write a unit test to reproduce the bug, and create a fix. Create a PR once you finish.nutritious-balloon-65098
09/04/2025, 4:30 AMnutritious-balloon-65098
09/04/2025, 4:43 AMworking_dir bug in local runtime. Here's what was accomplished:
Problem Identified: In local runtime, the working_dir parameter passed to create_memory() was always /workspace instead of the actual filesystem path (e.g., /tmp/openhands_workspace_xyz). This occurred because the original config object remained unchanged while the runtime's config was updated during connection.
Root Cause: The issue was in openhands/core/main.py line 142, where config.workspace_mount_path_in_sandbox was used instead of runtime.config.workspace_mount_path_in_sandbox.
Fix Applied: Changed one line to use runtime.config.workspace_mount_path_in_sandbox, ensuring the LLM receives the correct working directory information after the runtime has been connected and configured.
Testing: Added comprehensive unit tests that verify:
• The fix works for both temp workspace and explicit workspace_base scenarios
• Docker runtime behavior remains unchanged (still correctly uses /workspace)
• The original bug is properly reproduced and resolved
Pull Request: Created PR #10801 (https://github.com/All-Hands-AI/OpenHands/pull/10801) with detailed documentation of the problem, solution, and testing approach.
The fix is minimal, targeted, and thoroughly tested, ensuring that local runtime now correctly reports its actual filesystem working directory to the LLM while maintaining compatibility with other runtime types.
<sub>View full conversation</sub>