WIP: Use async await

The changes speak for themselves. Let's wait until reqwest gets 0.10 released until we merge this. The integration tests also need fixing.
In a follow-up PR I will optimize the usage of reqwest's HTTP client.

I think running async stuff in drop is UB (tests fail with SIGILL which indicates UB). I think we need to wrap the test functions manually for teardown. For example like this: https://medium.com/@ericdreichert/test-setup-and-teardown-in-rust-without-a-framework-ba32d97aa5ab

Thanks for this PR!
My test harness was based on the post you linked. Cleanup might be omittable but will create artefacts while locally developing. Ci will create a new influxdb each run.

I think by now this PR is best reviewed commit-by-commit. I added a commit that indicates the minimum required rust version. Tests still need fixing.

I think the tests are fine now. The failure probably occurs because Travis does not expose secrets to PRs to avoid leaking them to untrusted code. Let's wait until reqwest makes the next release. Then I'll update this PR and we can merge this to see if the tests are truly okay.

Sorry, for noting just now, there's already a better test harness used in #23: https://github.com/Empty2k12/influxdb-rust/pull/23/files#diff-16b1336c25d7d5d15e6e55f3e72fef07R35-R47
Is yours compatible, so I can easily fix the other PR?

That one is clearly more concise, but currently error prone. It is very important to catch unwinds in test harnesses, so that the teardown is still executed even when the tests panic (and thus fail).
Since all the cleanups do is create and delete tables, the one from this PR can be adapted easily. My suggestion: keep the one from this PR, because it integrates better with modern tokio (no get_runtime, for example, test functions can use async / await freely), but update it to reduce repetition.

Great, I appreciate your work on this PR. Once you update reqwest to your desired version, I will review and merge this PR.

If you're fine with not-releasing this library for a while we can also do the merge now and wait for the new reqwest release in-tree. Then we have time to update the other PR.

Or you merge the other PR first, we fix the test harness, and we adapt this one.

reqwest 0.10.0 was just released (4hrs ago) with async/await support. Would be great if this could be wrapped up :)

Thanks for the heads-up! I‘ll be doing the adoption in the first few days of next year.

Great, thanks! And a happy new year :)On 30 Dec 2019 23:55, Moritz Gunz<EMAIL_ADDRESS>wrote:Thanks for the heads-up! I‘ll be doing the adoption in the first few days of next year.
—You are receiving this because you commented.Reply to this email directly, view it on GitHub, or unsubscribe.

@Empty2k12 reqwest has been updated. Please review. :)

test test_wrong_authed_write_and_read ... FAILED

@Empty2k12 Tests green! Please review.


resigtration form not working as expected - possible reasons?

I am at the end of chapter 5 but got an issue when I click the 'Register' button:
http://<IP_ADDRESS>/" method="post?csrf_token=IjQzYmU3ZmRmMDc1ZGZkMmI5MTA3NjcxODk4Zjc3NzJlY2QzMjQxYzIi.XNnA3A.sxpc2hZpZ7z7zO7DU8171Q-TfT8&username=s&email=s%40gmail.com&password=sss&password2=sss&submit=Register
The webpage said:
"Not Found
The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again."
Could you please kindly indicate a few possible reasons for this error? Thanks a lot!

I put this on stackoverflow and got the solution:
https://stackoverflow.com/questions/56118443/flask-404-eror-is-this-related-to-crsf-token/56119770#56119770


Add support for secondary options such as page_size and timeout

Currently gem only has support for statement options such as LIMIT and ORDER BY in the select method in queries.rb. It should also have support for secondary options such as timeout and page_size. Also execute method needs to have a splat operator so user can pass in secondary options after the selection string.
http://datastax.github.io/ruby-driver/api/session/#execute_async-instance_method

I can add the PR for this but wasn't sure which way to add this support:

Have the user pass in another hash within the options hash to the select method called ":secondary_options" and pass in both the query string and secondary options hash to the execute method.
Have  logic within the select method to recognize if any of the keys getting passed into the options hash are secondary options and create a new hash out of them before calling the execute method.

I ended up adding support for both options listed above (user can pass in secondary options using a secondary_options hash or they can pass in secondary options directly)


add scratchpad interface

In GitLab by @perarnau on Mar 20, 2018, 13:52
A scratchpad is the use of one area as the explicitly managed cache of another. The pulling and pushing of data into a stratchpad should be done by a dma. The API should support:

[x] pulling data into the scratchpad
[ ] acquiring a free region
[x] releasing a region
[x] pushing data out of the scratchpad

We still need to figure out how tilings are going to fit into this.

In GitLab by @perarnau on Mar 28, 2018, 10:54
We still need thread safety and acquire/release, before we're done here.
By Swann Perarnau on 2018-03-28T15:54:10 (imported from GitLab project)

In GitLab by @perarnau on Mar 26, 2018, 14:41
marked the task pulling data into the scratchpad as completed
By Swann Perarnau on 2018-03-26T19:41:42 (imported from GitLab project)

In GitLab by @perarnau on Mar 26, 2018, 14:41
marked the task pushing data out of the scratchpad as completed
By Swann Perarnau on 2018-03-26T19:41:43 (imported from GitLab project)

In GitLab by @perarnau on Mar 26, 2018, 14:38
mentioned in merge request !5
By Swann Perarnau on 2018-03-26T19:38:43 (imported from GitLab project)

In GitLab by @perarnau on Mar 28, 2018, 10:53
mentioned in merge request !7
By Swann Perarnau on 2018-03-28T15:53:02 (imported from GitLab project)

In GitLab by @perarnau on Mar 29, 2018, 09:55
mentioned in merge request !9
By Swann Perarnau on 2018-03-29T14:55:39 (imported from GitLab project)

In GitLab by @perarnau on Mar 30, 2018, 15:46
mentioned in merge request !11
By Swann Perarnau on 2018-03-30T20:46:59 (imported from GitLab project)

In GitLab by @perarnau on Mar 30, 2018, 15:47
marked the task releasing a region as completed
By Swann Perarnau on 2018-03-30T20:47:10 (imported from GitLab project)

In GitLab by @perarnau on Mar 30, 2018, 15:48
closed
By Swann Perarnau on 2018-03-30T20:48:22 (imported from GitLab project)

In GitLab by @perarnau on Mar 26, 2018, 14:41
!5 completed par of it.
By Swann Perarnau on 2018-03-26T19:41:57 (imported from GitLab project)

In GitLab by @perarnau on Mar 30, 2018, 15:48
As a first release, I believe the scratchpad is okay for now. We'll add/improve with new issues once we start benchmarking things more thoroughly.
By Swann Perarnau on 2018-03-30T20:48:21 (imported from GitLab project)


Fixed: lib/tasks/seed yml files type

got some errors while composing docker images.

Hello @matass  you need to render the configuration before using bin/init_config


Refresh taxonomies only is the only file has changed

We currently refresh every 24 hours:
https://github.com/openfoodfacts/openfoodfacts-androidapp/blob/585b4561869360c73b22cc4b95edcb1e69628284/app/src/main/java/openfoodfacts/github/scrachx/openfood/views/splash/SplashPresenter.java#L22
We should only refresh if 'If-Modified-Since" is sent back
https://android.jlelse.eu/reducing-your-networking-footprint-with-okhttp-etags-and-if-modified-since-b598b8dd81a1
Clarify the loading screen. During taxonomy loading, display "Initialisation" instead of "Loading"

@teolemon I tried using 304 NOT MODIFIED status, i.e every time when the app opens, I will make a server call, and if the server responds with 304 NOT MODIFIED status, I am not saving the data. But making call to the server for checking the status itself takes considerable time (just saving time to the database is reduced). So, doing this everytime the app opens won't be a good idea.
One better approach would be to use a refresh-period(~6-7 days) on top of If-Modified-Since approach.
What do you think?

should be changed now as we can check the last modified date

@deniger I'm assuming it's fixed now. Closing


Asynchronous chunk loading

Can't wait for this! :)

No longer a target of this project. Will be included in nallar/TickThreading.


[Bug]: Facing many errors preventing the use of the tool.

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.

Running OpenHands as root
INFO:     Started server process [10]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://<IP_ADDRESS>:3000 (Press CTRL+C to quit)
INFO:     <IP_ADDRESS>:39028 - "GET / HTTP/1.1" 200 OK
INFO:     <IP_ADDRESS>:39030 - "GET /assets/index--zaQvvCW.css HTTP/1.1" 200 OK
INFO:     <IP_ADDRESS>:39028 - "GET /assets/index-DOvY1mIk.js HTTP/1.1" 200 OK
INFO:     <IP_ADDRESS>:39030 - "GET /locales/en/translation.json HTTP/1.1" 200 OK
INFO:     <IP_ADDRESS>:39028 - "GET /locales/en-US/translation.json HTTP/1.1" 404 Not Found
INFO:     <IP_ADDRESS>:39028 - "GET /favicon-32x32.png HTTP/1.1" 200 OK
INFO:     <IP_ADDRESS>:39028 - "GET /api/options/models HTTP/1.1" 200 OK
INFO:     <IP_ADDRESS>:39028 - "GET /api/options/agents HTTP/1.1" 200 OK
INFO:     <IP_ADDRESS>:39028 - "GET /api/options/security-analyzers HTTP/1.1" 200 OK
INFO:     ('<IP_ADDRESS>', 60714) - "WebSocket /ws" [accepted]
INFO:     connection open
22:33:53 - openhands:WARNING: llm.py:85 - Could not get model info for openrouter/nousresearch/hermes-3-llama-3.1-405b:
This model isn't mapped yet. model=openrouter/nousresearch/hermes-3-llama-3.1-405b, custom_llm_provider=openrouter. Add it here - https://github.com/BerriAI/litellm/blob/main/model_prices_and_context_window.json.
22:33:53 - openhands:INFO: agent.py:79 - Using security analyzer:
22:33:53 - openhands:INFO: agent.py:90 - Initializing runtime `eventstream` now...
22:33:53 - openhands:INFO: runtime.py:183 - Starting container with image: ghcr.io/all-hands-ai/runtime:0.9.2-nikolaik and name: openhands-sandbox-0093bc4c-b947-4077-bd15-7b807c7e05f3_53dbc988-3fe9-49ee-bdf4-f440e3c6ce91
22:33:53 - openhands:INFO: runtime.py:204 - Mount dir: /workspace
22:33:53 - openhands:ERROR: runtime.py:82 - Error in stream_logs: 'LogBuffer' object has no attribute '_stop_event'
22:33:53 - openhands:INFO: runtime.py:238 - Container started. Server url: http://host.docker.internal:40683
22:33:53 - openhands:INFO: runtime.py:157 - Container initialized with plugins: ['agent_skills', 'jupyter']
22:33:53 - openhands:INFO: runtime.py:160 - Container initialized with env vars: None
22:33:53 - openhands:INFO: agent.py:116 - Agents: {'agent': AgentConfig(micro_agent_name=None, memory_enabled=False, memory_max_threads=2, llm_config=None)}
22:33:53 - openhands:INFO: agent.py:117 - Creating agent CodeActAgent using LLM openrouter/nousresearch/hermes-3-llama-3.1-405b
22:33:53 - openhands:ERROR: state.py:118 - Failed to restore state from session: sessions/0093bc4c-b947-4077-bd15-7b807c7e05f3/agent_state.pkl
22:33:53 - openhands:INFO: agent.py:139 - Error restoring state: sessions/0093bc4c-b947-4077-bd15-7b807c7e05f3/agent_state.pkl
22:33:53 - openhands:INFO: agent.py:140 - Agent controller initialized.
22:33:53 - openhands:INFO: session.py:139 - Server event
22:33:53 - openhands:INFO: agent_controller.py:150 - [Agent Controller 0093bc4c-b947-4077-bd15-7b807c7e05f3] Starting step loop...
22:33:53 - openhands:INFO: session.py:139 - Server event
INFO:     <IP_ADDRESS>:60718 - "GET /api/list-files HTTP/1.1" 500 Internal Server Error
ERROR:    Exception in ASGI application

--- THE OTHER PARTS BELOW ---
Current OpenHands version
0.9.2

Installation and Configuration
above

Model and Agent
No response
Operating System
No response
Reproduction Steps
No response
Logs, Errors, Screenshots, and Additional Context
No response

Traceback (most recent call last):
  File "/app/.venv/lib/python3.12/site-packages/urllib3/connection.py", line 196, in _new_conn
    sock = connection.create_connection(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/urllib3/util/connection.py", line 85, in create_connection
    raise err
  File "/app/.venv/lib/python3.12/site-packages/urllib3/util/connection.py", line 73, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/app/.venv/lib/python3.12/site-packages/urllib3/connectionpool.py", line 789, in urlopen
    response = self._make_request(
               ^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/urllib3/connectionpool.py", line 495, in _make_request
    conn.request(
  File "/app/.venv/lib/python3.12/site-packages/urllib3/connection.py", line 398, in request
    self.endheaders()
  File "/usr/local/lib/python3.12/http/client.py", line 1331, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.12/http/client.py", line 1091, in _send_output
    self.send(msg)
  File "/usr/local/lib/python3.12/http/client.py", line 1035, in send
    self.connect()
  File "/app/.venv/lib/python3.12/site-packages/urllib3/connection.py", line 236, in connect
    self.sock = self._new_conn()
                ^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/urllib3/connection.py", line 211, in _new_conn
    raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f0dad136990>: Failed to establish a new connection: [Errno 111] Connection refused

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/app/.venv/lib/python3.12/site-packages/requests/adapters.py", line 667, in send
    resp = conn.urlopen(
           ^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/urllib3/connectionpool.py", line 843, in urlopen
    retries = retries.increment(
              ^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/urllib3/util/retry.py", line 519, in increment
    raise MaxRetryError(_pool, url, reason) from reason  # type: ignore[arg-type]
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='host.docker.internal', port=40683): Max retries exceeded with url: /alive (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f0dad136990>: Failed to establish a new connection: [Errno 111] Connection refused'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/app/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 478, in __call__
    result = fn(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^
  File "/app/openhands/runtime/client/runtime.py", line 297, in _wait_until_alive
    response = self.session.get(f'{self.api_url}/alive')
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/requests/sessions.py", line 602, in get
    return self.request("GET", url, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/requests/sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/requests/adapters.py", line 700, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='host.docker.internal', port=40683): Max retries exceeded with url: /alive (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f0dad136990>: Failed to establish a new connection: [Errno 111] Connection refused'))

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/app/.venv/lib/python3.12/site-packages/uvicorn/protocols/http/h11_impl.py", line 406, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/uvicorn/middleware/proxy_headers.py", line 70, in __call__
    return await self.app(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/fastapi/applications.py", line 1054, in __call__
    await super().__call__(scope, receive, send)
  File "/app/.venv/lib/python3.12/site-packages/starlette/applications.py", line 123, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/app/.venv/lib/python3.12/site-packages/starlette/middleware/errors.py", line 186, in __call__
    raise exc
  File "/app/.venv/lib/python3.12/site-packages/starlette/middleware/errors.py", line 164, in __call__
    await self.app(scope, receive, _send)
  File "/app/.venv/lib/python3.12/site-packages/starlette/middleware/base.py", line 189, in __call__
    with collapse_excgroups():
  File "/usr/local/lib/python3.12/contextlib.py", line 158, in __exit__
    self.gen.throw(value)
  File "/app/.venv/lib/python3.12/site-packages/starlette/_utils.py", line 89, in collapse_excgroups
    raise exc
  File "/app/.venv/lib/python3.12/site-packages/starlette/middleware/base.py", line 191, in __call__
    response = await self.dispatch_func(request, call_next)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/openhands/server/listen.py", line 197, in attach_session
    response = await call_next(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/starlette/middleware/base.py", line 165, in call_next
    raise app_exc
  File "/app/.venv/lib/python3.12/site-packages/starlette/middleware/base.py", line 151, in coro
    await self.app(scope, receive_or_disconnect, send_no_error)
  File "/app/.venv/lib/python3.12/site-packages/starlette/middleware/cors.py", line 85, in __call__
    await self.app(scope, receive, send)
  File "/app/.venv/lib/python3.12/site-packages/starlette/middleware/exceptions.py", line 65, in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
  File "/app/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
    raise exc
  File "/app/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    await app(scope, receive, sender)
  File "/app/.venv/lib/python3.12/site-packages/starlette/routing.py", line 754, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/app/.venv/lib/python3.12/site-packages/starlette/routing.py", line 774, in app
    await route.handle(scope, receive, send)
  File "/app/.venv/lib/python3.12/site-packages/starlette/routing.py", line 295, in handle
    await self.app(scope, receive, send)
  File "/app/.venv/lib/python3.12/site-packages/starlette/routing.py", line 77, in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
  File "/app/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
    raise exc
  File "/app/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    await app(scope, receive, sender)
  File "/app/.venv/lib/python3.12/site-packages/starlette/routing.py", line 74, in app
    response = await f(request)
               ^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/fastapi/routing.py", line 297, in app
    raw_response = await run_endpoint_function(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/fastapi/routing.py", line 210, in run_endpoint_function
    return await dependant.call(**values)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/openhands/server/listen.py", line 409, in list_files
    file_list = runtime.list_files(path)
                ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/openhands/runtime/client/runtime.py", line 463, in list_files
    self._wait_until_alive()
  File "/app/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 336, in wrapped_f
    return copy(f, *args, **kw)
           ^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 475, in __call__
    do = self.iter(retry_state=retry_state)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 376, in iter
    result = action(retry_state)
             ^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 419, in exc_check
    raise retry_exc from fut.exception()
tenacity.RetryError: RetryError[<Future at 0x7f0dad136a20 state=finished raised ConnectionError>]
22:40:51 - USER_ACTION
**MessageAction** (source=EventSource.USER)
CONTENT: hi
22:40:51 - openhands:INFO: session.py:139 - Server event

==============
CodeActAgent LEVEL 0 LOCAL STEP 0 GLOBAL STEP 0

Give Feedback / Get Help: https://github.com/BerriAI/litellm/issues/new
LiteLLM.Info: If you need to debug this error, use `litellm.set_verbose=True'.

Provider List: https://docs.litellm.ai/docs/providers

22:47:50 - openhands:ERROR: llm.py:129 - litellm.RateLimitError: RateLimitError: OpenrouterException - . Attempt #1 | You can customize these settings in the configuration.

Give Feedback / Get Help: https://github.com/BerriAI/litellm/issues/new
LiteLLM.Info: If you need to debug this error, use `litellm.set_verbose=True'.

Provider List: https://docs.litellm.ai/docs/providers

22:47:51 - openhands:ERROR: llm.py:129 - litellm.RateLimitError: RateLimitError: OpenrouterException - . Attempt #2 | You can customize these settings in the configuration.

Give Feedback / Get Help: https://github.com/BerriAI/litellm/issues/new
LiteLLM.Info: If you need to debug this error, use `litellm.set_verbose=True'.

Provider List: https://docs.litellm.ai/docs/providers

22:47:53 - openhands:ERROR: llm.py:129 - litellm.RateLimitError: RateLimitError: OpenrouterException - . Attempt #3 | You can customize these settings in the configuration.

Give Feedback / Get Help: https://github.com/BerriAI/litellm/issues/new
LiteLLM.Info: If you need to debug this error, use `litellm.set_verbose=True'.

Provider List: https://docs.litellm.ai/docs/providers

22:47:56 - openhands:ERROR: llm.py:129 - litellm.RateLimitError: RateLimitError: OpenrouterException - . Attempt #4 | You can customize these settings in the configuration.
22:48:06 - openhands:WARNING: llm.py:548 - Cost calculation not supported for this model.
22:48:06 - ACTION
**MessageAction** (source=EventSource.AGENT)
CONTENT: Hello! How can I assist you today?
INFO:     <IP_ADDRESS>:56270 - "GET /api/list-files HTTP/1.1" 500 Internal Server Error
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/app/.venv/lib/python3.12/site-packages/urllib3/connection.py", line 196, in _new_conn
    sock = connection.create_connection(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/urllib3/util/connection.py", line 85, in create_connection
    raise err
  File "/app/.venv/lib/python3.12/site-packages/urllib3/util/connection.py", line 73, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/app/.venv/lib/python3.12/site-packages/urllib3/connectionpool.py", line 789, in urlopen
    response = self._make_request(
               ^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/urllib3/connectionpool.py", line 495, in _make_request
    conn.request(
  File "/app/.venv/lib/python3.12/site-packages/urllib3/connection.py", line 398, in request
    self.endheaders()
  File "/usr/local/lib/python3.12/http/client.py", line 1331, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.12/http/client.py", line 1091, in _send_output
    self.send(msg)
  File "/usr/local/lib/python3.12/http/client.py", line 1035, in send
    self.connect()
  File "/app/.venv/lib/python3.12/site-packages/urllib3/connection.py", line 236, in connect
    self.sock = self._new_conn()
                ^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/urllib3/connection.py", line 211, in _new_conn
    raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f0dad175ca0>: Failed to establish a new connection: [Errno 111] Connection refused

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/app/.venv/lib/python3.12/site-packages/requests/adapters.py", line 667, in send
    resp = conn.urlopen(
           ^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/urllib3/connectionpool.py", line 843, in urlopen
    retries = retries.increment(
              ^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/urllib3/util/retry.py", line 519, in increment
    raise MaxRetryError(_pool, url, reason) from reason  # type: ignore[arg-type]
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='host.docker.internal', port=40683): Max retries exceeded with url: /alive (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f0dad175ca0>: Failed to establish a new connection: [Errno 111] Connection refused'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/app/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 478, in __call__
    result = fn(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^
  File "/app/openhands/runtime/client/runtime.py", line 297, in _wait_until_alive
    response = self.session.get(f'{self.api_url}/alive')
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/requests/sessions.py", line 602, in get
    return self.request("GET", url, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/requests/sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/requests/adapters.py", line 700, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='host.docker.internal', port=40683): Max retries exceeded with url: /alive (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f0dad175ca0>: Failed to establish a new connection: [Errno 111] Connection refused'))

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/app/.venv/lib/python3.12/site-packages/uvicorn/protocols/http/h11_impl.py", line 406, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/uvicorn/middleware/proxy_headers.py", line 70, in __call__
    return await self.app(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/fastapi/applications.py", line 1054, in __call__
    await super().__call__(scope, receive, send)
  File "/app/.venv/lib/python3.12/site-packages/starlette/applications.py", line 123, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/app/.venv/lib/python3.12/site-packages/starlette/middleware/errors.py", line 186, in __call__
    raise exc
  File "/app/.venv/lib/python3.12/site-packages/starlette/middleware/errors.py", line 164, in __call__
    await self.app(scope, receive, _send)
  File "/app/.venv/lib/python3.12/site-packages/starlette/middleware/base.py", line 189, in __call__
    with collapse_excgroups():
  File "/usr/local/lib/python3.12/contextlib.py", line 158, in __exit__
    self.gen.throw(value)
  File "/app/.venv/lib/python3.12/site-packages/starlette/_utils.py", line 89, in collapse_excgroups
    raise exc
  File "/app/.venv/lib/python3.12/site-packages/starlette/middleware/base.py", line 191, in __call__
    response = await self.dispatch_func(request, call_next)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/openhands/server/listen.py", line 197, in attach_session
    response = await call_next(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/starlette/middleware/base.py", line 165, in call_next
    raise app_exc
  File "/app/.venv/lib/python3.12/site-packages/starlette/middleware/base.py", line 151, in coro
    await self.app(scope, receive_or_disconnect, send_no_error)
  File "/app/.venv/lib/python3.12/site-packages/starlette/middleware/cors.py", line 85, in __call__
    await self.app(scope, receive, send)
  File "/app/.venv/lib/python3.12/site-packages/starlette/middleware/exceptions.py", line 65, in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
  File "/app/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
    raise exc
  File "/app/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    await app(scope, receive, sender)
  File "/app/.venv/lib/python3.12/site-packages/starlette/routing.py", line 754, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/app/.venv/lib/python3.12/site-packages/starlette/routing.py", line 774, in app
    await route.handle(scope, receive, send)
  File "/app/.venv/lib/python3.12/site-packages/starlette/routing.py", line 295, in handle
    await self.app(scope, receive, send)
  File "/app/.venv/lib/python3.12/site-packages/starlette/routing.py", line 77, in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
  File "/app/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
    raise exc
  File "/app/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    await app(scope, receive, sender)
  File "/app/.venv/lib/python3.12/site-packages/starlette/routing.py", line 74, in app
    response = await f(request)
               ^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/fastapi/routing.py", line 297, in app
    raw_response = await run_endpoint_function(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/fastapi/routing.py", line 210, in run_endpoint_function
    return await dependant.call(**values)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/openhands/server/listen.py", line 409, in list_files
    file_list = runtime.list_files(path)
                ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/openhands/runtime/client/runtime.py", line 463, in list_files
    self._wait_until_alive()
  File "/app/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 336, in wrapped_f
    return copy(f, *args, **kw)
           ^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 475, in __call__
    do = self.iter(retry_state=retry_state)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 376, in iter
    result = action(retry_state)
             ^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 419, in exc_check
    raise retry_exc from fut.exception()
tenacity.RetryError: RetryError[<Future at 0x7f0dad175d90 state=finished raised ConnectionError>]
22:48:06 - openhands:INFO: session.py:139 - Server event
22:48:06 - openhands:INFO: session.py:139 - Server event

INFO:     <IP_ADDRESS>:59384 - "GET /api/list-files HTTP/1.1" 500 Internal Server Error
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/app/.venv/lib/python3.12/site-packages/urllib3/connection.py", line 196, in _new_conn
    sock = connection.create_connection(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/urllib3/util/connection.py", line 85, in create_connection
    raise err
  File "/app/.venv/lib/python3.12/site-packages/urllib3/util/connection.py", line 73, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/app/.venv/lib/python3.12/site-packages/urllib3/connectionpool.py", line 789, in urlopen
    response = self._make_request(
               ^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/urllib3/connectionpool.py", line 495, in _make_request
    conn.request(
  File "/app/.venv/lib/python3.12/site-packages/urllib3/connection.py", line 398, in request
    self.endheaders()
  File "/usr/local/lib/python3.12/http/client.py", line 1331, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.12/http/client.py", line 1091, in _send_output
    self.send(msg)
  File "/usr/local/lib/python3.12/http/client.py", line 1035, in send
    self.connect()
  File "/app/.venv/lib/python3.12/site-packages/urllib3/connection.py", line 236, in connect
    self.sock = self._new_conn()
                ^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/urllib3/connection.py", line 211, in _new_conn
    raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f0dac0597c0>: Failed to establish a new connection: [Errno 111] Connection refused

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/app/.venv/lib/python3.12/site-packages/requests/adapters.py", line 667, in send
    resp = conn.urlopen(
           ^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/urllib3/connectionpool.py", line 843, in urlopen
    retries = retries.increment(
              ^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/urllib3/util/retry.py", line 519, in increment
    raise MaxRetryError(_pool, url, reason) from reason  # type: ignore[arg-type]
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='host.docker.internal', port=40683): Max retries exceeded with url: /alive (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f0dac0597c0>: Failed to establish a new connection: [Errno 111] Connection refused'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/app/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 478, in __call__
    result = fn(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^
  File "/app/openhands/runtime/client/runtime.py", line 297, in _wait_until_alive
    response = self.session.get(f'{self.api_url}/alive')
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/requests/sessions.py", line 602, in get
    return self.request("GET", url, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/requests/sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/requests/adapters.py", line 700, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='host.docker.internal', port=40683): Max retries exceeded with url: /alive (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f0dac0597c0>: Failed to establish a new connection: [Errno 111] Connection refused'))

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/app/.venv/lib/python3.12/site-packages/uvicorn/protocols/http/h11_impl.py", line 406, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/uvicorn/middleware/proxy_headers.py", line 70, in __call__
    return await self.app(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/fastapi/applications.py", line 1054, in __call__
    await super().__call__(scope, receive, send)
  File "/app/.venv/lib/python3.12/site-packages/starlette/applications.py", line 123, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/app/.venv/lib/python3.12/site-packages/starlette/middleware/errors.py", line 186, in __call__
    raise exc
  File "/app/.venv/lib/python3.12/site-packages/starlette/middleware/errors.py", line 164, in __call__
    await self.app(scope, receive, _send)
  File "/app/.venv/lib/python3.12/site-packages/starlette/middleware/base.py", line 189, in __call__
    with collapse_excgroups():
  File "/usr/local/lib/python3.12/contextlib.py", line 158, in __exit__
    self.gen.throw(value)
  File "/app/.venv/lib/python3.12/site-packages/starlette/_utils.py", line 89, in collapse_excgroups
    raise exc
  File "/app/.venv/lib/python3.12/site-packages/starlette/middleware/base.py", line 191, in __call__
    response = await self.dispatch_func(request, call_next)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/openhands/server/listen.py", line 197, in attach_session
    response = await call_next(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/starlette/middleware/base.py", line 165, in call_next
    raise app_exc
  File "/app/.venv/lib/python3.12/site-packages/starlette/middleware/base.py", line 151, in coro
    await self.app(scope, receive_or_disconnect, send_no_error)
  File "/app/.venv/lib/python3.12/site-packages/starlette/middleware/cors.py", line 85, in __call__
    await self.app(scope, receive, send)
  File "/app/.venv/lib/python3.12/site-packages/starlette/middleware/exceptions.py", line 65, in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
  File "/app/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
    raise exc
  File "/app/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    await app(scope, receive, sender)
  File "/app/.venv/lib/python3.12/site-packages/starlette/routing.py", line 754, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/app/.venv/lib/python3.12/site-packages/starlette/routing.py", line 774, in app
    await route.handle(scope, receive, send)
  File "/app/.venv/lib/python3.12/site-packages/starlette/routing.py", line 295, in handle
    await self.app(scope, receive, send)
  File "/app/.venv/lib/python3.12/site-packages/starlette/routing.py", line 77, in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
  File "/app/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
    raise exc
  File "/app/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    await app(scope, receive, sender)
  File "/app/.venv/lib/python3.12/site-packages/starlette/routing.py", line 74, in app
    response = await f(request)
               ^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/fastapi/routing.py", line 297, in app
    raw_response = await run_endpoint_function(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/fastapi/routing.py", line 210, in run_endpoint_function
    return await dependant.call(**values)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/openhands/server/listen.py", line 409, in list_files
    file_list = runtime.list_files(path)
                ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/openhands/runtime/client/runtime.py", line 463, in list_files
    self._wait_until_alive()
  File "/app/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 336, in wrapped_f
    return copy(f, *args, **kw)
           ^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 475, in __call__
    do = self.iter(retry_state=retry_state)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 376, in iter
    result = action(retry_state)
             ^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 419, in exc_check
    raise retry_exc from fut.exception()
tenacity.RetryError: RetryError[<Future at 0x7f0dac059490 state=finished raised ConnectionError>]
22:55:04 - USER_ACTION
**MessageAction** (source=EventSource.USER)
CONTENT: create python code that print 1 to 100 and put it in a file with name "nums.py"
22:55:04 - openhands:INFO: session.py:139 - Server event
^[[6;7~^H
INFO:     <IP_ADDRESS>:37626 - "GET /api/list-files HTTP/1.1" 500 Internal Server Error
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/app/.venv/lib/python3.12/site-packages/urllib3/connection.py", line 196, in _new_conn
    sock = connection.create_connection(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/urllib3/util/connection.py", line 85, in create_connection
    raise err
  File "/app/.venv/lib/python3.12/site-packages/urllib3/util/connection.py", line 73, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/app/.venv/lib/python3.12/site-packages/urllib3/connectionpool.py", line 789, in urlopen
    response = self._make_request(
               ^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/urllib3/connectionpool.py", line 495, in _make_request
    conn.request(
  File "/app/.venv/lib/python3.12/site-packages/urllib3/connection.py", line 398, in request
    self.endheaders()
  File "/usr/local/lib/python3.12/http/client.py", line 1331, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.12/http/client.py", line 1091, in _send_output
    self.send(msg)
  File "/usr/local/lib/python3.12/http/client.py", line 1035, in send
    self.connect()
  File "/app/.venv/lib/python3.12/site-packages/urllib3/connection.py", line 236, in connect
    self.sock = self._new_conn()
                ^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/urllib3/connection.py", line 211, in _new_conn
    raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f0dac05b710>: Failed to establish a new connection: [Errno 111] Connection refused

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/app/.venv/lib/python3.12/site-packages/requests/adapters.py", line 667, in send
    resp = conn.urlopen(
           ^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/urllib3/connectionpool.py", line 843, in urlopen
    retries = retries.increment(
              ^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/urllib3/util/retry.py", line 519, in increment
    raise MaxRetryError(_pool, url, reason) from reason  # type: ignore[arg-type]
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='host.docker.internal', port=40683): Max retries exceeded with url: /alive (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f0dac05b710>: Failed to establish a new connection: [Errno 111] Connection refused'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/app/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 478, in __call__
    result = fn(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^
  File "/app/openhands/runtime/client/runtime.py", line 297, in _wait_until_alive
    response = self.session.get(f'{self.api_url}/alive')
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/requests/sessions.py", line 602, in get
    return self.request("GET", url, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/requests/sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/requests/adapters.py", line 700, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='host.docker.internal', port=40683): Max retries exceeded with url: /alive (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f0dac05b710>: Failed to establish a new connection: [Errno 111] Connection refused'))

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/app/.venv/lib/python3.12/site-packages/uvicorn/protocols/http/h11_impl.py", line 406, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/uvicorn/middleware/proxy_headers.py", line 70, in __call__
    return await self.app(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/fastapi/applications.py", line 1054, in __call__
    await super().__call__(scope, receive, send)
  File "/app/.venv/lib/python3.12/site-packages/starlette/applications.py", line 123, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/app/.venv/lib/python3.12/site-packages/starlette/middleware/errors.py", line 186, in __call__
    raise exc
  File "/app/.venv/lib/python3.12/site-packages/starlette/middleware/errors.py", line 164, in __call__
    await self.app(scope, receive, _send)
  File "/app/.venv/lib/python3.12/site-packages/starlette/middleware/base.py", line 189, in __call__
    with collapse_excgroups():
  File "/usr/local/lib/python3.12/contextlib.py", line 158, in __exit__
    self.gen.throw(value)
  File "/app/.venv/lib/python3.12/site-packages/starlette/_utils.py", line 89, in collapse_excgroups
    raise exc
  File "/app/.venv/lib/python3.12/site-packages/starlette/middleware/base.py", line 191, in __call__
    response = await self.dispatch_func(request, call_next)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/openhands/server/listen.py", line 197, in attach_session
    response = await call_next(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/starlette/middleware/base.py", line 165, in call_next
    raise app_exc
  File "/app/.venv/lib/python3.12/site-packages/starlette/middleware/base.py", line 151, in coro
    await self.app(scope, receive_or_disconnect, send_no_error)
  File "/app/.venv/lib/python3.12/site-packages/starlette/middleware/cors.py", line 85, in __call__
    await self.app(scope, receive, send)
  File "/app/.venv/lib/python3.12/site-packages/starlette/middleware/exceptions.py", line 65, in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
  File "/app/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
    raise exc
  File "/app/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    await app(scope, receive, sender)
  File "/app/.venv/lib/python3.12/site-packages/starlette/routing.py", line 754, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/app/.venv/lib/python3.12/site-packages/starlette/routing.py", line 774, in app
    await route.handle(scope, receive, send)
  File "/app/.venv/lib/python3.12/site-packages/starlette/routing.py", line 295, in handle
    await self.app(scope, receive, send)
  File "/app/.venv/lib/python3.12/site-packages/starlette/routing.py", line 77, in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
  File "/app/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
    raise exc
  File "/app/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    await app(scope, receive, sender)
  File "/app/.venv/lib/python3.12/site-packages/starlette/routing.py", line 74, in app
    response = await f(request)
               ^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/fastapi/routing.py", line 297, in app
    raw_response = await run_endpoint_function(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/fastapi/routing.py", line 210, in run_endpoint_function
    return await dependant.call(**values)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/openhands/server/listen.py", line 409, in list_files
    file_list = runtime.list_files(path)
                ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/openhands/runtime/client/runtime.py", line 463, in list_files
    self._wait_until_alive()
  File "/app/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 336, in wrapped_f
    return copy(f, *args, **kw)
           ^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 475, in __call__
    do = self.iter(retry_state=retry_state)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 376, in iter
    result = action(retry_state)
             ^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 419, in exc_check
    raise retry_exc from fut.exception()
tenacity.RetryError: RetryError[<Future at 0x7f0dac05b7a0 state=finished raised ConnectionError>]

==============
CodeActAgent LEVEL 0 LOCAL STEP 1 GLOBAL STEP 1

23:09:11 - ACTION
**IPythonRunCellAction**
THOUGHT: Sure! Let me create a Python file `nums.py`:
CODE:
create_file('nums.py')
INFO:     <IP_ADDRESS>:41560 - "GET /api/list-files HTTP/1.1" 500 Internal Server Error
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/app/.venv/lib/python3.12/site-packages/urllib3/connection.py", line 196, in _new_conn
    sock = connection.create_connection(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/urllib3/util/connection.py", line 85, in create_connection
    raise err
  File "/app/.venv/lib/python3.12/site-packages/urllib3/util/connection.py", line 73, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/app/.venv/lib/python3.12/site-packages/urllib3/connectionpool.py", line 789, in urlopen
    response = self._make_request(
               ^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/urllib3/connectionpool.py", line 495, in _make_request
    conn.request(
  File "/app/.venv/lib/python3.12/site-packages/urllib3/connection.py", line 398, in request
    self.endheaders()
  File "/usr/local/lib/python3.12/http/client.py", line 1331, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.12/http/client.py", line 1091, in _send_output
    self.send(msg)
  File "/usr/local/lib/python3.12/http/client.py", line 1035, in send
    self.connect()
  File "/app/.venv/lib/python3.12/site-packages/urllib3/connection.py", line 236, in connect
    self.sock = self._new_conn()
                ^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/urllib3/connection.py", line 211, in _new_conn
    raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f0dac0813a0>: Failed to establish a new connection: [Errno 111] Connection refused

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/app/.venv/lib/python3.12/site-packages/requests/adapters.py", line 667, in send
    resp = conn.urlopen(
           ^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/urllib3/connectionpool.py", line 843, in urlopen
    retries = retries.increment(
              ^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/urllib3/util/retry.py", line 519, in increment
    raise MaxRetryError(_pool, url, reason) from reason  # type: ignore[arg-type]
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='host.docker.internal', port=40683): Max retries exceeded with url: /alive (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f0dac0813a0>: Failed to establish a new connection: [Errno 111] Connection refused'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/app/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 478, in __call__
    result = fn(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^
  File "/app/openhands/runtime/client/runtime.py", line 297, in _wait_until_alive
    response = self.session.get(f'{self.api_url}/alive')
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/requests/sessions.py", line 602, in get
    return self.request("GET", url, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/requests/sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/requests/adapters.py", line 700, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='host.docker.internal', port=40683): Max retries exceeded with url: /alive (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f0dac0813a0>: Failed to establish a new connection: [Errno 111] Connection refused'))

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/app/.venv/lib/python3.12/site-packages/uvicorn/protocols/http/h11_impl.py", line 406, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/uvicorn/middleware/proxy_headers.py", line 70, in __call__
    return await self.app(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/fastapi/applications.py", line 1054, in __call__
    await super().__call__(scope, receive, send)
  File "/app/.venv/lib/python3.12/site-packages/starlette/applications.py", line 123, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/app/.venv/lib/python3.12/site-packages/starlette/middleware/errors.py", line 186, in __call__
    raise exc
  File "/app/.venv/lib/python3.12/site-packages/starlette/middleware/errors.py", line 164, in __call__
    await self.app(scope, receive, _send)
  File "/app/.venv/lib/python3.12/site-packages/starlette/middleware/base.py", line 189, in __call__
    with collapse_excgroups():
  File "/usr/local/lib/python3.12/contextlib.py", line 158, in __exit__
    self.gen.throw(value)
  File "/app/.venv/lib/python3.12/site-packages/starlette/_utils.py", line 89, in collapse_excgroups
    raise exc
  File "/app/.venv/lib/python3.12/site-packages/starlette/middleware/base.py", line 191, in __call__
    response = await self.dispatch_func(request, call_next)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/openhands/server/listen.py", line 197, in attach_session
    response = await call_next(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/starlette/middleware/base.py", line 165, in call_next
    raise app_exc
  File "/app/.venv/lib/python3.12/site-packages/starlette/middleware/base.py", line 151, in coro
    await self.app(scope, receive_or_disconnect, send_no_error)
  File "/app/.venv/lib/python3.12/site-packages/starlette/middleware/cors.py", line 85, in __call__
    await self.app(scope, receive, send)
  File "/app/.venv/lib/python3.12/site-packages/starlette/middleware/exceptions.py", line 65, in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
  File "/app/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
    raise exc
  File "/app/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    await app(scope, receive, sender)
  File "/app/.venv/lib/python3.12/site-packages/starlette/routing.py", line 754, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/app/.venv/lib/python3.12/site-packages/starlette/routing.py", line 774, in app
    await route.handle(scope, receive, send)
  File "/app/.venv/lib/python3.12/site-packages/starlette/routing.py", line 295, in handle
    await self.app(scope, receive, send)
  File "/app/.venv/lib/python3.12/site-packages/starlette/routing.py", line 77, in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
  File "/app/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
    raise exc
  File "/app/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    await app(scope, receive, sender)
  File "/app/.venv/lib/python3.12/site-packages/starlette/routing.py", line 74, in app
    response = await f(request)
               ^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/fastapi/routing.py", line 297, in app
    raw_response = await run_endpoint_function(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/fastapi/routing.py", line 210, in run_endpoint_function
    return await dependant.call(**values)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/openhands/server/listen.py", line 409, in list_files
    file_list = runtime.list_files(path)
                ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/openhands/runtime/client/runtime.py", line 463, in list_files
    self._wait_until_alive()
  File "/app/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 336, in wrapped_f
    return copy(f, *args, **kw)
           ^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 475, in __call__
    do = self.iter(retry_state=retry_state)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 376, in iter
    result = action(retry_state)
             ^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 419, in exc_check
    raise retry_exc from fut.exception()
tenacity.RetryError: RetryError[<Future at 0x7f0dac081430 state=finished raised ConnectionError>]
23:09:11 - openhands:INFO: runtime.py:359 - Awaiting session
ERROR:asyncio:Task exception was never retrieved
future: <Task finished name='Task-118' coro=<Runtime.on_event() done, defined at /app/openhands/runtime/runtime.py:110> exception=RetryError(<Future at 0x7f0dac09de50 state=finished raised ConnectionError>)>
Traceback (most recent call last):
  File "/app/.venv/lib/python3.12/site-packages/urllib3/connection.py", line 196, in _new_conn
    sock = connection.create_connection(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/urllib3/util/connection.py", line 85, in create_connection
    raise err
  File "/app/.venv/lib/python3.12/site-packages/urllib3/util/connection.py", line 73, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/app/.venv/lib/python3.12/site-packages/urllib3/connectionpool.py", line 789, in urlopen
    response = self._make_request(
               ^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/urllib3/connectionpool.py", line 495, in _make_request
    conn.request(
  File "/app/.venv/lib/python3.12/site-packages/urllib3/connection.py", line 398, in request
    self.endheaders()
  File "/usr/local/lib/python3.12/http/client.py", line 1331, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.12/http/client.py", line 1091, in _send_output
    self.send(msg)
  File "/usr/local/lib/python3.12/http/client.py", line 1035, in send
    self.connect()
  File "/app/.venv/lib/python3.12/site-packages/urllib3/connection.py", line 236, in connect
    self.sock = self._new_conn()
                ^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/urllib3/connection.py", line 211, in _new_conn
    raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f0dac09ddc0>: Failed to establish a new connection: [Errno 111] Connection refused

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/app/.venv/lib/python3.12/site-packages/requests/adapters.py", line 667, in send
    resp = conn.urlopen(
           ^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/urllib3/connectionpool.py", line 843, in urlopen
    retries = retries.increment(
              ^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/urllib3/util/retry.py", line 519, in increment
    raise MaxRetryError(_pool, url, reason) from reason  # type: ignore[arg-type]
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='host.docker.internal', port=40683): Max retries exceeded with url: /alive (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f0dac09ddc0>: Failed to establish a new connection: [Errno 111] Connection refused'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/app/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 478, in __call__
    result = fn(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^
  File "/app/openhands/runtime/client/runtime.py", line 297, in _wait_until_alive
    response = self.session.get(f'{self.api_url}/alive')
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/requests/sessions.py", line 602, in get
    return self.request("GET", url, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/requests/sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/requests/adapters.py", line 700, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='host.docker.internal', port=40683): Max retries exceeded with url: /alive (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f0dac09ddc0>: Failed to establish a new connection: [Errno 111] Connection refused'))

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/app/openhands/runtime/runtime.py", line 116, in on_event
    observation = self.run_action(event)
                  ^^^^^^^^^^^^^^^^^^^^^^
  File "/app/openhands/runtime/client/runtime.py", line 360, in run_action
    self._wait_until_alive()
  File "/app/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 336, in wrapped_f
    return copy(f, *args, **kw)
           ^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 475, in __call__
    do = self.iter(retry_state=retry_state)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 376, in iter
    result = action(retry_state)
             ^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 419, in exc_check
    raise retry_exc from fut.exception()
tenacity.RetryError: RetryError[<Future at 0x7f0dac09de50 state=finished raised ConnectionError>]
23:16:09 - openhands:INFO: session.py:139 - Server event
23:16:09 - openhands:INFO: session.py:65 - WebSocket disconnected, sid: 0093bc4c-b947-4077-bd15-7b807c7e05f3
INFO:     connection closed
23:16:09 - openhands:INFO: agent_controller.py:155 - AgentController task was cancelled
23:16:09 - openhands:INFO: session.py:139 - Server event
INFO:     ('<IP_ADDRESS>', 48420) - "WebSocket /ws?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzaWQiOiIwMDkzYmM0Yy1iOTQ3LTQwNzctYmQxNS03YjgwN2M3ZTA1ZjMifQ.4giIiZ5xSlY2Uo90IOxVNynwqyNp9wItPR7aOb72NwY&latest_event_id=14" [accepted]
INFO:     connection open
23:16:12 - openhands:WARNING: llm.py:85 - Could not get model info for openrouter/nousresearch/hermes-3-llama-3.1-405b:
This model isn't mapped yet. model=openrouter/nousresearch/hermes-3-llama-3.1-405b, custom_llm_provider=openrouter. Add it here - https://github.com/BerriAI/litellm/blob/main/model_prices_and_context_window.json.
23:16:12 - openhands:INFO: agent.py:79 - Using security analyzer:
23:16:12 - openhands:INFO: agent.py:90 - Initializing runtime `eventstream` now...
23:16:12 - openhands:INFO: runtime.py:183 - Starting container with image: ghcr.io/all-hands-ai/runtime:0.9.2-nikolaik and name: openhands-sandbox-0093bc4c-b947-4077-bd15-7b807c7e05f3_8b6f4b60-b160-4e31-8785-5834dec65e83
23:16:12 - openhands:INFO: runtime.py:204 - Mount dir: /workspace
23:16:13 - openhands:ERROR: runtime.py:82 - Error in stream_logs: 'LogBuffer' object has no attribute '_stop_event'
23:16:13 - openhands:INFO: runtime.py:238 - Container started. Server url: http://host.docker.internal:38333
23:16:13 - openhands:INFO: runtime.py:157 - Container initialized with plugins: ['agent_skills', 'jupyter']
23:16:13 - openhands:INFO: runtime.py:160 - Container initialized with env vars: None
23:16:13 - openhands:INFO: agent.py:116 - Agents: {'agent': AgentConfig(micro_agent_name=None, memory_enabled=False, memory_max_threads=2, llm_config=None)}
23:16:13 - openhands:INFO: agent.py:117 - Creating agent CodeActAgent using LLM openrouter/nousresearch/hermes-3-llama-3.1-405b
23:16:13 - openhands:INFO: agent.py:137 - Restored agent state from session, sid: 0093bc4c-b947-4077-bd15-7b807c7e05f3
23:16:13 - openhands:INFO: agent.py:140 - Agent controller initialized.
23:16:13 - openhands:INFO: session.py:139 - Server event
23:16:13 - openhands:INFO: agent_controller.py:150 - [Agent Controller 0093bc4c-b947-4077-bd15-7b807c7e05f3] Starting step loop...
23:16:13 - openhands:INFO: session.py:139 - Server event
23:16:13 - openhands:INFO: session.py:139 - Server event
INFO:     <IP_ADDRESS>:48430 - "GET /api/list-files HTTP/1.1" 500 Internal Server Error
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/app/.venv/lib/python3.12/site-packages/urllib3/connection.py", line 196, in _new_conn
    sock = connection.create_connection(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/urllib3/util/connection.py", line 85, in create_connection
    raise err
  File "/app/.venv/lib/python3.12/site-packages/urllib3/util/connection.py", line 73, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/app/.venv/lib/python3.12/site-packages/urllib3/connectionpool.py", line 789, in urlopen
    response = self._make_request(
               ^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/urllib3/connectionpool.py", line 495, in _make_request
    conn.request(
  File "/app/.venv/lib/python3.12/site-packages/urllib3/connection.py", line 398, in request
    self.endheaders()
  File "/usr/local/lib/python3.12/http/client.py", line 1331, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.12/http/client.py", line 1091, in _send_output
    self.send(msg)
  File "/usr/local/lib/python3.12/http/client.py", line 1035, in send
    self.connect()
  File "/app/.venv/lib/python3.12/site-packages/urllib3/connection.py", line 236, in connect
    self.sock = self._new_conn()
                ^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/urllib3/connection.py", line 211, in _new_conn
    raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f0dac0b1280>: Failed to establish a new connection: [Errno 111] Connection refused

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/app/.venv/lib/python3.12/site-packages/requests/adapters.py", line 667, in send
    resp = conn.urlopen(
           ^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/urllib3/connectionpool.py", line 843, in urlopen
    retries = retries.increment(
              ^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/urllib3/util/retry.py", line 519, in increment
    raise MaxRetryError(_pool, url, reason) from reason  # type: ignore[arg-type]
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='host.docker.internal', port=38333): Max retries exceeded with url: /alive (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f0dac0b1280>: Failed to establish a new connection: [Errno 111] Connection refused'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/app/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 478, in __call__
    result = fn(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^
  File "/app/openhands/runtime/client/runtime.py", line 297, in _wait_until_alive
    response = self.session.get(f'{self.api_url}/alive')
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/requests/sessions.py", line 602, in get
    return self.request("GET", url, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/requests/sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/requests/adapters.py", line 700, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='host.docker.internal', port=38333): Max retries exceeded with url: /alive (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f0dac0b1280>: Failed to establish a new connection: [Errno 111] Connection refused'))

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/app/.venv/lib/python3.12/site-packages/uvicorn/protocols/http/h11_impl.py", line 406, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/uvicorn/middleware/proxy_headers.py", line 70, in __call__
    return await self.app(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/fastapi/applications.py", line 1054, in __call__
    await super().__call__(scope, receive, send)
  File "/app/.venv/lib/python3.12/site-packages/starlette/applications.py", line 123, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/app/.venv/lib/python3.12/site-packages/starlette/middleware/errors.py", line 186, in __call__
    raise exc
  File "/app/.venv/lib/python3.12/site-packages/starlette/middleware/errors.py", line 164, in __call__
    await self.app(scope, receive, _send)
  File "/app/.venv/lib/python3.12/site-packages/starlette/middleware/base.py", line 189, in __call__
    with collapse_excgroups():
  File "/usr/local/lib/python3.12/contextlib.py", line 158, in __exit__
    self.gen.throw(value)
  File "/app/.venv/lib/python3.12/site-packages/starlette/_utils.py", line 89, in collapse_excgroups
    raise exc
  File "/app/.venv/lib/python3.12/site-packages/starlette/middleware/base.py", line 191, in __call__
    response = await self.dispatch_func(request, call_next)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/openhands/server/listen.py", line 197, in attach_session
    response = await call_next(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/starlette/middleware/base.py", line 165, in call_next
    raise app_exc
  File "/app/.venv/lib/python3.12/site-packages/starlette/middleware/base.py", line 151, in coro
    await self.app(scope, receive_or_disconnect, send_no_error)
  File "/app/.venv/lib/python3.12/site-packages/starlette/middleware/cors.py", line 85, in __call__
    await self.app(scope, receive, send)
  File "/app/.venv/lib/python3.12/site-packages/starlette/middleware/exceptions.py", line 65, in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
  File "/app/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
    raise exc
  File "/app/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    await app(scope, receive, sender)
  File "/app/.venv/lib/python3.12/site-packages/starlette/routing.py", line 754, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/app/.venv/lib/python3.12/site-packages/starlette/routing.py", line 774, in app
    await route.handle(scope, receive, send)
  File "/app/.venv/lib/python3.12/site-packages/starlette/routing.py", line 295, in handle
    await self.app(scope, receive, send)
  File "/app/.venv/lib/python3.12/site-packages/starlette/routing.py", line 77, in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
  File "/app/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
    raise exc
  File "/app/.venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    await app(scope, receive, sender)
  File "/app/.venv/lib/python3.12/site-packages/starlette/routing.py", line 74, in app
    response = await f(request)
               ^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/fastapi/routing.py", line 297, in app
    raw_response = await run_endpoint_function(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/fastapi/routing.py", line 210, in run_endpoint_function
    return await dependant.call(**values)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/openhands/server/listen.py", line 409, in list_files
    file_list = runtime.list_files(path)
                ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/openhands/runtime/client/runtime.py", line 463, in list_files
    self._wait_until_alive()
  File "/app/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 336, in wrapped_f
    return copy(f, *args, **kw)
           ^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 475, in __call__
    do = self.iter(retry_state=retry_state)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 376, in iter
    result = action(retry_state)
             ^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/tenacity/__init__.py", line 419, in exc_check
    raise retry_exc from fut.exception()
tenacity.RetryError: RetryError[<Future at 0x7f0dac0b11c0 state=finished raised ConnectionError>]

@imeDevelopers can you delete all your docker images and then try this command:
docker run -it --pull=always \
    -e SANDBOX_RUNTIME_CONTAINER_IMAGE=ghcr.io/all-hands-ai/runtime:0.9.1-nikolaik \
    -e SANDBOX_USER_ID=$(id -u) \
    -e WORKSPACE_MOUNT_PATH=$WORKSPACE_BASE \
    -v $WORKSPACE_BASE:/opt/workspace_base \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -p 3000:3000 \
    --add-host host.docker.internal:host-gateway \
    --name openhands-app-$(date +%Y%m%d%H%M%S) \
    ghcr.io/all-hands-ai/openhands:0.9

and see if it's better at all? (Changed runtime:0.9.2-nikolaik to runtime:0.9.1-nikolaik)

@mamoodi I have the same issue and this solution is not working for me

I did it already. also the only working model is llama3.1 8b local.
btw I have started with OpenHands today

So you ran with:
export WORKSPACE_BASE=$(pwd)/workspace

docker run -it --pull=always \
    -e SANDBOX_RUNTIME_CONTAINER_IMAGE=ghcr.io/all-hands-ai/runtime:0.9-nikolaik \
    -e SANDBOX_USER_ID=$(id -u) \
    -e WORKSPACE_MOUNT_PATH=$WORKSPACE_BASE \
    -v $WORKSPACE_BASE:/opt/workspace_base \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -p 3000:3000 \
    --add-host host.docker.internal:host-gateway \
    --name openhands-app-$(date +%Y%m%d%H%M%S) \
    ghcr.io/all-hands-ai/openhands:0.9

and it's not working? Or it is working?

not with Groq, only with local models which my poor laptop can’t really handle 😔

@Polygons1 can you please tell:

do you run to the point where you can open the web UI, which allows you to select groq?
what exactly do you select, what is the model name you use?
what errors do you get?

Yes
Groq, mixtral 8x7b
LiteLLM errors with no backtrace

@imeDevelopers In the original post, in the error log I see this:

22:33:53 - openhands:WARNING: llm.py:85 - Could not get model info for openrouter/nousresearch/hermes-3-llama-3.1-405b:
This model isn't mapped yet. model=openrouter/nousresearch/hermes-3-llama-3.1-405b, custom_llm_provider=openrouter. Add it here - https://github.com/BerriAI/litellm/blob/main/model_prices_and_context_window.json.

This error shows that this Nous model isn't supported in liteLLM. We use liteLLM for model support. It could be that it needs to do what it says, to add it to their json file, or it could be that you could reference it differently... Just a guess: what happens if you try referencing it like openrouter/openai/hermes-3-llama-3.1-405b ?
@Polygons1 can you please try to paste here the error log you may have?

i can see:
CodeActAgent LEVEL 0 LOCAL STEP 0 GLOBAL STEP 0

Give Feedback / Get Help: https://github.com/BerriAI/litellm/issues/new
LiteLLM.Info: If you need to debug this error, use `litellm.set_verbose=True'.

Provider List: https://docs.litellm.ai/docs/providers

and
Exception in ASGI application

Could you please try to run in the same command terminal where you will run docker, export DEBUG=1, then run again, and see if it says anything more?

how can I do that with docker start?

@Polygons1 Use docker run, as noted in the README, so you can set environment variables, and just add DEBUG=1 to them or anytime before running. For example:
export WORKSPACE_BASE=$(pwd)/workspace

docker run -it --pull=always \
    -e DEBUG=1 \
    -e SANDBOX_RUNTIME_CONTAINER_IMAGE=ghcr.io/all-hands-ai/runtime:0.9-nikolaik \
    -e SANDBOX_USER_ID=$(id -u) \
    -e WORKSPACE_MOUNT_PATH=$WORKSPACE_BASE \
    -v $WORKSPACE_BASE:/opt/workspace_base \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -p 3000:3000 \
    --add-host host.docker.internal:host-gateway \
    --name openhands-app-$(date +%Y%m%d%H%M%S) \
    ghcr.io/all-hands-ai/openhands:0.9

I can't do that exact command because I am using PowerShell and creating a new container every time is just dumb. also I've set the DEBUG=1 variable in the container itself (docker exec) and it still didn't work

Comment: #2347850775

There's been a ton of changes in OpenHands since this issue was opened. I'd like to suggest to try out the new version from the README and open a new issue if you run into any.


https://taskboard.matthewross.me - Certificate expired

The title says it all :grimacing:

Well damn. Looks like I have some server maintenance to do.
Thanks for the heads-up!


yolact_edge - need to pass detect = [ ] as integer not string class labels

For Object Detection, to pass the .Node, we use detect = ["class_name0", "class_name1", ..., "class_nameN"]. However, for yolact, we will need to use detect = [0, 1, ..., N].
yolact_edge:

yolov4-tiny:

[Request] To align on which to use - integer index or class name as string

Hi, the latest release of PeekingDuck is able to accept class names for yolact_edge:

As can be seen above, the person got converted internally to id 0.
Please update your PeekingDuck to the latest version.


Update aws-crt to 0.29.12

About this PR
📦 Updates software.amazon.awssdk.crt:aws-crt from 0.29.9 to 0.29.12
Usage
✅ Please merge!
I'll automatically update this PR to resolve conflicts as long as you don't change it yourself.
If you'd like to skip this version, you can just close this PR. If you have any feedback, just mention me in the comments below.
Configure Scala Steward for your repository with a .scala-steward.conf file.
Have a fantastic day writing Scala!

⚙ Adjust future updates
Add this to your .scala-steward.conf file to ignore future updates of this dependency:
updates.ignore = [ { groupId = "software.amazon.awssdk.crt", artifactId = "aws-crt" } ]

Or, add this to slow down future updates of this dependency:
dependencyOverrides = [{
  pullRequests = { frequency = "30 days" },
  dependency = { groupId = "software.amazon.awssdk.crt", artifactId = "aws-crt" }
}]

labels: test-library-update, early-semver-minor, semver-spec-patch, commit-count:1

Superseded by #1063.


Fix major bug in validate_builtins

Fixed an early return in the loop, resulting in only one decoration
being checked.

Rebased and pushed into master as 691eed92cb


Ajax sidebar question

Hi, first of all congratulations for this excelent framework! It´s awesome.
I have a multilevel treeview on my sidebar. Is it possible to load subtrees via Ajax when I click on a node? I made a lot of sql processing to build it and it affects performance when I load the page for the first time.
Any help or hint is very much appreciated
Thanx
German

Everything is possible. Please refer to issue #382.
The best approach would be to let your server return a list of links and their titles and allow jQuery to render the information into HTML elements.
Example server response in json:
{
  "link1": "/my/url",
  "link2": "/to/path"
}

Example jQuery render function:
function renderLink(links) {
  $.each(links, function(title, link) {
    var li = $("
"),
        a = $("", {href: link});
    li.html(" " + title + "");
    a.append(li);
    $(".sidebar-menu").append(li);
  });

You get the picture.

Awesome!! That's what I've been looking for. Thanks again Abdullah for your response and for this great framework
Cheers
Germán


Remove ruby 1.9 from travis CI spec

As of July 1, the latest version of the json gem (2.0.1) now requires ruby ~> 2.0.  This is breaking CI testing on master.  This PR removes the ruby 1.9 entry from the travis spec file.

Sorry, but we do want to keep ruby 1.9 support. The correct solution to this (which I haven't had time to do yet) is to use a custom gemfile on the ruby 1.9 build which limits the json gem to versions less than 2.0 (which raised the minimum ruby version to 2.0)

#350 should resolve this issue.

Ah. Well done, then.  Thanks.


Hopper Minecarts taking items from chests crashes the game

A hopper minecart passing by a chest with items will crash the game (or server).
Issue brought to light by this comment.

Fixed in upcoming release.


Chip level regression test fixes

This PR bundles some HW, SW and DV fixes for the RV timer and GPIO tests that were failing at the chip level. These are only run in the nightly regressions and not in the sanity (private CI). The fixes have had to be made because of the changes introduced in other places.
These are as follows:

Generic pad wrapper fix as described in #3236
Fix in pins_if` to get it to behave correctly when no pull up or pull down is enabled
SW fix and a minor update to the dif_rv_timer_sanitytest.c
Fix in the chip_sim_cfg.hjson to set the path to the SW test correctly, extend the timeout and some name fixes

It looks like we need to increase the uart_timeout for the verilator test too.
Other than that, everything looks good from the software side.


Some errors in Fuinction of  FCN32_vgg

In the file FCN32_vgg.py  in the function of  get_deconv_filter(self, f_shape):
youa re doing
for i in range(f_shape[2]):
weights[:, :, i, i] = bilinear
line 240. if the number of input channel is different from no of classes your weight initialization will not work. If you can explain why you did weights[:,:,i,i] instead of weights[:,:,i,j] and iterating over both i and j. it would be of great help.

get_deconv_filter performs bilinear upsampling. By definition this requires the number of input channels to be exactly the same as the number of output channels.
Also have a look at my explanation in #14

The weight is a 4-d tensor mapping k input channels to k output channels. The layer is supposed to upsample each channel independently, those the i^th output channel should become an upsampled Version of the i^th input channel. The value of the i^th channel should not be influenced by the values of any other channel.


Replace Version.moduleName with SwiftProtobufInfo.name.

The Namer already had to know the module and used the other
constant so generated module references would be correct.

@tbkka sorry I forgot we already had this constant for the other PR.  if they mismatched WKT references would be correct, so safer to just have one concept in the sources instead of two.

FYI:  @cburrows


Expander doesn't open when given the command from Dragon Accessibility Tool

Dragon accessibility tool: Expander component does not open when the command is given.
Test Env:
Desktop Browser -feature branch for Expander component.
Steps to reproduce
1.Run and deploy the feature branch in storybook.
2.Start Dragon accessibility tool .
3.Voice command to open the expander component.
Expected Result
Expander should open on voice command.
Actual Result
Expander does not open on voice command.
Acceptance Criteria:
Given a windows user uses Voice command on Dragon tool.
The Expander should open on voice command.

In fact, here's a note of what we've seen before. https://github.com/nhsuk/nhsuk-service-manual-community-backlog/issues/29#issuecomment-1263558017.


Jupyter: user input SQL query

SQL syntax highlighting
index for pandas dataframe

For syntax highlighting we would need to make a custom jupyter widget, we can start doing so by forking the following cookiecutter github repo:
https://github.com/jupyter-widgets/widget-cookiecutter


Error on installation

After installation, I get this error when running mvm -V:
Error: Could not find or load main class C:\Users\my-username.mpm\
But this file doesn't exist there. So how can I fix this?

if its linux only as it says in the description it should be pathed $HOME/username/my-username.mpm
or  ~/username/my-username.mpm

and if you do use linux make sure your path and your java is set right


ability to process both protobuf and transport protocols

@lumber1000 I also don't see changes with grpc interface for codecs in this branch. I have found this one
https://github.com/th2-net/th2-codec/tree/TS-1127
I believe we must migrate those changes to transport protocol as well (because we need them for other components)


feat: named methods and paginators implementation

Situation

We've identified some places where we can improve the user experience with the SDK. One of these is to better abstract the internal operations execution, handling errors in a more customized way, and finally, having more control over the operation execution and processing such as paginated responses.
We've been adopting a generic model for operations execution in the SDK by providing a generic execute() method that accepts the operation to be executed and return the response. While this approach works fine, it has some drawbacks:

Operations passed to the execute() method are not easily discoverable, users have to refer to the documentation and explore the available operations on each client.
Error handling becomes more challenging as we don't have control over each operation execution, forcing us to provide a global error handling logic applied on all operations.
The raw responses returned from the execute() method exposes some internal GraphQL API details.

Task

Working towards enhancing the user experience with the SDK, a new methods are added to the SDK clients. These methods are designed to make the available operations more discoverable on each client. In addition, these methods help abstracting the internal API implementation by returning the targeted data in the response, and finally, enables us to have better control over the executed operation in terms of pagination, error handling, and dealing with different types of operation inputs.
Action

In order to achieve this goal, this PR brings major changes to how the SDK clients work generally. Below is a summarized list of the key changes present in this PR:
1. Named Methods
A new named methods are added on each client ReservationClient, SandboxDataManagementClient, PaymentClient. Each method has an underlying implementation in the function package. This keeps the client cleaner where all methods delegates the call to the internal function.
It worths mentioning that there is a proposed standard on how files in the function package should be named, and what these files should contain exactly.

The file name should match the operation name followed by Fun.
The file should contain the actual function and a response model.
The function should match the file name, decapitalizing the first letter.
The response model should match the operation name followed by Response.
One exception for queries, the function name starts with get for better semantics. However, mutations exactly match the operation name.

Example
The example code block below shows the internal functions implementation pattern, demonstrating the proposed standards listed above.
// CancelSandboxReservationFun.kt

data class CancelSandboxReservationResponse(
    override val data: SandboxReservationData,
    override val rawResponse: RawResponse<SandboxCancelReservationMutation.Data>,
) : Response<SandboxReservationData, SandboxCancelReservationMutation.Data>

fun cancelSandboxReservationFun(client: GraphQLExecutor, input: CancelReservationInput): CancelSandboxReservationResponse {
    val operation = SandboxCancelReservationMutation(input)
    val response = client.execute(operation)

    return CancelSandboxReservationResponse(
        data = response.data.cancelReservation.reservation.sandboxReservationData,
        rawResponse = response
    )
}

As mentioned earlier, this function is used by the respective higher-level method defined on the client directly.
class SandboxDataManagementClient(config: ClientConfiguration) {
    fun cancelReservation(input: CancelReservationInput) = run {
        cancelSandboxReservationFun(baseGraphQLClient, input)
    }

    // Rest of operations....
}

Finally, the usage on the users side should be similar to the below Java example:
CancelSandboxReservationResponse response = client.cancelReservation(input);

2. Response Type
Looking at the previous example, concrete responses types like CancelSandboxReservationResponse implements a common interface Response<T, V>. The main purpose of this interface is to abstract the raw responses returned by Apollo client. It takes two generics parameters:

T: Is the type of the data fragment we want to return to the user. It's a convenience layer that facilitates the data extraction from the GraphQL responses. In the example above, we are returning the SandboxReservationData directly by extracting it from the raw response.
V: Is the type of the raw response returned from the client. It exposes more internal details, but gives the users better access to the errors list and partial data processing (GraphQL details).

Previously, we used to throw exceptions if any error presents in the errors list. The rawResponse is a proposed solution to maintain the partial responses with the errors list. Users can get the end targeted fragment in the happy paths, and fallback to the raw response to process the errors list against the raw response.
CancelReservationResponse response = client.cancelReservation(input);

Optional<ReservationData> optionalReservationData = response.getData();

if (optionalReservationData.isPresent()) {
    // happy path
} else {
    RawResponse<CancelReservationMutation.Data> rawResponse = response.getRawResponse();
    List<RawResponseError> errors = rawResponse.getErrors();

    errors.forEach(error -> {
        // process the error as required
    });
}

[!NOTE]
The generated models wrap all nullable fields in Optional. This clearly communicates that this field could be returned as null.

3. Pagination
The new methods enable us to give a convenient interface to manage operations that return paginated responses. The pagination solution rely on the native Iterator Java interface, where users can call next(), hasNext(), and forEachRemaining() methods. All operation's build and execution logic will be handled internally.
Usage Example
int pageSize = 2;

SandboxPropertyReservationsPaginator paginator = sandboxClient.getPropertyReservations("PROPERTY_ID", pageSize);

paginator.forEachRemaining(response -> {
    List<SandboxReservationData> reservationsPage = response.getData();
    PageInfo pageInfo = response.getPageInfo();
});

While responses returned from normal method are of type Response<T, V>, paginated responses implements an extended version of the Response type called PaginatedResponse<T, V> that adds one extra field val pageInfo: PageInfo.

PageInfo holds the pagination data for the current page like cursor, nextPageCursor, pageSize, totalCount, hasNext.

4. Error Handling
One important aspect in this PR is changing how we handle exceptions. Currently, the SDK throws exceptions on both service exceptions 500s, and if the GraphQL response contains any error in the errors list.
In this newer version, the errors are treated a bit differently.

The SDK throws an exception if the service is unreachable. ExpediaGroupServiceException
The SDK throws an exception if the service returns data as null. NoDataException
The SDK does NOT throw an exception if the response contains errors (partial data), instead, these errors will be accessible in the RawResponse as mentioned earlier. rawResponse.getErrors()

Testing

Manually tested using examples modules. Automated test to be added later.
Results

Got discoverable methods on SDK clients.
Got better abstraction for the operations execution.
Got pagination automated easy-to-use solution.
Addressed some concerns about error handling, might be improved further if needed.
Users don't have to import anything directly from Apollo package. Everything is wrapped with SDK customized models.

Notes

Java doc strings to be added in a separate PR.
Needs to merge changes in the PR to the operations definitions repository before merging this PR.

Which .md files do we need to update in the /docs folder? exception_handling.md? Any others?

Which .md files do we need to update in the /docs folder? exception_handling.md? Any others?

@jordan-n-schmidt We will need to update almost all docs. This PR changes how we typically execute operations. I'll open a follow up PR for this matter, didn't want this PR to go bigger 😄

Should we have query and mutation directories instead of function?

I'm working to clean the user-facing code from GraphQL specific terminologies (even in import paths). We can have two separate directories, but I'm not sure how should name them 🤔