Repository navigation
fix(sdk-chat): validate chat configuration - #21732
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Validate chat configuration internal/service/chat.go, internal/service/chat_sdk_contract_test.go, test/testcases/test_sdk_api/test_chat_assistant_management/test_create_chat_assistant.py, test/testcases/test_sdk_api/test_chat_assistant_management/test_update_chat_assistant.py, test/api/chat_api_test.go |
Creation and REST updates validate LLM setting values and prompt configuration types. SDK tests that were previously skipped now run. API tests cover invalid values and check that rejected create requests do not create chats. |
Merge nested configuration internal/service/chat.go, internal/service/chat_sdk_contract_test.go, test/testcases/test_sdk_api/test_chat_assistant_management/test_update_chat_assistant.py |
Nested configuration objects retain unspecified values during updates. agentic_rag remains a whole-object replacement. Tests check nested value preservation and that merging does not mutate the base map. |
Priority:
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix
Possibly related issues
- infiniflow/ragflow#21356 — This PR validates chat configuration during create and update, addressing invalid configuration being stored through the API. It does not address the issue’s frontend validation errors.
Possibly related PRs
- infiniflow/ragflow#21654 — Its SDK tests cover the invalid configuration and nested merge behavior implemented here.
- infiniflow/ragflow#21564 — It applies
llm_settingvalues through the update endpoint, which this PR validates. - infiniflow/ragflow#21211 — It adds per-chat
agentic_ragoverrides, whose replacement behavior is specified here.
Suggested reviewers: buua436
Merge Risk: 
Minimal · up to d7abb
-
No actionable merge-blocking risk was found in the reviewed changes.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Description check
-
Explanation
The description states the purpose of the change and provides test results. It is relevant and mostly complete, although it does not use the template's explicit “### Summary” heading or provide detailed background context.
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 6 functions across 3 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches: 💡 1
-
🛠️ Fix failing CI checks: 💡
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
A rabbit checks each setting’s type,
And keeps the nested values right.
A prompt must match its stated form,
While agentic_rag is replaced whole.
The tests now hop through every case,
And leave no rejected chat in place.
Comment @coderabbitai help to get the list of available commands.
Validate chat settings and preserve nested prompt metadata during updates.
All 226 chat SDK cases and the chat configuration API matrix pass.