OpenHands icon indicating copy to clipboard operation
OpenHands copied to clipboard

How to change the MAX_RESPONSE_LEN_CHAR of openhands-aci

Open Yesphet opened this issue 9 months ago • 4 comments

I want the LLM to read a local Python file, which is 35KB in size. From the logs, I can see that the FileReadAction was executed, but the file was truncated because the default MAX_RESPONSE_LEN_CHAR configuration of openhands-aci is only 16000. How can I modify this configuration value?

this is the logs output:

09:23:23 - ACTION
[Agent Controller c616a414b2b545d5851bd220208c3201] FileReadAction(path='/workspace/core/testflows/testflow.py', start=0, end=-1, thought='Let me first view the contents of `core/testflows/testflow.py` to understand the basic interface definitions of the test framework.', action='read', security_risk=None, impl_source=<FileReadSource.OH_ACI: 'oh_aci'>, view_range=None)
09:23:23 - openhands:INFO: agent_controller.py:466 - [Agent Controller c616a414b2b545d5851bd220208c3201] Setting agent(CodeActAgent) state from AgentState.RUNNING to AgentState.RUNNING
09:23:23 - OBSERVATION
[Agent Controller c616a414b2b545d5851bd220208c3201] AgentStateChangedObservation(content='', agent_state=<AgentState.RUNNING: 'running'>, observation='agent_state_changed')
09:23:23 - OBSERVATION
[Agent Controller c616a414b2b545d5851bd220208c3201] [Read from /workspace/core/testflows/testflow.py is successful.]
Here's the result of running `cat -n` on /workspace/core/testflows/testflow.py:
     1	import copy
     2	import threading
     3	import time
     4	from abc import abstractmethod
....
   461	        self._name = name
   462	        return self
   463	<response clipped><NOTE>Due to the max output limit, only part of this file has been shown to you. You should retry this tool after you have searched inside the file with `grep -n` in order to find the line numbers of what you are looking for.</NOTE>


Yesphet avatar Mar 05 '25 10:03 Yesphet

Hi @Yesphet, it's set here in the ACI repo: https://github.com/All-Hands-AI/openhands-aci/blob/main/openhands_aci/editor/config.py

ryanhoangt avatar Mar 05 '25 10:03 ryanhoangt

Hi @Yesphet, it's set here in the ACI repo: https://github.com/All-Hands-AI/openhands-aci/blob/main/openhands_aci/editor/config.py

@ryanhoangt Thank you for the response. I also saw this configuration in the openhands-aci codebase, so I can only modify the config.py file, then build a sandbox Docker image myself and specify the built image through SANDBOX_RUNTIME_CONTAINER_IMAGE, right? Is there a simpler way?

Yesphet avatar Mar 05 '25 10:03 Yesphet

If you have your dev environment set up, one easy way is to update the config value in your fork, then in OpenHands code base install the aci from your repo/branch, using something like poetry add git+https://github.com/username/openhands-aci.git#branch-name. The runtime image will be automatically updated with your change in the ACI.

ryanhoangt avatar Mar 05 '25 11:03 ryanhoangt

@ryanhoangt Thanks a lot~ I'll give it a shot.

Yesphet avatar Mar 05 '25 11:03 Yesphet

This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Apr 05 '25 02:04 github-actions[bot]

This issue was closed because it has been stalled for over 30 days with no activity.

github-actions[bot] avatar Apr 12 '25 02:04 github-actions[bot]