Commit c69a2c3
committed
Fix remaining Medium issues from second subagent review pass
- strictModeEnabled: false for MCP tool registration — external MCP
schemas are not guaranteed to satisfy OpenAI strict-mode constraints
(all properties required, additionalProperties: false everywhere).
A single non-conforming schema with strictModeEnabled: true would
cause a 400 at registration time for ALL tools in the request.
- Guard ParseToolArguments in non-streaming path — JsonException on
malformed model-generated arguments would previously bubble up as
a 500. Now caught identically to the streaming path: logs warning
and sends an error FunctionCallOutputResponseItem so the model can
recover without aborting the loop.
- Guard currentLegResponseId null before tool-call continuation —
if the API never emits StreamingResponseCreatedUpdate, proceeding
with PreviousResponseId = null causes a confusing 400 from the API.
Now throws InvalidOperationException with a diagnostic message.
- Log original ConversationContextLimitExceededException in mid-stream
handler — previously wrapped in a new InvalidOperationException,
losing the stack trace, PreviousResponseId, and inner exception.1 parent 97db852 commit c69a2c3
2 files changed
Lines changed: 28 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
235 | 242 | | |
236 | 243 | | |
237 | 244 | | |
| |||
387 | 394 | | |
388 | 395 | | |
389 | 396 | | |
390 | | - | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
391 | 402 | | |
392 | 403 | | |
393 | 404 | | |
| |||
466 | 477 | | |
467 | 478 | | |
468 | 479 | | |
469 | | - | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
470 | 494 | | |
471 | 495 | | |
472 | 496 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | | - | |
| 146 | + | |
147 | 147 | | |
148 | | - | |
| 148 | + | |
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
| |||
0 commit comments