fix(docker): preserve project/<repo> path for nested repo git changes - #61
Conversation
β¦r nested repos When a GitHub repo is connected to a conversation, it gets cloned to /workspace/project/<repo>/. Previously, normalizeGitUrl() normalized paths to "." (workspace root), which caused the Changes tab to show the outer /workspace repo instead of the cloned repo β making file modifications inside the connected repo invisible. Changes: - Update normalizeGitUrl() to preserve "project/<repo>" in the path so the agent-server resolves to the correct nested git repository - Remove unnecessary "git init /workspace/project" from sandbox entrypoint to avoid creating an intermediate git repo that shadows the cloned repo's changes - Update regression tests (19 cases) with new expected paths - Update TC-031 E2E test case with new acceptance criteria
There was a problem hiding this comment.
The changes correctly address the root cause of the Changes tab showing empty for nested repos. The fix preserves the project/<repo> path so the agent-server resolves to the correct cloned repo at /workspace/project/<repo>/ instead of the outer /workspace repo.
Key Changes:
normalizeGitUrl()now correctly preservesproject/<repo>path for all URL formats- Removed unnecessary
git init /workspace/projectthat shadowed the cloned repo - Comprehensive test coverage (19 test cases)
The implementation is solid with no blocking defects identified. The path transformation logic correctly handles URL-encoded, non-encoded, and bare repo name formats.
You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.
π Security Scan ResultsStatus: π‘ HIGH ISSUES - Review required!Summary
NPM Vulnerabilities
Security Score: N/A/10Please run |
When no repo is connected, clicking a dotfile like .gitignore in the Changes tab sends /workspace/project/.gitignore to the diff API. The previous regex treated .gitignore as a repo name, producing project/.gitignore which resolved to /mnt/efs/project/.gitignore (doesn't exist). Fix: repo names never start with "." β exclude dotfiles from the repo-name capture group so they fall through to the workspace-root handler, producing ./.gitignore instead. Also fix missing `ws` parameter in non-encoded workspace root callback that caused double-slash in the output path.
π Security Scan ResultsStatus: π‘ HIGH ISSUES - Review required!Summary
NPM Vulnerabilities
Security Score: N/A/10Please run |
Container asset hash changed due to patch-fix.js update.
π Security Scan ResultsStatus: π‘ HIGH ISSUES - Review required!Summary
NPM Vulnerabilities
Security Score: N/A/10Please run |
Add acceptance criteria #7-9 and a dedicated regression test section for the no-repo dotfile diff scenario where clicking .gitignore previously returned "Internal Server Error: File does not exist: /mnt/efs/project/.gitignore".
π Security Scan ResultsStatus: π‘ HIGH ISSUES - Review required!Summary
NPM Vulnerabilities
Security Score: N/A/10Please run |
## [1.2.0] - 2026-03-11 ### Added #### Sandboxes - **Startup timing instrumentation and SOCI support** (#58) - Added structured timing logs (`sandbox-startup-timing`) to benchmark sandbox startup phases in `/start` and `/resume` routes. - Integrated SOCI v2 index generation via `soci convert` for Fargate lazy image loading (requires `soci` CLI >= v0.10). - Introduced `sandboxSociImageUri` CDK context parameter for SOCI-enabled sandbox image override. - Exported sandbox image ECR URI as `CfnOutput` for SOCI index generation scripts. ### Changed #### Documentation - **Improved README for discoverability and engagement** (#60) - Restructured README to include a hero section, badges, and explicit value propositions. - Transformed features list into an emoji-tagged Key Features section for easier scanning. - Enhanced comparison tables and quick links for first-time visitor comprehension. ### Fixed #### Docker - **Correct VS Code port mapping from 60001 to 8001** (#62) - Resolved 502 runtime subdomain errors caused by incorrect port mapping (`60001` β `8001`) in `patch-exposed-urls.py`. - Fixed `can_connect(ip, 60001)` requests that failed to establish upstream connections due to mismatched port configurations in the agent-server SDK. - **Preserve project/<repo> path for nested repo git changes** (#61) - Corrected empty Changes tab for conversations linked to GitHub repositories. - Updated `normalizeGitUrl()` to preserve `project/<repo>` paths for accurate nested repo resolution. - Removed unnecessary intermediate `git init /workspace/project` repo creation shadowing actual repo changes. - **Normalize git API paths for connected repos** (#59) - Fixed 500 errors in git Changes tab when connecting GitHub repositories to conversations. - Adjusted `patch-fix.js` to properly normalize workspace paths containing nested repo directories. Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Summary
normalizeGitUrl()now preservesproject/<repo>path so the agent-server resolves to the correct nested git repository at/workspace/project/<repo>/git init /workspace/projectfrom sandbox entrypoint that created an intermediate git repo shadowing the cloned repo's changesRoot cause: When a repo (e.g.,
zxkane/openhands-infra) is connected, it's cloned to/workspace/project/openhands-infra/. Previously, git API paths were normalized to.(workspace root), which queried the outer/workspacerepo instead of the nested cloned repo β making file modifications invisible in the Changes tab.Test plan
npm run build)npm run test:tsβ relevant tests)node docker/test_patch_fix_git_paths.jsβ 19 cases)./test/select-e2e-tests.shfor required tests)Checklist
docker/test_patch_fix_git_paths.js)test/E2E_TEST_CASES.md)test/__snapshots__/stacks.test.ts.snap)