icy-rocket-49995
10/10/2025, 8:39 PM(oh) [16:32] MM305551-PC: Server(main) $ uvx --version
uvx 0.9.1 (9887ef5bd 2025-10-09)
(oh) [16:36] MM305551-PC: Server(main) $ alias oh
alias oh='uvx --python 3.12 --from openhands-ai openhands'
(oh) [16:36] MM305551-PC: Server(main) $
And here is the error:
Agent running... (Press Ctrl-P to pause)
16:32:04 - openhands:ERROR: agent_controller.py:373 - [Agent Controller aa58c055-7e8c-46-9ab5842d7e165a6] Error while running the agent (session ID: aa58c055-7e8c-46-9ab5842d7e165a6): litellm.BadRequestError: OpenAIException - litellm.BadRequestError: OpenAIException - max_tokens must be at least 1, got -954.. Received Model Group=mistralai/Mistral-Small-24B-Instruct-2501
Available Model Group Fallbacks=None
Traceback (most recent call last):
File "/Users/dkim/.cache/uv/archive-v0/ykFNHAZTUhairTg_mwYYO/lib/python3.12/site-packages/litellm/llms/openai/openai.py", line 745, in completion
raise e
File "/Users/dkim/.cache/uv/archive-v0/ykFNHAZTUhairTg_mwYYO/lib/python3.12/site-packages/litellm/llms/openai/openai.py", line 673, in completion
) = self.make_sync_openai_chat_completion_request(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/dkim/.cache/uv/archive-v0/ykFNHAZTUhairTg_mwYYO/lib/python3.12/site-packages/litellm/litellm_core_utils/logging_utils.py", line 237, in sync_wrapper
result = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/Users/dkim/.cache/uv/archive-v0/ykFNHAZTUhairTg_mwYYO/lib/python3.12/site-packages/litellm/llms/openai/openai.py", line 489, in make_sync_openai_chat_completion_request
raise e
File "/Users/dkim/.cache/uv/archive-v0/ykFNHAZTUhairTg_mwYYO/lib/python3.12/site-packages/litellm/llms/openai/openai.py", line 471, in make_sync_openai_chat_completion_request
raw_response = openai_client.chat.completions.with_raw_response.create(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/dkim/.cache/uv/archive-v0/ykFNHAZTUhairTg_mwYYO/lib/python3.12/site-packages/openai/_legacy_response.py", line 364, in wrapped
return cast(LegacyAPIResponse[R], func(*args, **kwargs))
^^^^^^^^^^^^^^^^^^^^^
File "/Users/dkim/.cache/uv/archive-v0/ykFNHAZTUhairTg_mwYYO/lib/python3.12/site-packages/openai/_utils/_utils.py", line 287, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/Users/dkim/.cache/uv/archive-v0/ykFNHAZTUhairTg_mwYYO/lib/python3.12/site-packages/openai/resources/chat/completions/completions.py", line 1150, in create
return self._post(
^^^^^^^^^^^
File "/Users/dkim/.cache/uv/archive-v0/ykFNHAZTUhairTg_mwYYO/lib/python3.12/site-packages/openai/_base_client.py", line 1259, in post
return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/dkim/.cache/uv/archive-v0/ykFNHAZTUhairTg_mwYYO/lib/python3.12/site-packages/openai/_base_client.py", line 1047, in request
raise self._make_status_error_from_response(err.response) from None
openai.BadRequestError: Error code: 400 - {'error': {'message': 'litellm.BadRequestError: OpenAIException - max_tokens must be at least 1, got -954.. Received Model Group=mistralai/Mistral-Small-24B-Instruct-2501\nAvailable Model Group Fallbacks=None', 'type': None, 'param': None, 'code': '400'}}
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/dkim/.cache/uv/archive-v0/ykFNHAZTUhairTg_mwYYO/lib/python3.12/site-packages/litellm/main.py", line 2125, in completion
raise e
File "/Users/dkim/.cache/uv/archive-v0/ykFNHAZTUhairTg_mwYYO/lib/python3.12/site-packages/litellm/main.py", line 2097, in completion
response = openai_chat_completions.completion(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/dkim/.cache/uv/archive-v0/ykFNHAZTUhairTg_mwYYO/lib/python3.12/site-packages/litellm/llms/openai/openai.py", line 756, in completion
raise OpenAIError(
litellm.llms.openai.common_utils.OpenAIError: Error code: 400 - {'error': {'message': 'litellm.BadRequestError: OpenAIException - max_tokens must be at least 1, got -954.. Received Model Group=mistralai/Mistral-Small-24B-Instruct-2501\nAvailable Model Group Fallbacks=None', 'type': None, 'param': None, 'code': '400'}}
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/dkim/.cache/uv/archive-v0/ykFNHAZTUhairTg_mwYYO/lib/python3.12/site-packages/openhands/controller/agent_controller.py", line 371, in _step_with_exception_handling
await self._step()
File "/Users/dkim/.cache/uv/archive-v0/ykFNHAZTUhairTg_mwYYO/lib/python3.12/site-packages/openhands/controller/agent_controller.py", line 925, in _step
raise e
File "/Users/dkim/.cache/uv/archive-v0/ykFNHAZTUhairTg_mwYYO/lib/python3.12/site-packages/openhands/controller/agent_controller.py", line 878, in _step
action = self.agent.step(self.state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/dkim/.cache/uv/archive-v0/ykFNHAZTUhairTg_mwYYO/lib/python3.12/site-packages/openhands/agenthub/codeact_agent/codeact_agent.py", line 219, in step
response = self.llm.completion(**params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/dkim/.cache/uv/archive-v0/ykFNHAZTUhairTg_mwYYO/lib/python3.12/site-packages/tenacity/__init__.py", line 338, in wrapped_f
return copy(f, *args, **kw)
^^^^^^^^^^^^^^^^^^^^
File "/Users/dkim/.cache/uv/archive-v0/ykFNHAZTUhairTg_mwYYO/lib/python3.12/site-packages/tenacity/__init__.py", line 477, in __call__
do = self.iter(retry_state=retry_state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/dkim/.cache/uv/archive-v0/ykFNHAZTUhairTg_mwYYO/lib/python3.12/site-packages/tenacity/__init__.py", line 378, in iter
result = action(retry_state)
^^^^^^^^^^^^^^^^^^^
File "/Users/dkim/.cache/uv/archive-v0/ykFNHAZTUhairTg_mwYYO/lib/python3.12/site-packages/tenacity/__init__.py", line 400, in <lambda>
self._add_action_func(lambda rs: rs.outcome.result())
^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/python@3.12/3.12.6/Frameworks/Python.framework/Versions/3.12/lib/python3.12/concurrent/futures/_base.py", line 449, in result
return self.__get_result()
^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/python@3.12/3.12.6/Frameworks/Python.framework/Versions/3.12/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
raise self._exception
File "/Users/dkim/.cache/uv/archive-v0/ykFNHAZTUhairTg_mwYYO/lib/python3.12/site-packages/tenacity/__init__.py", line 480, in __call__
result = fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "/Users/dkim/.cache/uv/archive-v0/ykFNHAZTUhairTg_mwYYO/lib/python3.12/site-packages/openhands/llm/llm.py", line 331, in wrapper
resp: ModelResponse = self._completion_unwrapped(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/dkim/.cache/uv/archive-v0/ykFNHAZTUhairTg_mwYYO/lib/python3.12/site-packages/litellm/utils.py", line 1356, in wrapper
raise e
File "/Users/dkim/.cache/uv/archive-v0/ykFNHAZTUhairTg_mwYYO/lib/python3.12/site-packages/litellm/utils.py", line 1231, in wrapper
result = original_function(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/dkim/.cache/uv/archive-v0/ykFNHAZTUhairTg_mwYYO/lib/python3.12/site-packages/litellm/main.py", line 3733, in completion
raise exception_type(
^^^^^^^^^^^^^^^
File "/Users/dkim/.cache/uv/archive-v0/ykFNHAZTUhairTg_mwYYO/lib/python3.12/site-packages/litellm/litellm_core_utils/exception_mapping_utils.py", line 2273, in exception_type
raise e
File "/Users/dkim/.cache/uv/archive-v0/ykFNHAZTUhairTg_mwYYO/lib/python3.12/site-packages/litellm/litellm_core_utils/exception_mapping_utils.py", line 448, in exception_type
raise BadRequestError(
litellm.exceptions.BadRequestError: litellm.BadRequestError: OpenAIException - litellm.BadRequestError: OpenAIException - max_tokens must be at least 1, got -954.. Received Model Group=mistralai/Mistral-Small-24B-Instruct-2501
Available Model Group Fallbacks=None
16:32:04 - openhands:ERROR: loop.py:24 - BadRequestError: litellm.BadRequestError: OpenAIException - litellm.BadRequestError: OpenAIException - max_tokens must be at least 1, got -954.. Received Model Group=mistralai/Mistral-Small-24B-Instruct-2501
Available Model Group Fallbacks=None
⚠️ Session was interrupted: error
⚠️ DEPRECATION WARNING ⚠️
This CLI interface is deprecated and will be removed in a future version.
Please migrate to the new OpenHands CLI:
For more information, visit: https://docs.all-hands.dev/usage/how-to/cli-mode
======================================================================
As the CLI messages show, the cli-mode is going to be deprecated? Can we keep this feature? I really like to use openhands on cli.calm-artist-7206
10/10/2025, 9:03 PMLLM_MAX_OUTPUT_TOKENS=1024 ? Or vary that number, I don't find how much it's able to outputcalm-artist-7206
10/10/2025, 9:04 PM