How can I load previous conversation? Agent was st...
# dev-help
r
How can I load previous conversation? Agent was stuck at this place
Copy code
...
Initialized conversation install-1f9a045999e68fce
...
Pausing the agent...
^C⚠️ Session was interrupted: interrupted

^CException ignored in: <module 'threading' from '/Users/seven/.pyenv/versions/3.12.1/lib/python3.12/threading.py'>
Traceback (most recent call last):
  File "/Users/seven/.pyenv/versions/3.12.1/lib/python3.12/threading.py", line 1593, in _shutdown
    atexit_call()
  File "/Users/seven/.pyenv/versions/3.12.1/lib/python3.12/concurrent/futures/thread.py", line 31, in _python_exit
    t.join()
  File "/Users/seven/.pyenv/versions/3.12.1/lib/python3.12/threading.py", line 1147, in join
    self._wait_for_tstate_lock()
  File "/Users/seven/.pyenv/versions/3.12.1/lib/python3.12/threading.py", line 1167, in _wait_for_tstate_lock
    if lock.acquire(block, timeout):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyboardInterrupt:
Previously I got an answer to use
-n
flag, but it doesn't work ❯ openhands -n install-1f9a045999e68fce OpenHands CLI v0.51.1 Initialized conversation install--080fc66b55856ab Let's start building! What do you want to build? Loading previous conversation. Type /help for help
Copy code
> /status

Conversation ID: install--080fc66b55856ab
Uptime:          0h 2m 19s

┌───────────────────────────────────────────────────────────────────────────────────| Usage Metrics |───────────────────────────────────────────────────────────────────────────────────┐
│   Total Cost (USD):    $0.000000                                                                                                                                                      │
│                                                                                                                                                                                       │
│   Total Input Tokens:  0                                                                                                                                                              │
│      Cache Hits:       0                                                                                                                                                              │
│      Cache Writes:     0                                                                                                                                                              │
│   Total Output Tokens: 0                                                                                                                                                              │
│                                                                                                                                                                                       │
│   Total Tokens:        0                                                                                                                                                              │
└───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

>
l
I think the parameter is correct, but as shown in your log, the name of the conversation that it tries to load is different from the one you passed. It's some new internal logic that messes with the ID. The session ID you passed:
Copy code
❯ openhands -n install-1f9a045999e68fce
The session ID that is loaded:
Copy code
Initialized conversation install--080fc66b55856ab
This code introduced in setup.py 2 weeks ago seems to be the cause of this behavior:
Copy code
# Limit total session ID length to 32 characters for Kubernetes compatibility:
    # - 'openhands-runtime-' (18 chars) + session_id (32 chars) = 50 chars
    # - Leaves 13 chars for suffixes like '-svc' (4), '-pvc' (4), '-ingress-code' (13)
    if len(session_name) > 16:
        # If session_name is too long, use first 16 chars + 15-char hash for better readability
        # e.g., "vscode-extension" -> "vscode-extensio-{15-char-hash}"
        session_id = f'{session_name[:16]}-{hash_str[:15]}'
    else:
        # If session_name is short enough, use it + remaining space for hash
        remaining_chars = 32 - len(session_name) - 1  # -1 for the dash
        session_id = f'{session_name}-{hash_str[:remaining_chars]}'

    return session_id[:32]  # Ensure we never exceed 32 characters
Source: PR #9877: Add configurable runtime support for issue resolver and fix: Kubernetes pod naming limits Restore the
generate_sid
function as it was before and it should work. @calm-artist-7206 you might want to take a look at this.
c
Could you please use the session name, without hash? just like you name it first time, so
-n install
ouch, llamantino, you’re exactly right
l
I tried it, it's renamed every time
c
The hash is different for different users because it’s computed from the jwt secret on the local machine
l
Sorry, I meant it's renamed even when using just the id. It was matching before.
🤔 1
If you restore the previous version of the function, the name is preserved.
oh sorry I had tried the name from sessions. I thought it was supposed to work with that id.
c
Aha, it works only with the session_name
l
Sorry, it's because I remembered this conversation: https://openhands-ai.slack.com/archives/C086ARSNMGA/p1753824999616309
Yes, tried it again. The id should work (unless it's an old conversation whose name is affected by the new logic, I suppose).
👍 1