fix(responses): mark truncated output incomplete - #12182
Conversation
Signed-off-by: Ryan McCormick <rmccormick@nvidia.com>
|
Signed-off-by: Ryan McCormick <rmccormick@nvidia.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (3)
WalkthroughChangesThe OpenAI Responses converters now represent Responses output-limit handling
Estimated code review effort: 3 (Moderate) | ~25 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Comment |
|
Adding downstream validation context from a fork-side investigation. We hit the same Responses adapter behavior when a backend terminal chat-completion chunk carries Minimal sanitized repro shape: {
"request": {
"model": "example-model",
"input": [
{"role": "user", "content": "Synthetic task that requires more output than the configured cap."}
],
"max_output_tokens": 8
},
"backend_chat_completion_terminal_choice": {
"finish_reason": "length",
"message": {
"role": "assistant",
"content": "partial synthetic output"
}
}
}Expected Responses result: {
"status": "incomplete",
"completed_at": null,
"incomplete_details": {"reason": "max_output_tokens"}
}Expected streaming terminal event: {
"type": "response.incomplete",
"response": {
"status": "incomplete",
"incomplete_details": {"reason": "max_output_tokens"}
}
}This aligns with the OpenAI Responses guidance for max-output-token exhaustion and is important for OpenAI Agents SDK / Codex-style clients, which inspect |
|
cc borjan on this issue. Once merged, we can pull it in. |
|
@codex review with above context |
indrajit96
left a comment
There was a problem hiding this comment.
LGTM!
Just for mu understand why are we doing this?
So as to give unblock clients/benchmarks who rely on finish_reason to fetch tool calls?
…put-truncation-incomplete Signed-off-by: Ryan McCormick <rmccormick@nvidia.com>
Signed-off-by: Ryan McCormick <rmccormick@nvidia.com>
Signed-off-by: Ryan McCormick <rmccormick@nvidia.com>
…esponses-api-mark-max-output-truncation-incomplete Signed-off-by: Ryan McCormick <rmccormick@nvidia.com>
Signed-off-by: Ryan McCormick <rmccormick@nvidia.com>
Signed-off-by: Ryan McCormick <rmccormick@nvidia.com>
…utput-truncation-incomplete
Signed-off-by: Ryan McCormick <rmccormick@nvidia.com>
…utput-truncation-incomplete
Summary
FinishReason::Lengthto incomplete response and item states.max_output_tokensas the incomplete reason.response.incompleteinstead ofresponse.completedfor truncated streams.Root cause
The Responses conversion path treated every terminal backend finish reason as successful completion, including length-limited generation.
Impact
Clients can distinguish complete output from output truncated by the configured maximum-token limit.
Validation
cargo test -p dynamo-llm protocols::openai::responses(72 passed)cargo fmt --all --checkcargo clippy -p dynamo-llm --tests -- -D warningsLinear: DIS-2514
Summary by CodeRabbit
response.incompleteevent instead of incorrectly indicating completion when output limits are reached.