#1232·honcho

[Bug] OpenAI 400 BadRequestError when using newer models (e.g., gpt-6-luna): 'max_tokens' is not supported, use 'max_completion_tokens'

Author: farconadaCreated Sep 24, 2026Updated Sep 24, 2026
Labelsbughonchomaintainer-approved

Deploy mode

Self-hosted

Honcho version

v3.2.0

Describe the bug

Issue Description:

When configuring Honcho (specifically HONCHO_REASONING_MODEL or dialectic/deriver queries) with newer OpenAI models such as gpt-6-luna, API requests fail with a 400 BadRequestError.

OpenAI's latest model generations have deprecated/removed the legacy max_tokens parameter in favor of max_completion_tokens. Because Honcho passes max_tokens to the OpenAI client invocation, all requests to these models are rejected.
──────

Error Log:

zepp-honcho-api | openai.BadRequestError: Error code: 400 - {
zepp-honcho-api |   'error': {
zepp-honcho-api |     'message': "Unsupported parameter: 'max_tokens' is not supported with this model. Use 'max_completion_tokens' instead.",
zepp-honcho-api |     'type': 'invalid_request_error',
zepp-honcho-api |     'param': 'max_tokens',
zepp-honcho-api |     'code': 'unsupported_parameter'
zepp-honcho-api |   }
zepp-honcho-api | }

Downstream clients (such as agents making dialectic queries) consequently fail with:

WARNING plugins.memory.honcho.session: Honcho dialectic query failed: An unexpected error occurred

──────

Steps to Reproduce:

  1. Deploy Honcho API and Deriver services.

  2. Configure environment variables to use gpt-6-luna: HONCHO_REASONING_MODEL=gpt-6-luna

  3. Trigger a session or memory derivation that calls OpenAI.

  4. Check honcho-api / honcho-deriver container logs. ──────

Expected Behavior:

Honcho should successfully complete chat completion requests with newer models by utilizing max_completion_tokens instead of max_tokens, or by dynamically selecting the parameter depending on model
capability. ──────

Actual Behavior:

The OpenAI client raises openai.BadRequestError: 400 due to param: 'max_tokens'. ──────

Suggested Fix:

In the OpenAI API call wrapper (or LiteLLM / provider configuration within Honcho):

  1. Migrate from max_tokens to max_completion_tokens when sending chat completion requests to OpenAI, or
  2. Conditionally map max_tokens -> max_completion_tokens for newer model families (e.g. gpt-6*, o1*, o3*, etc.), or
  3. Update the underlying SDK / LiteLLM dependency if parameter translation is handled upstream. ──────

Workaround (temporary):

Reverting the model back to gpt-5.6-luna:

HONCHO_REASONING_MODEL=gpt-5.6-luna

Steps to reproduce

  1. Deploy Honcho v3.2.1 (ghcr.io/plastic-labs/honcho:latest) via Docker Compose.

  2. In your environment configuration, set the reasoning model to gpt-6-luna:

    HONCHO_REASONING_MODEL=gpt-6-luna                                                                                                                                                                        
                                                                                                                                                                                                             
  3. Send a message to Honcho or initiate a dialectic/deriver session that triggers an LLM completion call with OpenAI.

  4. Observe the honcho-api / honcho-deriver container logs.

Logs and evidence

bash

Additional context

No response