Skip to content

fix(core): preserve provider identity in catalog updates - #46948

Merged
kitlangton merged 1 commit into
v2from
provider-identity
Sep 3, 2026
Merged

fix(core): preserve provider identity in catalog updates#46948
kitlangton merged 1 commit into
v2from
provider-identity

Conversation

@kitlangton

Copy link
Copy Markdown
Contributor

Why

A provider update could change provider.id while leaving the catalog entry indexed under its original ID. Listing the provider then advertised an ID that could not retrieve that entry. Agent, model, skill, and integration updates already preserve their keyed identities.

What Changes

Provider updates now restore the ID passed to update after the callback completes. Other field edits still apply.

Operation Before After
Update original, assigning ID renamed and name Updated Stored under original, but reports ID renamed Stored under original and reports ID original; name becomes Updated
Read using renamed No entry No entry: updating is not renaming

The regression covers creation, an existing provider, editor reads, public lookup/listing, and replay after reload.

Scope

One runtime assignment in Catalog.provider.update, matching the existing model-editor behavior. This does not redesign editor methods or make all returned catalog values immutable.

Verification

# packages/core
bun run test test/catalog.test.ts --test-name-pattern 'preserves provider identity'
bun run test test/catalog.test.ts test/agent.test.ts test/state.test.ts test/state-replay.test.ts
bun typecheck

# repository root
bunx prettier --check packages/core/src/catalog.ts packages/core/test/catalog.test.ts
git diff --check

The focused regression failed before the fix (original expected, renamed received). After the fix, all 59 focused tests pass, including the regression; Core typechecking and formatting pass. The normal pre-push workspace typecheck also passed.

@kitlangton
kitlangton enabled auto-merge (squash) September 3, 2026 01:31
@kitlangton
kitlangton merged commit 050398f into v2 Sep 3, 2026
14 of 15 checks passed
@kitlangton
kitlangton deleted the provider-identity branch September 3, 2026 01:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant