[None][feat] Add more disagg conversation ID headers support#13656
[None][feat] Add more disagg conversation ID headers support#13656reasonsolo wants to merge 1 commit intoNVIDIA:mainfrom
Conversation
📝 WalkthroughWalkthroughThe change extends conversation ID extraction in the OpenAI disaggregated server to support multiple session headers with a defined priority order, replacing exclusive reliance on a single header. A new test module validates the extraction logic across various header configurations. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
tests/unittest/disaggregated/test_openai_disagg_server.py (1)
26-57: ⚡ Quick winAdd edge-case coverage for empty and missing headers.
Please add cases for:
- higher-priority header present but empty while lower-priority header is non-empty, and
- no supported headers present (assert request remains unchanged).
This locks down fallback and no-op behavior.As per coding guidelines: “Coverage expectations: Assess whether new/changed tests cover happy path, important edge cases, and failure modes relevant to the feature or fix.”
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tests/unittest/disaggregated/test_openai_disagg_server.py` around lines 26 - 57, Extend test_extract_conversation_id_from_headers to cover two edge cases: add a case where a higher-priority header (e.g., "X-Session-ID") is present but an empty string while a lower-priority header (e.g., "X-Correlation-ID" or "x-session-affinity") is non-empty and assert that OpenAIDisaggServer._extract_conversation_id selects the non-empty lower-priority value on the CompletionRequest created in the test (use _raw_request(headers) and assert request.disaggregated_params.conversation_id equals the lower-priority value); and add a case where none of the supported headers are present and assert that the CompletionRequest remains unchanged (request.disaggregated_params is None) after calling _extract_conversation_id.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@tensorrt_llm/serve/openai_disagg_server.py`:
- Around line 190-196: The loop that picks the conversation_id currently treats
empty string values as valid; update the logic in
OpenAIDisaggServer._CONVERSATION_ID_HEADERS iteration (where header_conv_id is
set via raw_req.headers.get) to ignore None or empty/whitespace-only header
values (e.g., check header_conv_id is not None and header_conv_id.strip() != "")
before breaking, so it will continue to lower-priority headers and only return
when a non-empty conversation_id is found.
---
Nitpick comments:
In `@tests/unittest/disaggregated/test_openai_disagg_server.py`:
- Around line 26-57: Extend test_extract_conversation_id_from_headers to cover
two edge cases: add a case where a higher-priority header (e.g., "X-Session-ID")
is present but an empty string while a lower-priority header (e.g.,
"X-Correlation-ID" or "x-session-affinity") is non-empty and assert that
OpenAIDisaggServer._extract_conversation_id selects the non-empty lower-priority
value on the CompletionRequest created in the test (use _raw_request(headers)
and assert request.disaggregated_params.conversation_id equals the
lower-priority value); and add a case where none of the supported headers are
present and assert that the CompletionRequest remains unchanged
(request.disaggregated_params is None) after calling _extract_conversation_id.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 7c37fe27-5384-4f53-aa81-b80db9874eef
📒 Files selected for processing (4)
tensorrt_llm/serve/openai_disagg_server.pytests/integration/test_lists/qa/llm_function_core.txttests/integration/test_lists/test-db/l0_a10.ymltests/unittest/disaggregated/test_openai_disagg_server.py
Signed-off-by: Lizhi Zhou <1432185+reasonsolo@users.noreply.github.com>
f8dd09d to
e1b390f
Compare
|
/bot run --disable-fail-fast |
|
PR_Github #46346 [ run ] triggered by Bot. Commit: |
|
PR_Github #46346 [ run ] completed with state |
Summary by CodeRabbit
New Features
Tests
Description
Test Coverage
PR Checklist
Please review the following before submitting your PR:
PR description clearly explains what and why. If using CodeRabbit's summary, please make sure it makes sense.
PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.
Test cases are provided for new code paths (see test instructions)
Any new dependencies have been scanned for license and vulnerabilities
CODEOWNERS updated if ownership changes
Documentation updated as needed
Update tava architecture diagram if there is a significant design change in PR.
The reviewers assigned automatically/manually are appropriate for the PR.
Please check this after reviewing the above items as appropriate for this PR.
GitHub Bot Help
To see a list of available CI bot commands, please comment
/bot help.