Commit 09b94b1
committed
Merge reasoning protocol handling into PR 107
Preserve the existing support_reasoning_content branch work while adding the protocol-level reasoning_content gate and verification surface.
Constraint: Keep PR 107 branch history intact and avoid force-pushing over existing work.
Rejected: Replace support_reasoning_content with codex/82508048-reasoning-content | would discard the existing LangChain provider change.
Confidence: high
Scope-risk: moderate
Directive: Continue to gate reasoning exposure from MODEL_PARAMETER_RULES.thinking, not model metadata.
Tested: uv run --extra server ruff check agentrun/utils/reasoning.py agentrun/server/model.py agentrun/server/invoker.py agentrun/server/openai_protocol.py agentrun/server/agui_protocol.py agentrun/integration/langchain/model_adapter.py scripts/smoke_reasoning_protocol.py tests/unittests/server/test_reasoning.py tests/unittests/server/test_openai_protocol.py tests/unittests/server/test_agui_protocol.py
Tested: uv run --extra server pytest tests/unittests/server -q
Tested: uv run --extra server --extra langchain pytest tests/unittests/integration/langchain tests/unittests/conversation_service/test_langchain_adapter.py -q
Tested: MODEL_PARAMETER_RULES='{"thinking": true}' AGENTRUN_SMOKE_INSECURE_SSL=true uv run --extra server python scripts/smoke_reasoning_protocol.py --env-file /Users/congxiao/workspace/agent-quickstart-langchain/.env --model qwen3-235b-a22b-thinking-2507 --protocol both --response-mode stream --expect-reasoning --expect-content
Tested: MODEL_PARAMETER_RULES='{"thinking": false}' AGENTRUN_SMOKE_INSECURE_SSL=true uv run --extra server python scripts/smoke_reasoning_protocol.py --env-file /Users/congxiao/workspace/agent-quickstart-langchain/.env --model qwen3-235b-a22b-thinking-2507 --protocol both --response-mode stream --expect-no-reasoning --expect-content
Signed-off-by: congxiao.wxx <congxiao.wxx@alibaba-inc.com>
Change-Id: I91a2e9f01eae198c297daf1e8d1819f4f8cf53d610 files changed
Lines changed: 1012 additions & 11 deletions
File tree
- agentrun
- integration/langchain
- server
- utils
- scripts
- tests/unittests/server
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | | - | |
| 5 | + | |
8 | 6 | | |
9 | 7 | | |
10 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
33 | 38 | | |
34 | 39 | | |
35 | 40 | | |
| |||
60 | 65 | | |
61 | 66 | | |
62 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
63 | 76 | | |
64 | 77 | | |
65 | 78 | | |
| |||
72 | 85 | | |
73 | 86 | | |
74 | 87 | | |
| 88 | + | |
75 | 89 | | |
76 | 90 | | |
77 | 91 | | |
| |||
121 | 135 | | |
122 | 136 | | |
123 | 137 | | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
124 | 175 | | |
125 | 176 | | |
126 | 177 | | |
| |||
376 | 427 | | |
377 | 428 | | |
378 | 429 | | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
379 | 434 | | |
380 | 435 | | |
381 | 436 | | |
| |||
399 | 454 | | |
400 | 455 | | |
401 | 456 | | |
402 | | - | |
403 | | - | |
404 | 457 | | |
405 | 458 | | |
406 | 459 | | |
| |||
413 | 466 | | |
414 | 467 | | |
415 | 468 | | |
| 469 | + | |
| 470 | + | |
416 | 471 | | |
417 | 472 | | |
418 | 473 | | |
| |||
422 | 477 | | |
423 | 478 | | |
424 | 479 | | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
425 | 501 | | |
426 | 502 | | |
427 | 503 | | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
428 | 520 | | |
429 | 521 | | |
430 | 522 | | |
| |||
435 | 527 | | |
436 | 528 | | |
437 | 529 | | |
438 | | - | |
| 530 | + | |
439 | 531 | | |
440 | 532 | | |
441 | 533 | | |
442 | 534 | | |
443 | 535 | | |
444 | | - | |
| 536 | + | |
445 | 537 | | |
446 | 538 | | |
447 | 539 | | |
| |||
455 | 547 | | |
456 | 548 | | |
457 | 549 | | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
458 | 553 | | |
459 | 554 | | |
460 | 555 | | |
| |||
491 | 586 | | |
492 | 587 | | |
493 | 588 | | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
494 | 592 | | |
495 | 593 | | |
496 | 594 | | |
| |||
541 | 639 | | |
542 | 640 | | |
543 | 641 | | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
544 | 645 | | |
545 | 646 | | |
546 | 647 | | |
| |||
601 | 702 | | |
602 | 703 | | |
603 | 704 | | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
604 | 708 | | |
605 | 709 | | |
606 | 710 | | |
| |||
767 | 871 | | |
768 | 872 | | |
769 | 873 | | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
770 | 897 | | |
771 | 898 | | |
772 | 899 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
124 | 125 | | |
125 | 126 | | |
126 | 127 | | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
127 | 131 | | |
128 | 132 | | |
129 | 133 | | |
| |||
238 | 242 | | |
239 | 243 | | |
240 | 244 | | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
241 | 250 | | |
242 | 251 | | |
243 | 252 | | |
| |||
267 | 276 | | |
268 | 277 | | |
269 | 278 | | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
270 | 282 | | |
271 | 283 | | |
272 | 284 | | |
| |||
307 | 319 | | |
308 | 320 | | |
309 | 321 | | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
| |||
91 | 90 | | |
92 | 91 | | |
93 | 92 | | |
| 93 | + | |
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| 128 | + | |
128 | 129 | | |
129 | 130 | | |
130 | 131 | | |
| |||
0 commit comments