OpenHands icon indicating copy to clipboard operation
OpenHands copied to clipboard

[Bug]: Base URL does not reset to empty after setting it once

Open mamoodi opened this issue 1 year ago • 4 comments

Is there an existing issue for the same bug?

  • [X] I have checked the troubleshooting document at https://docs.all-hands.dev/modules/usage/troubleshooting
  • [X] I have checked the existing issues.

Describe the bug

The Base URL does not get set to empty if you have set it once

Current OpenHands version

main

Installation and Configuration

make build
make run

Model and Agent

N/A

Operating System

MacOS

Reproduction Steps

  1. In the Settings UI, toggle Advanced Options and set Base URL to "https://test.com"
  2. Set some random custom_model "openai/gpt-4o"
  3. If you print the logs for Base URL (I have additional logging PR up which you can use when merged), you will see that base_url is set correctly
  4. Now remove Base URL and press Save

You will see that Base URL is still set to "https://test.com" when it gets passed into the AgentSession (But appears empty in the UI)

Logs, Errors, Screenshots, and Additional Context

No response

mamoodi avatar Sep 23 '24 20:09 mamoodi

Additionally even if you disable Advanced Options, the Base URL will still be set which is incorrect.

mamoodi avatar Sep 23 '24 20:09 mamoodi

I just ran in to this exact same problem, really annoying. Maybe we need to clear the browser cache. @amanape it'd be great if you can take a quick look, I imagine it's pretty simple to fix.

neubig avatar Sep 23 '24 20:09 neubig

Are you clearing the base URL mid session?

amanape avatar Sep 24 '24 08:09 amanape

@amanape what do you mean mid session? I launch OpenHands. Open Settings. Make the modifications.

mamoodi avatar Sep 24 '24 12:09 mamoodi

@mamoodi After a little investigation, the initial settings is sent as soon as the session starts. Unless you change the settings and the RESTART or reinitialize the session/OpenHands, the changes will not be reflected.

Instead of taking care of this now, I'll focus on it after #3603 is merged (since it introduces some changes that may solve or require a different approach to solve this problem). It should be ready for your thorough review soon

amanape avatar Sep 24 '24 15:09 amanape

This is not actually fixed--I just confirmed on main. Will take a look

rbren avatar Sep 24 '24 15:09 rbren

Confirmed this works. Thanks for fixing!

mamoodi avatar Sep 24 '24 18:09 mamoodi