Skip to content

fix: resolve submodule paths when fetching file contents#239

Merged
sweetmantech merged 1 commit intotestfrom
sweetmantech/myc-4165-chat-filetree-onclick-view-file-contents
Feb 24, 2026
Merged

fix: resolve submodule paths when fetching file contents#239
sweetmantech merged 1 commit intotestfrom
sweetmantech/myc-4165-chat-filetree-onclick-view-file-contents

Conversation

@sweetmantech
Copy link
Copy Markdown
Contributor

Summary

  • GET /api/sandboxes/file now resolves paths that fall inside git submodules to the correct submodule repository before fetching
  • Adds resolveSubmodulePath — checks .gitmodules to detect if a path is within a submodule, and if so returns the submodule's repo URL with the relative path
  • Previously, clicking a submodule file in the filetree returned 404 because the path doesn't exist in the parent repo

Test plan

  • Added resolveSubmodulePath unit tests (8 tests) — submodule resolution, non-submodule passthrough, null gitmodules, invalid URL, nested paths, longest-match, directory boundary check
  • Updated getSandboxesFileHandler tests (8 tests) — added submodule resolution integration test
  • All tests pass

🤖 Generated with Claude Code

GET /api/sandboxes/file now resolves paths inside git submodules to
the correct submodule repo before fetching. Previously, submodule file
paths returned 404 because the file doesn't exist in the parent repo.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Feb 24, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
recoup-api Ready Ready Preview Feb 24, 2026 4:52pm

Request Review

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Feb 24, 2026

Warning

Rate limit exceeded

@sweetmantech has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 2 minutes and 3 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between c99f439 and 6f71cb8.

⛔ Files ignored due to path filters (2)
  • lib/github/__tests__/resolveSubmodulePath.test.ts is excluded by !**/*.test.*, !**/__tests__/** and included by lib/**
  • lib/sandbox/__tests__/getSandboxesFileHandler.test.ts is excluded by !**/*.test.*, !**/__tests__/** and included by lib/**
📒 Files selected for processing (2)
  • lib/github/resolveSubmodulePath.ts
  • lib/sandbox/getSandboxesFileHandler.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch sweetmantech/myc-4165-chat-filetree-onclick-view-file-contents

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sweetmantech sweetmantech merged commit 7b8c8b6 into test Feb 24, 2026
3 checks passed
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