Skip to content

refactor: promote KeyAliases values from string to AliasConfig with backward-compatible JSON marshaling - #4014

Merged
akshaydeo merged 1 commit into
devfrom
06-02-feat_extend_key_aliases_to_support_deployment_level_configurations
Jun 9, 2026
Merged

refactor: promote KeyAliases values from string to AliasConfig with backward-compatible JSON marshaling#4014
akshaydeo merged 1 commit into
devfrom
06-02-feat_extend_key_aliases_to_support_deployment_level_configurations

Conversation

@Pratham-Mishra04

@Pratham-Mishra04 Pratham-Mishra04 commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

KeyAliases previously mapped user-facing model names to plain strings (map[string]string). This PR promotes the value type to a rich AliasConfig struct that carries the wire model identifier (ModelID), an optional canonical model name (ModelName), a typed model family enum (ModelFamily), and optional provider-specific override sub-configs (AzureAliasCfg, VertexAliasCfg, BedrockAliasCfg, ReplicateAliasCfg). The change lays the groundwork for provider routing decisions and per-alias overrides without substring-sniffing wire model IDs.

Changes

  • KeyAliases is now map[string]AliasConfig instead of map[string]string. A custom UnmarshalJSON transparently promotes legacy string values ("my-model": "provider-id") to AliasConfig{ModelID: "provider-id"}, and AliasConfig.MarshalJSON emits the legacy string wire shape when only ModelID is set — keeping the JSON wire format and config_hash byte-stable for unenriched entries.
  • Added ModelFamily typed enum (anthropic, openai, mistral, cohere, gemini, nova, titan) with an IsValid() method for validation.
  • Added provider-specific alias override structs: AzureAliasCfg (api_version, anthropic_version, endpoint), VertexAliasCfg (project_id, project_number), BedrockAliasCfg (inference_profile_arn), ReplicateAliasCfg (use_deployments_endpoint).
  • KeyAliases.Resolve is preserved for backward compatibility; a new ResolveConfig method returns the full AliasConfig.
  • KeyAliases.Validate extended to check ModelID emptiness/whitespace, ModelName whitespace, and ModelFamily validity.
  • All provider ToBifrostListModelsResponse signatures updated from map[string]string to schemas.KeyAliases, with internal alias iteration updated to read alias.ModelID.
  • ListModelsPipeline.Aliases field updated to schemas.KeyAliases; resolveModelID and BackfillModels updated accordingly.
  • OpenRouter's listModelsByKey updated to copy and strip prefixes from AliasConfig.ModelID rather than the raw string.
  • config.schema.json updated so alias values accept either the legacy string shape or the new object shape via oneOf.
  • Comprehensive tests added for KeyAliases marshal/unmarshal round-trips (both legacy and rich shapes), ResolveConfig, Validate, ModelFamily.IsValid, DB persistence of legacy and rich alias shapes, and GenerateKeyHash stability.

Type of change

  • Bug fix
  • Feature
  • Refactor
  • Documentation
  • Chore/CI

Affected areas

  • Core (Go)
  • Transports (HTTP)
  • Providers/Integrations
  • Plugins
  • UI (React)
  • Docs

How to test

go test ./core/schemas/...
go test ./core/providers/...
go test ./framework/configstore/...
go test ./transports/bifrost-http/lib/...

Verify that existing configs using the legacy "alias": "model-id" string shape continue to load and hash identically. Verify that a config using the new object shape "alias": {"model_id": "model-id", "model_family": "anthropic"} loads correctly and produces a different hash than the unenriched equivalent.

Breaking changes

  • Yes
  • No

Any code that directly indexes into KeyAliases as map[string]string (e.g., aliases["key"] expecting a string) must be updated to access .ModelID on the returned AliasConfig. All in-repo call sites have been updated. External consumers constructing KeyAliases literals must change {"k": "v"} to {"k": {ModelID: "v"}} in Go code; JSON configs require no change due to the transparent legacy deserialization.

Related issues

Security considerations

No new secrets or auth surfaces introduced. The alias sub-configs (AzureAliasCfg.Endpoint, VertexAliasCfg.ProjectID, etc.) may reference EnvVar values; these follow the same encryption path as existing key-level fields.

Checklist

  • I read docs/contributing/README.md and followed the guidelines
  • I added/updated tests where appropriate
  • I updated documentation where needed
  • I verified builds succeed (Go and UI)
  • I verified the CI pipeline passes locally if applicable

Summary by CodeRabbit

  • Refactor

    • Enhanced model alias support: aliases now support rich objects (model ID, name, family, description, provider-specific overrides) while remaining backward-compatible with legacy string aliases.
    • Alias lookup, validation, and persistence updated across providers and listing flows to surface structured alias data and preserve legacy wire shape when present.
  • Tests

    • Added and updated unit/integration tests for alias JSON formats, validation, hashing, DB persistence, and provider model-list handling.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@coderabbitai

coderabbitai Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@Pratham-Mishra04, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 27 minutes and 35 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 204feeea-0435-4f86-bb74-49cb19254467

📥 Commits

Reviewing files that changed from the base of the PR and between d18d03a and 1a04ffb.

📒 Files selected for processing (24)
  • core/internal/llmtests/account.go
  • core/providers/anthropic/models.go
  • core/providers/azure/models.go
  • core/providers/bedrock/models.go
  • core/providers/bedrock/rerank_test.go
  • core/providers/cohere/models.go
  • core/providers/elevenlabs/models.go
  • core/providers/gemini/models.go
  • core/providers/huggingface/models.go
  • core/providers/mistral/models.go
  • core/providers/openai/models.go
  • core/providers/openrouter/openrouter.go
  • core/providers/replicate/models.go
  • core/providers/utils/models.go
  • core/providers/vertex/models.go
  • core/providers/vertex/utils.go
  • core/schemas/account.go
  • core/schemas/account_test.go
  • framework/configstore/encryption_test.go
  • framework/configstore/keyhash_alias_test.go
  • framework/configstore/migrations_test.go
  • framework/configstore/tables/encryption_test.go
  • transports/bifrost-http/lib/config_test.go
  • transports/config.schema.json
📝 Walkthrough

Walkthrough

Refactors KeyAliases from string values to rich AliasConfig objects with backward-compatible JSON; propagates the type through provider list-model signatures, the ListModelsPipeline, OpenRouter/Vertex helpers, transport fixtures, and persistence/encryption/migration tests.

Changes

KeyAliases Schema and Compatibility

Layer / File(s) Summary
KeyAliases type definition and structure
core/schemas/account.go
Introduces ModelFamily enum, provider-specific alias override structs, and AliasConfig combining ModelID with optional enrichment fields.
JSON marshal/unmarshal and legacy support
core/schemas/account.go, transports/config.schema.json
Adds MarshalJSON to emit legacy string when only ModelID is set; UnmarshalJSON accepts legacy string and rich object forms; config schema updated to oneOf legacy string or AliasConfig object.
Resolution, validation, and lookup helpers
core/schemas/account.go
Adds ResolveConfig, updates Resolve for case-insensitive matching, and expands Validate() to enforce trimming, required model_id, duplicate detection, and ModelFamily validation.
Schema tests
core/schemas/account_test.go
Comprehensive tests for marshal/unmarshal legacy vs rich shapes, mixed inputs, round-trips, invalid types, Resolve/ResolveConfig behavior, validation rules, and ModelFamily validity.

Provider Method Signature & Pipeline Updates

Layer / File(s) Summary
Provider method signatures
core/providers/*/models.go
All ToBifrostListModelsResponse methods updated to accept aliases schemas.KeyAliases and forward it into the list-model pipeline.
ListModelsPipeline field and resolution
core/providers/utils/models.go
ListModelsPipeline.Aliases changed to schemas.KeyAliases; resolveModelID and backfill now use AliasConfig.ModelID.
Vertex and OpenRouter helpers
core/providers/vertex/utils.go, core/providers/openrouter/openrouter.go
Vertex buildResponseFromConfig and OpenRouter normalization updated to operate on schemas.KeyAliases and strip prefixes from ModelID.
Per-provider wiring
core/providers/{anthropic,azure,bedrock,cohere,elevenlabs,gemini,huggingface,mistral,openai,replicate,vertex}
Each provider's list-model conversion function updated to accept schemas.KeyAliases and forward it unchanged into the shared pipeline.

Test Data, Fixtures, and Transport Tests

Layer / File(s) Summary
Provider rerank tests
core/providers/bedrock/rerank_test.go
Bedrock rerank tests updated to use {ModelID: ...} for cohere-rerank alias entries.
LLM test fixtures
core/internal/llmtests/account.go
GetKeysForProvider fixtures updated to use schemas.KeyAliases with {ModelID: ...} for Bedrock (Claude), Azure (GPT/audio), and Vertex (Anthropic) entries.
Transport config and sync tests
transports/bifrost-http/lib/config_test.go
Extensive transport test fixtures updated to use structured alias/deployment values across Azure, Bedrock, and Vertex sync and lifecycle scenarios.

Persistence, Encryption, Migration, and Hash Tests

Layer / File(s) Summary
Encryption and table round-trips
framework/configstore/tables/encryption_test.go, framework/configstore/encryption_test.go
Updated decrypt assertions to read AliasConfig.ModelID; added tests for legacy wire-shape persistence, rich-roundtrip, and legacy-input promotion on read.
Key-hash and migration tests
framework/configstore/keyhash_alias_test.go, framework/configstore/migrations_test.go
Added tests validating legacy JSON byte-shape preservation for ModelID-only aliases and that enriching alias metadata changes the resulting key hash; migration tests updated to assert ModelID fields.

🎯 4 (Complex) | ⏱️ ~60 minutes

Suggested reviewers

  • danpiths
  • akshaydeo

"🐰 I nibble bytes and tidy strings anew,
From plain names to configs, a lively view.
Legacy whispers stay safe in my paw,
Tests hop along — no wire shape flaw.
Cheers to richer aliases, swift and true!"

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The PR title 'refactor: promote KeyAliases values from string to AliasConfig with backward-compatible JSON marshaling' is clear, concise, and accurately describes the main change—a refactoring of the KeyAliases type from string values to a richer AliasConfig struct with backward-compatible serialization.
Description check ✅ Passed The PR description is comprehensive and well-structured, covering all major template sections: a clear summary of the change, detailed list of changes with design rationale, proper categorization as a refactor, affected areas clearly marked, testing instructions provided, breaking changes acknowledged with migration guidance, and relevant checklist items completed.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 06-02-feat_extend_key_aliases_to_support_deployment_level_configurations

Comment @coderabbitai help to get the list of available commands and usage tips.

Pratham-Mishra04 commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@greptile-apps

greptile-apps Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

Safe to merge. The backward-compatible JSON marshaling keeps the legacy wire format byte-stable for unenriched entries, and DB persistence tests confirm round-trip correctness for both legacy and rich alias shapes.

The refactor is well-scoped: custom MarshalJSON/UnmarshalJSON correctly handles both shapes, the type alias trick prevents infinite recursion, all provider call sites are updated consistently, and the schema update is complete. The test suite covers marshal/unmarshal round-trips, hash stability, DB encryption/decryption, and Validate edge cases.

core/schemas/account.go — three items noted in earlier threads (VLLMAliasCfg dead code, empty-string ModelName pointer validation gap, empty embedded sub-config pointer round-trip contract) remain open but do not block correctness of the current change.

Important Files Changed

Filename Overview
core/schemas/account.go Core type change: KeyAliases promoted to map[string]AliasConfig with custom MarshalJSON/UnmarshalJSON for backward compatibility; known nits flagged in earlier threads remain open.
core/schemas/account_test.go Comprehensive new tests covering legacy/rich unmarshal, mixed shapes, empty/null inputs, round-trips, marshal stability, Resolve/ResolveConfig, Validate, and ModelFamily.IsValid().
core/providers/utils/models.go ListModelsPipeline.Aliases type changed to schemas.KeyAliases; resolveModelID and BackfillModels updated to read alias.ModelID consistently.
core/providers/openrouter/openrouter.go Alias normalization updated to copy AliasConfig and strip prefix from ModelID; safe since pipeline only reads ModelID during list-models.
transports/config.schema.json Alias value updated to oneOf [legacy string, AliasConfig object] with additionalProperties: false and required model_id; consistent with Go types.
framework/configstore/keyhash_alias_test.go New tests verifying legacy byte-stable wire shape for unenriched aliases and different hash for enriched aliases.
framework/configstore/tables/encryption_test.go Added legacy and rich alias DB persistence tests; updated existing assertions to use .ModelID.
framework/configstore/encryption_test.go Updated Bedrock test assertion to use found.Aliases["claude-3"].ModelID.
core/internal/llmtests/account.go Updated all literal Aliases maps from map[string]string to schemas.KeyAliases with AliasConfig values.

Reviews (10): Last reviewed commit: "feat: extend key aliases to support depl..." | Re-trigger Greptile

Comment thread core/schemas/account.go
Comment thread core/schemas/account.go
Comment thread core/schemas/account.go
@Pratham-Mishra04
Pratham-Mishra04 force-pushed the 06-02-feat_extend_key_aliases_to_support_deployment_level_configurations branch from 71fedcc to f407b57 Compare June 4, 2026 20:49
@Pratham-Mishra04
Pratham-Mishra04 force-pushed the 06-01-feat_add_governance_allowlist_support_for_all_provider_routing branch from e0a8ea4 to c9d3c23 Compare June 4, 2026 20:49
@Pratham-Mishra04
Pratham-Mishra04 force-pushed the 06-02-feat_extend_key_aliases_to_support_deployment_level_configurations branch from f407b57 to c83f2c6 Compare June 5, 2026 09:48
@Pratham-Mishra04
Pratham-Mishra04 force-pushed the 06-01-feat_add_governance_allowlist_support_for_all_provider_routing branch from c9d3c23 to cd5bdec Compare June 5, 2026 09:48
@Pratham-Mishra04
Pratham-Mishra04 force-pushed the 06-02-feat_extend_key_aliases_to_support_deployment_level_configurations branch from c83f2c6 to 4439bc5 Compare June 7, 2026 07:25
@Pratham-Mishra04
Pratham-Mishra04 force-pushed the 06-01-feat_add_governance_allowlist_support_for_all_provider_routing branch 2 times, most recently from 694970e to a2384cb Compare June 8, 2026 06:54
@Pratham-Mishra04
Pratham-Mishra04 force-pushed the 06-02-feat_extend_key_aliases_to_support_deployment_level_configurations branch from 4439bc5 to 6a64d6d Compare June 8, 2026 06:55

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
framework/configstore/tables/encryption_test.go (1)

1969-2022: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Assert mixed alias wire shape before normalization.

Line 2017 checks only post-unmarshal values, so it won’t catch a regression where "plain" is persisted as an object instead of a legacy string when a rich sibling exists. Add a raw aliases_json decrypt assertion in this test before db.First(...).

As per coding guidelines, framework/** changes should preserve backward-compatible data formats and include tests that cover edge cases and failure paths.

Proposed test hardening
 func TestTableKey_AliasesJSON_RichRoundTrip(t *testing.T) {
 	db := setupTestDB(t)
@@
 	}
 	require.NoError(t, db.Create(key).Error)
+
+	// Assert raw persisted mixed shape before AfterFind normalization:
+	// rich entry should be object form, plain sibling should remain legacy string form.
+	raw := rawRow(t, db, "config_keys", key.ID)
+	rawAliasesVal := raw["aliases_json"]
+	var rawAliasesStr string
+	switch v := rawAliasesVal.(type) {
+	case string:
+		rawAliasesStr = v
+	case []byte:
+		rawAliasesStr = string(v)
+	}
+	require.NotEmpty(t, rawAliasesStr)
+	plaintext, err := encrypt.Decrypt(rawAliasesStr)
+	require.NoError(t, err)
+	assert.Contains(t, plaintext, `"plain":"gpt-4o-fallback"`)
+	assert.Contains(t, plaintext, `"best-model":{"model_id":"azure-deployment-xyz"`)
 
 	var found TableKey
 	require.NoError(t, db.First(&found, key.ID).Error)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@framework/configstore/tables/encryption_test.go` around lines 1969 - 2022,
Add a pre-unmarshal assertion that the on-disk column "aliases_json" for the
inserted TableKey remains the legacy mixed wire-shape (i.e., "plain" persisted
as a string) before calling db.First/auto-unmarshal: after creating key (created
via setupTestDB and db.Create(key)), fetch the raw aliases_json for key.ID
(e.g., via db.Model(&TableKey{}).Select("aliases_json").Where("id = ?", key.ID)
or equivalent), decrypt/unwrap that raw payload using the same aliases
decryption helper used by TableKey (or a decryptAliasesJSON helper), and assert
the decrypted JSON still contains "plain" as a string (not an object) while
"best-model" is the rich object; then proceed with the existing db.First(&found,
key.ID) and the rest of the assertions.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@core/providers/openrouter/openrouter.go`:
- Around line 209-214: The alias normalization silently overwrites entries when
stripPrefix(k) collides (e.g., "foo" vs "openrouter/foo") in the loop over
key.Aliases; update the logic that populates normalizedAliases so collisions are
handled deterministically: iterate the alias map keys in a sorted order (or
otherwise deterministic order), compute n := stripPrefix(k) and if
normalizedAliases already has n either (a) apply a clear precedence rule (e.g.,
prefer the exact key name over the prefixed one or vice versa) or (b) keep the
first-seen entry and log or return an error indicating the collision; change
code around normalizedAliases, stripPrefix, and the loop over key.Aliases to
implement this deterministic collision resolution.

---

Duplicate comments:
In `@framework/configstore/tables/encryption_test.go`:
- Around line 1969-2022: Add a pre-unmarshal assertion that the on-disk column
"aliases_json" for the inserted TableKey remains the legacy mixed wire-shape
(i.e., "plain" persisted as a string) before calling db.First/auto-unmarshal:
after creating key (created via setupTestDB and db.Create(key)), fetch the raw
aliases_json for key.ID (e.g., via
db.Model(&TableKey{}).Select("aliases_json").Where("id = ?", key.ID) or
equivalent), decrypt/unwrap that raw payload using the same aliases decryption
helper used by TableKey (or a decryptAliasesJSON helper), and assert the
decrypted JSON still contains "plain" as a string (not an object) while
"best-model" is the rich object; then proceed with the existing db.First(&found,
key.ID) and the rest of the assertions.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 670375fa-b697-436f-861a-5343de276f3b

📥 Commits

Reviewing files that changed from the base of the PR and between 4439bc5 and 6a64d6d.

📒 Files selected for processing (22)
  • core/internal/llmtests/account.go
  • core/providers/anthropic/models.go
  • core/providers/azure/models.go
  • core/providers/bedrock/models.go
  • core/providers/bedrock/rerank_test.go
  • core/providers/cohere/models.go
  • core/providers/elevenlabs/models.go
  • core/providers/gemini/models.go
  • core/providers/huggingface/models.go
  • core/providers/mistral/models.go
  • core/providers/openai/models.go
  • core/providers/openrouter/openrouter.go
  • core/providers/replicate/models.go
  • core/providers/utils/models.go
  • core/providers/vertex/models.go
  • core/providers/vertex/utils.go
  • core/schemas/account.go
  • core/schemas/account_test.go
  • framework/configstore/encryption_test.go
  • framework/configstore/keyhash_alias_test.go
  • framework/configstore/migrations_test.go
  • framework/configstore/tables/encryption_test.go

Comment thread core/providers/openrouter/openrouter.go
@Pratham-Mishra04
Pratham-Mishra04 force-pushed the 06-01-feat_add_governance_allowlist_support_for_all_provider_routing branch from a2384cb to c0c727c Compare June 8, 2026 07:18
@Pratham-Mishra04
Pratham-Mishra04 force-pushed the 06-02-feat_extend_key_aliases_to_support_deployment_level_configurations branch from 6a64d6d to d18d03a Compare June 8, 2026 07:18

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
transports/config.schema.json (1)

2403-2413: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Tighten alias whitespace validation to match runtime contract.

Line 2403 and Line 2410 currently accept values with leading/trailing whitespace, and Line 2465 allows whitespace-padded alias keys. Runtime KeyAliases.Validate() rejects these, so malformed configs pass schema validation and then fail later at load/validation time. Please enforce no leading/trailing whitespace in the legacy string branch, model_id, and alias propertyNames (and keep model_name aligned with runtime whitespace rules too).

As per coding guidelines, transports/config.schema.json is the source of truth for config fields, so its constraints should match runtime validation behavior exactly.

Also applies to: 2465-2467

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@transports/config.schema.json` around lines 2403 - 2413, The schema currently
allows leading/trailing whitespace for the legacy alias string, model_id,
model_name, and alias property names, which diverges from runtime
KeyAliases.Validate(); update the schema to forbid surrounding whitespace: add a
pattern like "^(?!\\s).*(?<!\\s)$" (or equivalent) to the legacy string branch,
to the "model_id" and "model_name" property definitions, and add the same
pattern under the alias object’s "propertyNames" to prevent whitespace-padded
keys so schema validation matches KeyAliases.Validate().

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Duplicate comments:
In `@transports/config.schema.json`:
- Around line 2403-2413: The schema currently allows leading/trailing whitespace
for the legacy alias string, model_id, model_name, and alias property names,
which diverges from runtime KeyAliases.Validate(); update the schema to forbid
surrounding whitespace: add a pattern like "^(?!\\s).*(?<!\\s)$" (or equivalent)
to the legacy string branch, to the "model_id" and "model_name" property
definitions, and add the same pattern under the alias object’s "propertyNames"
to prevent whitespace-padded keys so schema validation matches
KeyAliases.Validate().

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: d40bb20f-c259-443c-9c53-5240f44db413

📥 Commits

Reviewing files that changed from the base of the PR and between 6a64d6d and d18d03a.

📒 Files selected for processing (24)
  • core/internal/llmtests/account.go
  • core/providers/anthropic/models.go
  • core/providers/azure/models.go
  • core/providers/bedrock/models.go
  • core/providers/bedrock/rerank_test.go
  • core/providers/cohere/models.go
  • core/providers/elevenlabs/models.go
  • core/providers/gemini/models.go
  • core/providers/huggingface/models.go
  • core/providers/mistral/models.go
  • core/providers/openai/models.go
  • core/providers/openrouter/openrouter.go
  • core/providers/replicate/models.go
  • core/providers/utils/models.go
  • core/providers/vertex/models.go
  • core/providers/vertex/utils.go
  • core/schemas/account.go
  • core/schemas/account_test.go
  • framework/configstore/encryption_test.go
  • framework/configstore/keyhash_alias_test.go
  • framework/configstore/migrations_test.go
  • framework/configstore/tables/encryption_test.go
  • transports/bifrost-http/lib/config_test.go
  • transports/config.schema.json

@Pratham-Mishra04
Pratham-Mishra04 force-pushed the 06-02-feat_extend_key_aliases_to_support_deployment_level_configurations branch from d18d03a to e82bb5b Compare June 8, 2026 11:55
@Pratham-Mishra04
Pratham-Mishra04 force-pushed the 06-01-feat_add_governance_allowlist_support_for_all_provider_routing branch from c0c727c to c6758e2 Compare June 8, 2026 11:55
@Pratham-Mishra04
Pratham-Mishra04 force-pushed the 06-02-feat_extend_key_aliases_to_support_deployment_level_configurations branch from e82bb5b to cc297cb Compare June 8, 2026 12:24
@Madhuvod
Madhuvod changed the base branch from 06-01-feat_add_governance_allowlist_support_for_all_provider_routing to graphite-base/4014 June 8, 2026 12:25
@Pratham-Mishra04
Pratham-Mishra04 force-pushed the 06-02-feat_extend_key_aliases_to_support_deployment_level_configurations branch from cc297cb to 1a04ffb Compare June 8, 2026 12:28
@Pratham-Mishra04
Pratham-Mishra04 changed the base branch from graphite-base/4014 to 06-01-feat_add_governance_allowlist_support_for_all_provider_routing June 8, 2026 12:28

akshaydeo commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Merge activity

  • Jun 9, 5:17 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jun 9, 5:23 AM UTC: @akshaydeo merged this pull request with Graphite.

@akshaydeo
akshaydeo changed the base branch from 06-01-feat_add_governance_allowlist_support_for_all_provider_routing to graphite-base/4014 June 9, 2026 05:22
@akshaydeo
akshaydeo changed the base branch from graphite-base/4014 to dev June 9, 2026 05:22
@akshaydeo
akshaydeo merged commit 626e539 into dev Jun 9, 2026
9 checks passed
@akshaydeo
akshaydeo deleted the 06-02-feat_extend_key_aliases_to_support_deployment_level_configurations branch June 9, 2026 05:23
@coderabbitai coderabbitai Bot mentioned this pull request Jun 22, 2026
18 tasks
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.

3 participants