anomalyco / anomalyco/opencode

Project-local Git references are not materialized while global references work

Open
#44,718 0 comments 0 reactions 1 assignee View on GitHub

@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 config contains the project-local reference;
  • git ls-remote succeeds;
  • 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
  1. 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"
        }
      }
    }
    
  2. Start OpenCode from that project.

  3. Verify that the reference is present in the merged config:

    opencode debug config
    
  4. Verify that the Git remote is accessible:

    git ls-remote git@gitlab.example.com:group/project.git
    
  5. Try to use @root-monorepo and check OpenCode's repository cache.

  6. Observe that the repository is not materialized.

  7. Move the same references entry to the global OpenCode config.

  8. Restart OpenCode.

  9. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.