Describe the bug
The GitHub connector discovery process aggressively caches repository structure based only on the branch name and ref, ignoring the commit SHA (sourceRevisionRef). This causes the discovery UI to become permanently stuck showing an old version of the repository if the user restructures their plugin/marketplace folders or fixes a manifest error.
Even when GitHub successfully delivers push webhooks and the backend logs show a successful sync cycle, the UI will continue returning the original cached structure.
To Reproduce
- Connect a GitHub repository as a plugin hub.
- Open the discovery UI (it fetches and caches the initial state).
- Push a commit that significantly changes the folder structure (e.g., adding
.claude-plugin/marketplace.json and moving a skill into a subfolder).
- Return to the discovery UI. It will still show the old structure and likely report "0 imported objects" because the old paths no longer exist in the actual repo.
- Deleting the connector instance and re-adding it is the only way to clear the cache via the UI.
Expected behavior
The discovery cache should be invalidated if the sourceRevisionRef (commit SHA) from the webhook or live fetch does not match the cached sourceRevisionRef.
Root Cause Analysis
In ee/apps/den-api/src/routes/org/plugin-system/store.ts, the resolveGithubConnectorDiscovery function checks the cache:
if (cached
&& cached.branch === discoveryContext.branch
&& cached.ref === discoveryContext.ref
&& cached.repositoryFullName === discoveryContext.repositoryFullName) {
return { ... }
}
It is missing a check against discoveryContext.headSha (or similar) vs cached.sourceRevisionRef. It assumes that if the branch name is the same, the content hasn't changed.
Workaround
Currently, users must either:
- Delete and recreate the entire GitHub integration in the Den UI.
- Manually clear the
githubDiscoveryCache JSON key from the connector_target table in the database.
Describe the bug
The GitHub connector discovery process aggressively caches repository structure based only on the branch name and ref, ignoring the commit SHA (
sourceRevisionRef). This causes the discovery UI to become permanently stuck showing an old version of the repository if the user restructures their plugin/marketplace folders or fixes a manifest error.Even when GitHub successfully delivers
pushwebhooks and the backend logs show a successful sync cycle, the UI will continue returning the original cached structure.To Reproduce
.claude-plugin/marketplace.jsonand moving a skill into a subfolder).Expected behavior
The discovery cache should be invalidated if the
sourceRevisionRef(commit SHA) from the webhook or live fetch does not match the cachedsourceRevisionRef.Root Cause Analysis
In
ee/apps/den-api/src/routes/org/plugin-system/store.ts, theresolveGithubConnectorDiscoveryfunction checks the cache:It is missing a check against
discoveryContext.headSha(or similar) vscached.sourceRevisionRef. It assumes that if the branch name is the same, the content hasn't changed.Workaround
Currently, users must either:
githubDiscoveryCacheJSON key from theconnector_targettable in the database.