Skip to content

fix(registry): generated-registry loader reads the refreshed data-dir file (#3707)#3818

Merged
williamzujkowski merged 1 commit into
mainfrom
fix/registry-refresh-loader-path-3707
Jun 9, 2026
Merged

fix(registry): generated-registry loader reads the refreshed data-dir file (#3707)#3818
williamzujkowski merged 1 commit into
mainfrom
fix/registry-refresh-loader-path-3707

Conversation

@williamzujkowski

Copy link
Copy Markdown
Collaborator

Closes #3707.

Bug

registry refresh writes the regenerated catalog to the data dir (registry-command.ts:293nexusDataPath('model-registry.generated.json')), but loadGeneratedRegistryEntries read only the bundled package copy (models-generated-loader.ts:50dirname(import.meta.url)/…). So a refresh's generated file was silently never picked up — even after #3185's in-process reloadDefaultRegistry(), which re-reads via the same package path. The hot-reload reported success but had no effect on the generated long-tail tier.

Fix

defaultGeneratedPath() now prefers a refreshed file in the data dir when present, falling back to the bundled package copy — the same data-dir > package precedence the overlay path already uses. (The package dir is also typically read-only under a global npm install, so the data dir is the only writable target a refresh has.) Fail-soft behavior preserved; an explicit path override is unchanged.

Verification (TDD)

New models-generated-loader.test.ts:

  • data-dir precedence (was RED before the fix)
  • package fallback when no data-dir file
  • explicit path override still honored

804 config tests pass; typecheck, lint, governance, producer-consumer clean.

🤖 Generated with Claude Code

`registry refresh` writes the regenerated catalog to the DATA dir
(registry-command.ts:293, nexusDataPath), but loadGeneratedRegistryEntries read
only the bundled PACKAGE copy (dirname(import.meta.url)) — so a refresh's file was
silently never loaded, even after #3185's reloadDefaultRegistry() re-read via the
same package path. The hot-reload appeared to work but had no effect on the
generated tier.

Fix: defaultGeneratedPath() prefers a refreshed file in the data dir when present,
falling back to the bundled package copy — the data-dir > package precedence the
overlay path already uses (and the package dir is often read-only under a global
npm install, so the data dir is the only writable refresh target). Fail-soft kept.

TDD: new models-generated-loader.test.ts — data-dir precedence (was RED), package
fallback, explicit-override. 804 config tests pass; typecheck/lint/governance/
producer-consumer clean.

Closes #3707.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@williamzujkowski williamzujkowski merged commit 8d73e59 into main Jun 9, 2026
41 checks passed
@williamzujkowski williamzujkowski deleted the fix/registry-refresh-loader-path-3707 branch June 9, 2026 19:37
@github-project-automation github-project-automation Bot moved this from Backlog to Done in nexus-agents project Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

registry: 'registry refresh' writes to data dir but the generated loader reads the package dir

1 participant