fix(chat): route OAuth backend through native provider#542
Open
thakrarsagar wants to merge 1 commit into
Open
Conversation
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.
Description
Fixes chat failures for the OAuth-backed LLM profile in the agentic client factory.
The provider registry already identifies this profile as a native OAuth backend, and the runtime provider factory routes it through the dedicated native provider. The agentic chat client factory missed that routing branch and fell through to a generic
AsyncOpenAIclient instead. With the Settings base URL set tohttps://chatgpt.com/backend-api, the Python backend attempted a generic chat-completions request and received an HTML browser challenge where JSON was expected.This change routes that backend through the existing OpenAI-style adapter backed by the native provider, matching the routing used by the general LLM runtime.
Related Issues
N/A (no existing issue found)
Module(s) Affected
agentsapiconfigcoreknowledgeloggingservicestoolsutilsweb(Frontend)docs(Documentation)scriptstests...Checklist
pre-commit run --all-filesand fixed any issues.Additional Notes
Root cause:
build_openai_client()only special-cased the Anthropic backend before constructing a generic OpenAI-compatible SDK client. Native OAuth-backed chat needs the existing native provider path instead.Files changed:
deeptutor/core/agentic/client.pytests/core/test_agentic_client_provider_kwargs.pyValidation:
uv run --with pytest --with pytest-asyncio pytest tests/core/test_agentic_client_provider_kwargs.py -q— 12 passeduv run --with pre-commit pre-commit run --files deeptutor/core/agentic/client.py tests/core/test_agentic_client_provider_kwargs.py— passed