Repository navigation
fix: resolve relative Git origins against the repository directory - #115
Open
specetator wants to merge 1 commit into
Open
specetator wants to merge 1 commit into
specetator wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resolve relative local Git origins against the repository directory instead of the OpenCode process's working directory.
getGitRepoInfo(directory)reads the origin with Git in that directory, but previously normalized a local path usingresolve(raw)in the process directory. This caused:../upstream.git) to generate the same identity and canonical container tag.The fix passes the repository directory into normalization. HTTPS, SSH, absolute-origin, and existing worktree-isolation behavior are unchanged.
Reproduction and tests
The regression tests create real temporary bare upstreams and working repositories. Each configured origin is checked with
git ls-remote origin, then the productiongetProjectIdentityandgetGeneratedProjectTagfunctions are exercised. No hosted memory API or model calls are needed.On base
762137de375d3b1920ba91fbdc400a030df92513, the two new regression tests fail while the two existing tag tests pass. With this patch:bun run test: 35 passed, 0 failedbun run typecheck: passedbun run build: passedgit diff --check: passedValidated on Linux using Node 24.19.0, Bun 1.4.4, and TypeScript 5.9.3, with an isolated HOME. Dependencies were installed with
bun install --frozen-lockfile. Windows/macOS and live hosted-service behavior were not tested.Compatibility
Projects previously assigned a wrong launch-directory-derived tag for a relative local origin may receive a corrected container tag. The README explains that the old container is not automatically migrated or added as a read fallback, because it may have mixed unrelated projects. An explicit
projectContainerTagoverride remains available after checking that the chosen container belongs to the project.This is not a claim of complete historical memory isolation: existing legacy read-container behavior remains unchanged.
AI disclosure
The implementation, regression tests, and independent review were performed by OpenAI coding agents. No human line-by-line code review is claimed. The tests and checks listed above were actually run against the reviewed patch; the published three file blobs were verified against those exact local contents.