fix(model/openai): add CustomHeaders to ChatModelConfig#868
Open
Dennisadira wants to merge 1 commit into
Open
Conversation
components/model/openai.ChatModelConfig was missing the CustomHeaders field supported by agenticopenai.ChatConfig and libs/acl/openai.Config, causing inconsistency across the openai model packages. This adds the field and threads it through to the underlying openai.Config in NewChatModel, and bumps the libs/acl/openai dependency to the pseudo-version that introduced the field. Fixes #1048 Signed-off-by: Adira Denis Muhando <dennisadira@gmail.com> Assisted-by: Claude Sonnet 4.6 [claude-code]
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.
Problem
components/model/openai.ChatModelConfiglacks aCustomHeadersfield, whileagenticopenai.ChatConfigand the underlyinglibs/acl/openai.Configboth support it. This inconsistency means users of theopenaipackage cannot pass custom HTTP headers per request.Closes #1048
Changes
CustomHeaders map[string]stringfield toChatModelConfigwith an// Optional.doc comment matching the struct's existing style.config.CustomHeadersinto theopenai.Config{}struct literal insideNewChatModel.libs/acl/openaidependency fromv0.1.17tov0.1.18-0.20260527084435-846f52bd97c6(the pseudo-version that introducedCustomHeadersinConfig), matching whatagenticopenaialready uses.TestOpenAIGenerate/custom headers preserved in configthat constructs aChatModelConfigwithCustomHeadersset and verifies the field is preserved and thatNewChatModelaccepts the config without error.Test plan
go build ./components/model/openai/...passesgo vet ./components/model/openai/...passescustom headers preserved in configaddedSigned-off-by: Adira Denis Muhando dennisadira@gmail.com
Assisted-by: Claude Sonnet 4.6 [claude-code]