Repository navigation
Conversation
The embedding provider class changed but the parent options still won the configuration merge. Compare the resolved classes so aliases inherit and different services start with their own settings.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
embed_withalways merged the parent'sembed_optionsover the new provider's configuration:So a child that switched services kept the parent's model, dimensions and any credentials from the parent's provider config, and sent them to the new provider.
generate_withalready discards inherited options when the service changes ("Different Service, different APIs").embed_withnow keeps inherited options only when the resolved provider class is unchanged. A child that names another configuration of the same provider (an alias withservice: "OpenAI") still inherits the parent's options, with its own on top.Decision for the maintainer
The check compares resolved provider classes, where
generate_withcompares the configs'service:strings. The class works when no config exists and the provider is inferred from its key (embed_with :openaithenembed_with :mockwith an emptyactive_agent.yml), where bothservice:values areniland the string check would keep the parent's options; the last test covers that case. If you'd rather the two methods share one rule, I can movegenerate_withto the class comparison in a separate PR.Tests
test/features/embedding_provider_inheritance_test.rb::openaito:mockembeds with the mock and does not carry the parent's model, and the parent is unchanged;dimensions(guard; passes before too);dimensions.The first and third fail on
mainand pass with the change.Type of change
Scope check
Related issue
Fixes #752
Quality check
bin/rubocopon the changed files)gemfiles/rails8.gemfile: 4729 runs, 0 failures, 11 errors, 66 skips. The 11 errors are all inactionagent/test/cli_contract_test.rband are the same on unmodifiedmainin my environment (NoMethodError: undefined methodid' for an instance of Hashin rack-session under WebMock'sto_rack`), so they are unrelated to this change)Ownership
API changes
Not changed: with an alias for the same service, the parent's options still win over the alias's own configuration (for example its
access_token), as they do ingenerate_with.