-
Notifications
You must be signed in to change notification settings - Fork 33.6k
WS2 item 4: wire run_agent.py provider profile activation (incremental) #14515
Copy link
Copy link
Open
Labels
P3Low — cosmetic, nice to haveLow — cosmetic, nice to havecomp/agentCore agent loop, run_agent.py, prompt builderCore agent loop, run_agent.py, prompt builderprovider/deepseekDeepSeek APIDeepSeek APIprovider/kimiKimi / MoonshotKimi / Moonshotprovider/nousNous Research API (OAuth)Nous Research API (OAuth)provider/nvidiaNVIDIA NIMNVIDIA NIMprovider/openrouterOpenRouter aggregatorOpenRouter aggregatorprovider/qwenQwen / Alibaba Cloud (OAuth)Qwen / Alibaba Cloud (OAuth)type/featureNew feature or requestNew feature or request
Metadata
Metadata
Assignees
Labels
P3Low — cosmetic, nice to haveLow — cosmetic, nice to havecomp/agentCore agent loop, run_agent.py, prompt builderCore agent loop, run_agent.py, prompt builderprovider/deepseekDeepSeek APIDeepSeek APIprovider/kimiKimi / MoonshotKimi / Moonshotprovider/nousNous Research API (OAuth)Nous Research API (OAuth)provider/nvidiaNVIDIA NIMNVIDIA NIMprovider/openrouterOpenRouter aggregatorOpenRouter aggregatorprovider/qwenQwen / Alibaba Cloud (OAuth)Qwen / Alibaba Cloud (OAuth)type/featureNew feature or requestNew feature or request
Type
Fields
Give feedbackNo fields configured for issues without a type.
Problem
PR #14424 adds
providers/package with 8 provider profiles and a transport single-path (_build_kwargs_from_profile). The profiles are proven correct via 73 parity tests. However, wiring run_agent.py to activate profiles caused 50 test regressions because of a fundamental detection mismatch.The mismatch
Legacy detection: URL pattern matching
Profile resolution: Provider name matching
A user with
provider="custom"andbase_url="https://integrate.api.nvidia.com/v1"hits the NVIDIA path in legacy but gets NO profile. Conversely, tests that setprovider="openrouter"without a matching base_url now hit the profile path when they expected legacy.Missing params in profile path
The legacy chat_completions
_build_api_kwargscomputes these agent-level params that the profile path doesn't:anthropic_max_output— Claude max output for OpenRouter/Nous (calls_get_anthropic_max_output)qwen_session_metadata— Random UUID per callsupports_reasoning— Model-family-gated reasoning safety checkgithub_reasoning_extra— GitHub Models reasoning config_fixed_temperature_for_model— Temperature override from auxiliary_clientprovider_preferences— OpenRouter provider routing preferencesProposed approach
Wire profiles one provider at a time, simplest first:
default_max_tokens, zero missing params)Each wiring step: add the missing params to the profile, write an E2E test that calls
_build_api_kwargswith real agent state, verify identical output, then enable.Acceptance criteria
build_kwargsoutput to the legacy flag pathprovider="X"work correctly on the profile pathprovider="custom"with provider-specific base_url still hits legacy path (profile returns None)