Commit 2b0c3bd
committed
fix(ai): update OpenAI Responses API parameter name
OpenAI changed the parameter name in their Responses API from
`max_completion_tokens` to `max_output_tokens`. This caused requests
to fail with:
"Unsupported parameter: 'max_completion_tokens'. In the Responses API,
this parameter has moved to 'max_output_tokens'."
Root Cause:
- openai_llm_provider.rs:360 - Used rename="max_completion_tokens"
- openai_compatible_provider.rs:484 - Field name was max_completion_tokens
(which becomes the JSON key without explicit rename)
Fix:
- Changed serde rename to "max_output_tokens" in both files
- Updated test to verify new parameter name
- Kept internal Rust field name as max_completion_tokens for clarity
Impact:
- OpenAI Responses API calls now use correct parameter
- Compatible with current OpenAI API specification
- No breaking changes to internal code (field name unchanged)
Verified:
- MCP server builds successfully
- Serialization uses correct JSON key "max_output_tokens"
Reference:
https://platform.openai.com/docs/api-reference/responses/create1 parent e8fe23c commit 2b0c3bd
File tree
2 files changed
+6
-3
lines changed- crates/codegraph-ai/src
2 files changed
+6
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
480 | 480 | | |
481 | 481 | | |
482 | 482 | | |
483 | | - | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
484 | 487 | | |
485 | 488 | | |
486 | 489 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
357 | 357 | | |
358 | 358 | | |
359 | 359 | | |
360 | | - | |
| 360 | + | |
361 | 361 | | |
362 | 362 | | |
363 | 363 | | |
| |||
461 | 461 | | |
462 | 462 | | |
463 | 463 | | |
464 | | - | |
| 464 | + | |
465 | 465 | | |
466 | 466 | | |
467 | 467 | | |
0 commit comments