Repository navigation
fix(sdk-python): prevent copilotkit_customize_config from mutating caller metadata - #7076
AyushCipher wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthrough
ChangesConfiguration metadata isolation
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to The configuration customizer now avoids leaking CopilotKit metadata into caller-owned LangChain configurations, with regression coverage for the relevant input cases. No actionable merge risk remains. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Hi @BenTaylorDev, I split the metadata mutation fix into #7076 as suggested. The pkg-pr-new workflow on my fork is failing because the pkg-pr-new GitHub App isn't installed on AyushCipher/CopilotKit (404: app not installed). The actual build step passes. I haven't made any code changes for this failure. |
|
Thanks for this, and sorry you landed on a duplicate — #6943 filed the same fix on 09-08 and we are going with it on first-filed. Your version was not wasted: the Closing in favour of #6943. Your test file covered more ground than ours and I would take more PRs from you. |
Summary
Fixes #6941.
copilotkit_customize_configpreviously reused the caller'sconfig["metadata"]dictionary by reference. Adding CopilotKitmetadata could therefore mutate the caller's config and affect
subsequent invocations.
This change creates a copy of the metadata dictionary before
adding CopilotKit-specific metadata.
Changes
base_config["metadata"]before modifying it.Nonebase configTests
pytest tests/test_customize_config.pypytest tests/ruff check tests/test_customize_config.pyruff format --check tests/test_customize_config.pyAll passed.
Full test suite: 243 passed, 12 skipped.
Summary by CodeRabbit
Bug Fixes
Tests