anomalyco / anomalyco/opencode
Project-local Git references are not materialized while global references work
@kitlangton is already working on this.
Since Aug 24, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
Description
Git-based references configured in the global OpenCode config work correctly, but the same reference configured in a project-local opencode.json is not materialized.
The project-local reference is present in the resolved config shown by:
opencode debug config
The Git remote itself is accessible from the same environment:
git ls-remote git@gitlab.example.com:group/project.git
However, OpenCode does not create the repository checkout for the project-local reference.
Moving the exact same references entry to the global config makes it work.
Project config
{
"references": {
"root-monorepo": {
"hidden": false,
"repository": "git@gitlab.example.com:group/project.git",
"description": "root-monorepo"
}
}
}
Expected behavior
A Git reference declared in project-local opencode.json should behave the same way as the same reference declared in the global config.
The repository should be materialized and the reference should be available to OpenCode.
Actual behavior
The project-local reference:
- is visible in
opencode debug config; - points to a valid and accessible Git remote;
- is not materialized;
- does not work as expected.
The exact same reference works when moved to the global config.
Additional context
This looks like a config-layer propagation issue rather than a Git/SSH issue, because:
opencode debug configcontains the project-local reference;git ls-remotesucceeds;- no repository checkout is created for the project-local reference;
- moving the exact same config entry to the global config fixes the problem.
Potentially related issues:
- #30725 — project configuration not being picked up correctly
- #32825 — different config-dependent services seeing different config layers
- #34106 — references from local/project configuration not working correctly
Environment
OpenCode version: 1.18.22
OS: macOS 26.5.2 (Build 25F84)
Plugins
No response
OpenCode version
1.18.22
Steps to reproduce
-
Add a Git reference to the project-local
opencode.json:{ "references": { "root-monorepo": { "hidden": false, "repository": "git@gitlab.example.com:group/project.git", "description": "root-monorepo" } } } -
Start OpenCode from that project.
-
Verify that the reference is present in the merged config:
opencode debug config -
Verify that the Git remote is accessible:
git ls-remote git@gitlab.example.com:group/project.git -
Try to use
@root-monorepoand check OpenCode's repository cache. -
Observe that the repository is not materialized.
-
Move the same
referencesentry to the global OpenCode config. -
Restart OpenCode.
-
Observe that the reference now works and the repository is materialized.
Screenshot and/or share link
No response
Operating System
macOS 26.5.2 (Build 25F84)
Terminal
iTerm2
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.