Forward GPT reasoning effort through LiteLLM - #112
Merged
waple0820 merged 1 commit intoJul 27, 2026
Conversation
waple0820
approved these changes
Jul 27, 2026
waple0820
marked this pull request as ready for review
July 27, 2026 04:08
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix GPT reasoning-effort requests through the LiteLLM 1.93 gateway.
The browser-use adapter already forwarded
reasoning_effortand registered customgateway model aliases as reasoning models. However, LiteLLM rejected the request
before forwarding it:
LiteLLM's documented per-request escape hatch is
allowed_openai_params. This change:allowed_openai_params: [reasoning_effort]to the GPT-5.6 Sol example;_create_llmbuilds an OpenAI Chat Completions model;extra_bodyon every request, becausethe pinned browser-use
ChatOpenAIdoes not exposeextra_bodyas aconstructor option;
client.chat.completions.create.Reference: LiteLLM parameter handling.
Contribution type
Reproduction or validation
Tests and static checks:
Focused real gateway smoke through the changed
_create_llmandainvokepath:Observed:
This validation deliberately exercises the actual model construction, browser-use
request serialization, LiteLLM gateway, and upstream response without launching a
browser task; no credentials or unredacted request logs are included.
Result artifacts
Not applicable.
Self-review (mandatory)
See Mandatory Self-Review.
PRs with unticked boxes are returned without review. / 以下勾选项未完成的 PR 会被直接打回。
/ 我逐行读完了自己的 diff,每处改动都是有意为之
no hardcoded config, imports at top) / diff 符合 CONTRIBUTING.md 的硬性红线
/code-reviewand fixed or justified every finding/ 本地跑过
/code-review,findings 已全部修复或说明理由uv run pytest tests/passes and behavior changes have targeted tests/ 测试通过,行为变更配了针对性测试
touch any agent runtime path / 涉及 agent 运行路径的改动已附真实 smoke run 证据,或本
PR 不涉及 agent 运行路径
Notes for reviewers
The passthrough setting is intentionally limited to
OPENAIChat Completionsmodels. Azure SDK models default to the Responses path in the pinned browser-use
version, so advertising this Chat Completions wrapper there would be misleading.