Skip to content

fix(core): isolate repository cache hosts - #55610

Closed
sdivyanshu90 wants to merge 1 commit into
anomalyco:devfrom
sdivyanshu90:isolate-cache-hosts
Closed

sdivyanshu90 wants to merge 1 commit into
anomalyco:devfrom
sdivyanshu90:isolate-cache-hosts

Conversation

@sdivyanshu90

@sdivyanshu90 sdivyanshu90 commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #55608

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Encode the repository authority as one cache directory component. A port-based remote such as https://git.example.com:8443/team/repo.git now keeps a separate checkout from [email protected]:8443/team/repo.git, whose path starts with 8443/.

Existing caches for port-based remotes will be cloned once into the new location. Ordinary hostname paths stay the same.

How did you verify your code works?

From packages/core, using Bun 1.4.3:

  • bun run test test/repository.test.ts test/repository-cache.test.ts: 25 passed. Both new regressions fail before the fix. The integration test uses real local Git repositories and checks independent contents and cache reuse.
  • bun typecheck: passed.
  • Focused Oxlint, Prettier, and git diff --check: passed.

The repository-wide bun run check passed lint with existing warnings, then stopped because the filtered dependency installation lacks GUI packages' dependencies (@tsconfig/node22).

Screenshots / recordings

Not applicable; no rendered UI changes.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Added by the opencode bot (AI-generated).

Related: #51577

@sdivyanshu90

Copy link
Copy Markdown
Contributor Author

Hi @kitlangton, could you please review this PR whenever you have some time. Thanks!

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. I ran the reproduction from #55608 on the base and with this change. On the base both remotes map to /cache/git.example.com/8443/team/repo. With the change, the port-based remote gets git.example.com%3A8443/... and the other remote keeps its path. As a side effect, bracketed IPv6 hosts are no longer broken up into odd folders like [/1]. A host of .. is still rejected, and a literal % in a host is encoded again, so it can't collide with an encoded :. The repository and repository-cache tests pass (25), the new tests fail on the base, and the core typecheck passes.

Public API: unchanged. Only the on-disk folder layout of the repository cache changes for hosts with a port, and existing checkouts at the old paths are just cloned again once.

No concerns.

Related: #51577

@github-actions

Copy link
Copy Markdown
Contributor

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

V2 repository cache aliases port authorities with numeric namespaces

1 participant