#801·shell_gpt

gpt-5.6 models: every request 400s when functions are enabled (function tools rejected on /v1/chat/completions)

Author: atilavahedianCreated Sep 1, 2026Updated Sep 1, 2026

With functions enabled (the default, OPENAI_USE_FUNCTIONS=true) and DEFAULT_MODEL set to any gpt-5.6 model, every sgpt invocation fails with an API error before producing any output:

Function tools with reasoning_effort are not supported for gpt-5.6-sol in /v1/chat/completions. To use function tools, use /v1/responses or set reasoning_effort to 'none'.

(HTTP 400, quoted verbatim from a recorded response. sgpt never sets reasoning_effort — the API rejects function tools on /v1/chat/completions for these models regardless.)

Reproduction

bash
pip install shell-gpt==1.5.1   # current PyPI release; same code path on main @ a082bd5
sgpt --install-functions
# in ~/.config/shell_gpt/.sgptrc:  DEFAULT_MODEL=gpt-5.6-sol
sgpt "how many files are in the current directory?"

Result: openai.BadRequestError: Error code: 400 with the message above ('type': 'invalid_request_error', 'param': 'reasoning_effort'). Observed with shell-gpt 1.5.1, openai SDK 2.54.0, Python 3.12, macOS, model gpt-5.6-sol; the same rejection is reported across the gpt-5.6 family in other projects, e.g. BerriAI/litellm#33221.

Why users can't work around it in config

The API error offers two escapes, and neither is currently reachable from sgpt:

  • /v1/responses: Handler.get_completion is hardcoded to client.chat.completions.create (sgpt/handlers/handler.py).
  • reasoning_effort='none': there is no config key for reasoning_effort (#760 proposed one but closed without it landing).
  • The litellm extra doesn't help either: pyproject.toml pins litellm == 1.83.4, which predates litellm's own handling of this (fixed in 1.97.0).

So the only user-side option today is downgrading DEFAULT_MODEL.

Verified fix

Routing the request to the Responses API restores function calling. I verified this empirically: 14 eval cases built from this repo's own README usage examples (file counting, JSON field extraction, grep, file writing), 5 runs per case — gpt-5.5 baseline passes 14/14; gpt-5.6-sol via chat/completions fails 14/14 with the 400 above; the identical agent (same prompt, same execute_shell_command schema, same params) with requests routed to /v1/responses passes 14/14 on gpt-5.6-sol (10/10 runs per case). The already-declared openai >= 2.0.0, < 3.0.0 dependency supports the Responses API, so no dependency change is needed — the change is confined to Handler.get_completion.

I'm happy to open a PR for the Responses routing if that's a direction you'd take. (The reasoning_effort: 'none' alternative should also unblock chat/completions per the error text, but I haven't tested it, and it presumably disables reasoning for these models.)

Full run records (every request/response, per-case results) are public here: https://github.com/atilavahedian/upshift/blob/main/reports/shellgpt-upgrade.md — the verification was done with upshift, a tool I'm building that diffs agent behavior across model versions; the records stand on their own regardless.