I experienced a fatal error with the `openhands` C...
# feedback
w
I experienced a fatal error with the
openhands
CLI (which I find to be much more ergonomic than the GUI OpenHands). The first exception was as follows (MacOS 26.0.1):
Copy code
Error: Prompt file /var/folders/kl/8qdy4n55727fq6437z7s7jdh0000gn/T/_MEIBqDxAC/openhands/sdk/context/condenser/prompts/summarizing_prompt.j2 not found
Traceback (most recent call last):
  File "openhands/sdk/context/prompts/prompt.py", line 43, in _get_template
  File "jinja2/environment.py", line 1016, in get_template
  File "jinja2/environment.py", line 975, in _load_template
  File "jinja2/loaders.py", line 126, in load
  File "jinja2/loaders.py", line 209, in get_source
jinja2.exceptions.TemplateNotFound: 'summarizing_prompt.j2' not found in search path: '/var/folders/kl/8qdy4n55727fq6437z7s7jdh0000gn/T/_MEIBqDxAC/openhands/sdk/context/condenser/prompts'
The full trace is provided later in the thread.
Here is the full trace:
Copy code
Error: Prompt file /var/folders/kl/8qdy4n55727fq6437z7s7jdh0000gn/T/_MEIBqDxAC/openhands/sdk/context/condenser/prompts/summarizing_prompt.j2 not found
Traceback (most recent call last):
  File "openhands/sdk/context/prompts/prompt.py", line 43, in _get_template
  File "jinja2/environment.py", line 1016, in get_template
  File "jinja2/environment.py", line 975, in _load_template
  File "jinja2/loaders.py", line 126, in load
  File "jinja2/loaders.py", line 209, in get_source
jinja2.exceptions.TemplateNotFound: 'summarizing_prompt.j2' not found in search path: '/var/folders/kl/8qdy4n55727fq6437z7s7jdh0000gn/T/_MEIBqDxAC/openhands/sdk/context/condenser/prompts'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "openhands_cli/simple_main.py", line 45, in main
  File "openhands_cli/agent_chat.py", line 174, in run_cli_entry
  File "openhands_cli/runner.py", line 83, in process_message
  File "openhands_cli/runner.py", line 103, in _run_with_confirmation
  File "openhands/sdk/conversation/impl/local_conversation.py", line 245, in run
  File "openhands/sdk/agent/agent.py", line 154, in step
  File "openhands/sdk/context/condenser/base.py", line 91, in condense
  File "openhands/sdk/context/condenser/llm_summarizing_condenser.py", line 58, in get_condensation
  File "openhands/sdk/context/prompts/prompt.py", line 51, in render_template
  File "openhands/sdk/context/prompts/prompt.py", line 45, in _get_template
FileNotFoundError: Prompt file /var/folders/kl/8qdy4n55727fq6437z7s7jdh0000gn/T/_MEIBqDxAC/openhands/sdk/context/condenser/prompts/summarizing_prompt.j2 not found
Traceback (most recent call last):
  File "openhands/sdk/context/prompts/prompt.py", line 43, in _get_template
  File "jinja2/environment.py", line 1016, in get_template
  File "jinja2/environment.py", line 975, in _load_template
  File "jinja2/loaders.py", line 126, in load
  File "jinja2/loaders.py", line 209, in get_source
jinja2.exceptions.TemplateNotFound: 'summarizing_prompt.j2' not found in search path: '/var/folders/kl/8qdy4n55727fq6437z7s7jdh0000gn/T/_MEIBqDxAC/openhands/sdk/context/condenser/prompts'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "openhands_cli/simple_main.py", line 59, in <module>
  File "openhands_cli/simple_main.py", line 45, in main
  File "openhands_cli/agent_chat.py", line 174, in run_cli_entry
  File "openhands_cli/runner.py", line 83, in process_message
  File "openhands_cli/runner.py", line 103, in _run_with_confirmation
  File "openhands/sdk/conversation/impl/local_conversation.py", line 245, in run
  File "openhands/sdk/agent/agent.py", line 154, in step
  File "openhands/sdk/context/condenser/base.py", line 91, in condense
  File "openhands/sdk/context/condenser/llm_summarizing_condenser.py", line 58, in get_condensation
  File "openhands/sdk/context/prompts/prompt.py", line 51, in render_template
  File "openhands/sdk/context/prompts/prompt.py", line 45, in _get_template
FileNotFoundError: Prompt file /var/folders/kl/8qdy4n55727fq6437z7s7jdh0000gn/T/_MEIBqDxAC/openhands/sdk/context/condenser/prompts/summarizing_prompt.j2 not found
[PYI-99217:ERROR] Failed to execute script 'simple_main' due to unhandled exception!
q
apologies for this! im guessing this occurred when using the executable binary? ill be patching this asap this coming week
w
Yes, using the executable.
I encountered this exception again, but I’m not sure what the 2 instances had in common. In any cases, I’m looking forward to the patched executable.
q
I believe it occurs when the conversation grows too long and the condenser attempts to shrink it the executable is missing a prompt template
w
Yes, that makes sense: the fact that it can’t find
summarizing_prompt.j2
c
I encountered this, and to mitigate, I had the agent modify
condenser.max_size
to a higher value (e.g. it got to 700 events on my machine), to be able to resume and continue those conversations. The agent just needs to know some information where to look for these values, like this: https://gist.github.com/enyst/4b2726b4c2f85b8ce8a9cd28b3dcde0d
👍 1
The important part, for now, is that it needs to modify both the value stored in the conversation .json and in the agent settings json.
(otherwise it runs into another error if the settings stored don't match the base settings)