calm-artist-7206
12/01/2025, 2:05 PMif conditionals; special cases are tightly coupling OH to the Saas, they are very error-prone (aka Linus roasted! this kind of thing has broken OH codebase before), and complicating the code when maybe we don't need that at all
• or, this is a special AH need, that is not supported/available for other users
â—¦ then folks can use a staging deployment script or similar, to set the values in env only for AH staging
â—¦ or, unlikely in this case, but possible in other cases, extend OH code with code in the Saas, implementing that special need.
â—¦ Either way, the code belongs in the Saas in this case, not in OpenHands really.
WDYT?
Cc: @millions-afternoon-47582 @straight-sundown-84319millions-afternoon-47582
12/01/2025, 2:21 PMLLM Advanced Settings view to set up our custom API key, base URL.
But the issue mentioned in the PR is related to the basic view only.
Reproduction steps:
1. In the SaaS environment (feature branch and staging), navigate to the LLM Basic Settings view. When selecting OpenHands as the provider, it is no longer possible to input the base URL via the UI in this basic view if the current provider is already set to OpenHands.
2. After clicking the Save Settings button in the LLM Basic Settings view, creating a new V1 conversation, and sending a prompt, the following error occurs:
3. The root cause is that, within our Software Agent SDK, when the current provider is set to OpenHands, the base_url is hard-coded to https://llm-proxy.app.all-hands.dev/. Please refer to the code snippet below for further details.
if model_val.startswith("openhands/"):
model_name = model_val.removeprefix("openhands/")
d["model"] = f"litellm_proxy/{model_name}"
# Set base_url (default to the app proxy when base_url is unset)
d["base_url"] = d.get("base_url", "https://llm-proxy.app.all-hands.dev/")
For this reason, when testing on the feature branch or staging environment, the feature/staging LiteLLM key is sent to the production URL, which results in the error described above.
I agree that there may be a more appropriate solution—such as updating the environment variable, adjusting the deployment scripts, or restoring the base URL input field in the Basic view.
However, asking the users to switch to the Advanced view will not resolve the root cause of the issue, based on the provided reproduction steps - the users are using the basic view.
cc @chilly-france-44439calm-artist-7206
12/01/2025, 2:24 PMmillions-afternoon-47582
12/01/2025, 2:27 PMmillions-afternoon-47582
12/01/2025, 2:29 PMcalm-artist-7206
12/01/2025, 2:30 PMmillions-afternoon-47582
12/01/2025, 2:32 PMcalm-artist-7206
12/01/2025, 2:32 PMHowever, asking the users to switch to the Advanced view will not resolve the root cause of the issue, based on the provided reproduction steps - the users are using the basic view.Are the users using the AH staging deployment? This seems like it's only AH folks, not users in general.
millions-afternoon-47582
12/01/2025, 2:37 PMAre the users using the AH staging deployment? This seems like it's only AH folks, not users in general.No, they are not using the OpenHands staging deployment. This is for internal testing. When Mahmoud uses the staging deployment and follows the reproduction steps above, he encounters the issue. The root cause is that we are hard-coding https://llm-proxy.app.all-hands.dev/ in our software-agent-sdk. As a result, the LiteLLM key generated in the staging environment does not work. Although he can switch to the Advanced view to work around the issue—and therefore is not fully blocked—the underlying problem remains. The purpose of the pull request was to resolve the issue observed when following the reproduction steps and to ensure that the Basic view functions correctly across all OpenHands environments. However, since my current solution does not align with our best practices, I will look for an alternative approach. Thank you! thankyou
chilly-france-44439
12/01/2025, 2:43 PMOPENHANDS_PROVIDER_BASE_URL and default it to llm-proxy.app.all-hands.dev/chilly-france-44439
12/01/2025, 2:44 PMcalm-artist-7206
12/01/2025, 2:45 PMcalm-artist-7206
12/01/2025, 2:45 PMmillions-afternoon-47582
12/01/2025, 2:48 PMcalm-artist-7206
12/01/2025, 3:02 PMmillions-afternoon-47582
12/01/2025, 3:07 PMcalm-artist-7206
12/01/2025, 3:08 PM/openhands, the SDK shouldn't completely make that impossible - that was a bug IMHO. Basically, as you said Hiep Le, in the open source version you can enter base URL for /openhands , but the SDK without the fix was overriding user choicecalm-artist-7206
12/01/2025, 3:12 PM/openhands proxy, and it is available for everyone. As far as I can tell, it is possible to use it even without OH? Not sure that's intended, now that I think of it... but it seems possible.
What do you think about asking LiteLLM to do the re-routing to the AH app proxy in liteLLM? Then we wouldn't need any special case even for prod, in the SDK. 🤔chilly-france-44439
12/01/2025, 3:45 PMWhat do you think about asking LiteLLM to do the re-routing to the AH app proxy in liteLLM? Then we wouldn't need any special case even for prod, in the SDKDo you mean automatically route to staging proxy on app url? i don't think that is possible w/o modify litellm itself 🤔
chilly-france-44439
12/01/2025, 3:46 PMWith the SDK fix, if we access the staging environment and use the Basic viewActually i wonder if we can do this in the frontend? I vaguely remember we already sent a request to the backend to get OH API Key everytime user switches to "OpenHands" provider?
chilly-france-44439
12/01/2025, 3:46 PMcalm-artist-7206
12/01/2025, 4:03 PMDo you mean automatically route to staging proxy on app url? i don't think that is possible w/o modify litellm itselfNo, sorry. I mean: • get LiteLLM project to register
openhands/ provider, just it has 100+ providers, like `/openrouter`` and so on
• for the app URL
• yes, it is a litellm addition, is there a reason why not?chilly-france-44439
12/01/2025, 4:10 PMcalm-artist-7206
12/01/2025, 4:12 PM/openhands in other ways? I mean... they already can...chilly-france-44439
12/01/2025, 4:45 PMDo you have strong feelings about people to not useYeah I mean technically, we encourage ppl to use OH provider only on OpenHands application, and they are supposed not to use it for other stuff, though we don't technically have a way to prevent that from happening like you said.in other ways/openhands
calm-artist-7206
12/01/2025, 5:02 PMapp case from the SDK, but that case is not too bad. 😅)
Back to the alternatives for staging, I think FE-only is an alternative solution, if it's possible.
Additionally, I suggest to consider that maybe you could just let it be routed to app in Basic view. Is that very bad? It does literally test that it's routed where it should. 😅 Is there really a need to re-route to a different litellm proxy?