Skip to content

fix: avoid mutating LLM factory config dictionaries - #6430

Open
lntutor wants to merge 1 commit into
mem0ai:mainfrom
lntutor:fix/llm-factory-config-mutation-6428
Open

fix: avoid mutating LLM factory config dictionaries#6430
lntutor wants to merge 1 commit into
mem0ai:mainfrom
lntutor:fix/llm-factory-config-mutation-6428

Conversation

@lntutor

@lntutor lntutor commented Jul 19, 2026

Copy link
Copy Markdown

Linked Issue

Closes #6428

Description

LlmFactory.create() now merges keyword overrides into a new dictionary instead of calling update() on the caller-owned config. Provider precedence is unchanged, while shared configuration dictionaries remain reusable after factory construction.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature
  • Breaking change
  • Refactor
  • Documentation update

Breaking Changes

N/A

Test Coverage

  • Added/updated unit tests
  • Added/updated integration tests
  • Tested manually
  • No tests needed

hatch run dev_py_3_11:pytest tests/utils/test_factory.py -q: 4 passed.

Checklist

  • Code follows the project style guidelines
  • Self-review performed
  • Tests prove the fix
  • New and existing targeted tests pass locally
  • Documentation is not required for this internal behavior fix

@CLAassistant

CLAassistant commented Jul 19, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@lntutor
lntutor force-pushed the fix/llm-factory-config-mutation-6428 branch from fe138fd to 2db3b68 Compare July 26, 2026 07:47
@github-actions github-actions Bot added the sdk-python Python SDK specific label Jul 26, 2026
@lntutor
lntutor force-pushed the fix/llm-factory-config-mutation-6428 branch from 2db3b68 to 8b8a00d Compare July 30, 2026 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sdk-python Python SDK specific

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LlmFactory.create mutates caller-owned config dictionaries

2 participants